import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;


public class D {	
	BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;
    
	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);

        int MAX = 5000 + 1;
        long[] diffCount = new long[MAX];
        for (int i = 0; i < N; i++) {
            for (int j = i+1; j < N; j++) {
                int diff = A[j] - A[i];
                diffCount[diff]++;
            }
        }

        int MAX2 = 5000 * 2 + 1;
        long[] diffCount2 = new long[MAX2];
        for (int i = 0; i < MAX; i++) {
            for (int j = 0; j < MAX; j++) {
                int diff = i + j;
                diffCount2[diff] += diffCount[i] * diffCount[j];
            }
        }

        long ansCount = 0;
        for (int i = 0; i < MAX2; i++) {
            for (int j = 0; j < MAX; j++) {
                int diff = i - j;
                if (diff < 0) {
                    ansCount += diffCount2[i] * diffCount[j];
                }
            }
        }
        double ans = 1.0 * ansCount / N / N / N;
        out.println(ans);
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		new D().run();
	}
	
	public void run() {
        try {
            reader = new BufferedReader(new InputStreamReader(System.in));
            tokenizer = null;
            out = new PrintWriter(System.out);
            solve();
            reader.close();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

}
