import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * Created by vitalii on 13.02.2016.
 */
public class D {

    int n;

    int max2 = 10000;
    int max1 = 5000;

    public void solve() throws IOException {
        int n = nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        Arrays.sort(a);
        long[] cnt1 = new long[max1+1];
        for (int i = 0; i < n; i++) {
            for (int j = i+1; j < n; j++) {
                cnt1[a[j]-a[i]]++;
            }
        }

        long[] cnt2 = new long[max2+1];
        for (int i = 0; i <= max1; i++) {
            for (int j = 0; j<= max1; j++) {
                cnt2[i+j] += cnt1[i] * cnt1[j];
            }
        }

        for (int i = 1; i <= max2; i++) {
            cnt2[i] += cnt2[i-1];
        }

        long ans = 0;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                ans += cnt2[a[j]-a[i] - 1];
            }
        }

        double res = ans;
        res = 8 * res / n / n / n / (n-1) / (n-1) / (n-1);
        out.println(res);

    }


    public static void main(String[] args) throws IOException {
        new D().run();
    }

    public void run() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st;

    public String next() throws IOException {
        while (st == null || !st.hasMoreElements()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

    public Long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public Integer nextInt() throws IOException {
        return Integer.parseInt(next());
    }


}
