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


public class D {

	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		int n = nextInt();
		int[]a = new int[n+1];
		for (int i = 1; i <= n; i++) {
			a[i] = nextInt();
		}
		Arrays.sort(a, 1, n+1);
		double ans1 = 0;
		long sum = 0;
		for (int i = 1; i <= n; i++) {
			for (int j = i; j <= n; j++) {
				sum += (i-1)*(j-1); 
			}
		}
		ans1 = 0.125;
		double ans2 = 0;
		int[]d = new int[5001];
		for (int i = 1; i <= n; i++) {
			for (int j = 1; j < i; j++) {
				d[a[i]-a[j]]++;
			}
		}
		long[]dp_sum = new long[5001];
		for (int i = 1; i <= 5000; i++) {
			dp_sum[i] = dp_sum[i-1] + d[i];
		}
		double q = n*(n-1);
		for (int i = 1; i <= 5000; i++) {
			for (int j = 1; j <= 5000; j++) {
				if (i+j > 5000 || i+j < -5000 || d[Math.abs(i)]==0 || d[Math.abs(j)]==0)
					continue;
				ans2 += d[Math.abs(i)]/ q * d[Math.abs(j)] / q *(dp_sum[5000]-dp_sum[i+j]) / q;
			}
		}
		System.out.println(ans2 / ans1);
		pw.close();
	}
	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}
	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}
	private static String next() throws IOException {
		while (st==null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}
