import java.io.*;
import java.util.*;

public class tank {

    static final FastScanner fs = new FastScanner();

    //static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int t = 1;
        while(t-- > 0) {
            run_case();
        }

        //out.close();
    }

    static void run_case() {
        int n = fs.nextInt();
        int[] a = fs.readArray(n);

        int[] diff = new int[5001];

        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                diff[Math.abs(a[i] - a[j])]++;
            }
        }

        long[] sum = new long[11000];
        long[] cnt = new long[11000];

        for (int i = 0; i < 5001; i++) {
            if(diff[i] == 0) continue;
            for (int j = i; j < 5001; j++) {
                if(diff[j] == 0) continue;

                sum[i + j] += diff[i] * diff[j];
            }
        }

        for (int i = 1; i < 11000; i++) {
            cnt[i] = cnt[i - 1] + sum[i];
        }

        long ans = 0;

        for (int i = 1; i < 5001; i++) {
            if(diff[i] == 0) continue;

            ans += 2 * cnt[i - 1] * diff[i];
        }

        double len = 0, up = ans;

        for (int i = 0; i < 5001; i++) {
            len += diff[i];
        }

        up /= len;
        up /= len;
        up /= len;

        System.out.println(up);
    }

    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        String nextLine(){
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }

            return "";
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] readArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}