import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class JerryProtest {
	public static void main(String[] args) {
		InputReader r = new InputReader(System.in);
		int n = r.nextInt();
		int[] arr = new int[n];
		for (int i = 0; i < arr.length; i++) {
			arr[i] = r.nextInt();
		}
		Arrays.sort(arr);
		double[] negativeScore = new double[5055];
		double[] positiveScore = new double[5055];
		double total = (n * (n - 1)) / 2;
		double p = 1.0 / total;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				int score = arr[j] - arr[i];
				negativeScore[score] += p;
				positiveScore[score] += p;
			}
		}
		double[] sum = new double[5055];
		sum[sum.length - 1] = positiveScore[sum.length - 1];
		for (int i = sum.length - 2; i >= 0; i--) {
			sum[i] = positiveScore[i] + sum[i + 1];
		}
		double res = 0;
		for (int i = 0; i < negativeScore.length - 2; i++) {
			for (int j = 0; j < negativeScore.length - 2; j++) {
				int negative = i + j;
				if (negative+1 >= sum.length)
					continue;
				double currP = negativeScore[i] * negativeScore[j] * sum[negative + 1];
				res += currP;
			}
		}
		System.out.println(res);
	}

	static class InputReader {
		private BufferedReader reader;
		private StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public InputReader(FileReader stream) {
			reader = new BufferedReader(stream);
			tokenizer = null;
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}

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

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

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

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