import java.util.*;
import java.io.*;

public class D {
	FastScanner in;
	PrintWriter out;

	public void solve() throws IOException {
		int n = in.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = in.nextInt();
		}
		int MAXN = 5010;
		double[] dif = new double[MAXN];
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				double pr = n * (n - 1) / 2;
				dif[Math.abs(a[i] - a[j])] += 1.0 / pr;
			}
		}
		double[] dp = new double[2 * MAXN];
		for (int i = 0; i < MAXN; i++) {
			for (int j = 0; j < MAXN; j++) {
				dp[i + j] += dif[i] * dif[j];
			}
		}
		double ans = 0;
		for (int i = 0; i < dif.length; i++) {
			double cur = 0;
			for (int j = 0; j < i; j++) {
				cur += dp[j];
			}
			ans += cur * dif[i];
		}
		out.println(ans);
	}

	public void run() {
		try {
			in = new FastScanner();
			out = new PrintWriter(System.out);

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

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