import java.lang.reflect.Array;
import java.util.*;
import java.io.*;

public class VC8D {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    final long MOD = 1000L * 1000L * 1000L + 7;
    void solve() throws IOException {
        int n = nextInt();
        int[] arr = nextIntArr(n);
        Arrays.sort(arr);
        int N = 5000;
        int[] hist = new int[1 + N];
        for(int i = 0; i < n; i++) {
            for(int j = i + 1; j < n; j++) {
                hist[arr[j] - arr[i]]++;
            }
        }
        double res = 0;
        int[] suf = new int[1 + N];
        suf[N] = hist[N];
        for(int i = N - 1; i >= 0; i--) {
            suf[i] = hist[i] + suf[i + 1];
        }
        for(int i = 1; i <= N; i++) {
            for(int j = 1; j <= N; j++) {
                int sum = i + j;
                if(sum < N) {
                    res += suf[sum + 1] * hist[i] * hist[j];
                }
            }
        }
        out(res / ((n - 1) * n / 2) / ((n - 1) * n / 2) / ((n - 1) * n / 2));
    }
    private void outln(Object o) {
        System.out.println(o);
    }
    private void out(Object o) {
        System.out.print(o);
    }
    public VC8D() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new VC8D();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}
