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

public class ProblemD {

	public static void main(String[] args) {
		InputReader in = new InputReader();
		PrintWriter out = new PrintWriter(System.out);

		new ProblemD().solve(in, out);

		out.close();
	}

	public void solve(InputReader in, PrintWriter out) {
		int n = in.nextInt();

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

		Arrays.sort(a);

		double prob = 1.0 / (n * (n - 1) / 2);

		double[] diff = new double[5000];
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				diff[a[j] - a[i]] += prob;
			}
		}

		double[] sum = new double[5000];
		for (int i = 0; i < 5000; i++) {
			for (int j = 0; i + j < 5000; j++) {
				sum[i + j] += diff[i] * diff[j];
			}
		}

		double res = 0;
		double prefix = 0;
		for (int i = 0; i < 5000; i++) {
			res += diff[i] * prefix;
			prefix += sum[i];
		}

		out.println(res);
	}

	static class InputReader {
		public BufferedReader br;
		public StringTokenizer st;

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

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

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

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

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

		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
	}
}
