// package CF /

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

public class B {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt();
		int [] a = new int[n];
		for (int i = 0; i < a.length; i++) {
			a[i] = sc.nextInt();
		}
		int [] diff = new int[5002];
		int den = 0;
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a.length; j++) {
				if(i == j || a[i] > a[j]) continue;
				den++;
				diff[a[j] - a[i]]++;
			}
		}
		long [] cum = new long[5002];
		for (int i = diff.length-1; i >= 0; i--) {
			cum[i] = diff[i];
			if(i+1 < diff.length) cum[i] += cum[i+1];
		}
		long num = 0;
		for (int i = 0; i < cum.length; i++) {
			for (int j = 0; j < cum.length; j++) {
				if(i+j+1 >= cum.length) continue;
				num += 1l*diff[i]*diff[j]*cum[i+j+1];
			}
		}
		out.println(1.0 * num / (1l*den*den*den));
		out.flush();
		out.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(FileReader fileReader) {
			br = new BufferedReader(fileReader);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

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

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

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}
}