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

public class Problem {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(reader.readLine());
        int[] arr = new int[n];
        StringTokenizer sToken = new StringTokenizer(reader.readLine());
        for (int i=0; i<n; i++) {
            arr[i] = Integer.parseInt(sToken.nextToken());
        }
        Arrays.sort(arr);
        int[] diff = new int[5005];
        int item = 0;
        for (int i=0; i<n; i++) {
            for (int j=i+1; j<n; j++) {
                diff[arr[j]-arr[i]]++; item++;
            }
        }
        int[] suffsum = new int[10005];
        for (int i=5000; i>=0; i--) suffsum[i] = suffsum[i+1] + diff[i];
        int res = 0;
        for (int i=0; i<=5000; i++) {
            for (int j=0; j<=5000; j++) {
                res+=(diff[i]*diff[j]*suffsum[i+j+1]);
            }
        }
        double ans = (double) res/(double)(item*item*item);
        System.out.println(ans);
    }
}