import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class CF626D {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);
	static boolean debug = false;

	static <T extends Comparable<? super T>> int lowerBound(ArrayList<T> a, T k) {
		int n = a.size();
		int l = -1, r = n;
		while (r - l > 1) {
			int m = (l + r)/2;
			if (k.compareTo(a.get(m)) <= 0) r = m;
			else l = m;
		}
		return r;
	}

	static void solve() {
		int n = in.nextInt();
		int[] a = new int[n];
		for (int i=0; i<n; i++) {
			a[i] = in.nextInt();
		}

		ArrayList<Integer> diff = new ArrayList<>();
		for (int i=0; i<n; i++) {
			for (int j=i+1; j<n; j++) {
				diff.add(Math.abs(a[i] - a[j]));
			}
		}

		ArrayList<Integer> diff2 = new ArrayList<>();
		int m = diff.size();
		for (int i=0; i<m; i++) {
			for (int j=0; j<m; j++) {
				diff2.add(diff.get(i) + diff.get(j));
			}
		}

		Collections.sort(diff);
		Collections.sort(diff2);
		dump(diff);
		dump(diff2);

		double ans = 0;
		for (int i=0; i<m; i++) {
			int k = lowerBound(diff2, diff.get(i));
			ans += k;
		}

		out.printf("%.20f\n", ans/n/n/n);
	}

	public static void main(String[] args) {
		debug = args.length > 0;
		long start = System.currentTimeMillis();

		solve();
		out.flush();

		long end = System.currentTimeMillis();
		dump((end-start) + "ms");
		in.close();
		out.close();
	}

	static void dump(Object... o) { if (debug) System.err.println(Arrays.deepToString(o)); }
}