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

public class JerrysProtest_626D
{
	public static void main(String[] args) throws IOException
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] arr = new int[n];
		for(int i=0;i<n;i++)
			arr[i] = sc.nextInt();
		Arrays.sort(arr);
		//observe that the ai <= 5000
		int max = 5002;
		int[] dif = new int[max];
		for(int i=0;i<n;i++)
			for(int j=i+1;j<n;j++)
				dif[arr[j] - arr[i]]++;
		int[] cum = new int[max];
		cum[max-1] = dif[max-1];
		for(int i=max-2;i>=0;i--)
			cum[i] = cum[i+1] + dif[i];
		long cnt = 0;
		for(int i=0;i<max;i++)
			for(int j=0;j<max;j++)
				if(i + j + 1 < max)
				{
					cnt+=(1l*dif[i] * dif[j] * cum[i+j+1]);
				}
		System.out.println(1.0 * cnt / (1l*n*n*n));


	}
	static class Scanner{
		StringTokenizer st;BufferedReader br;
		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}
		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 double nextDouble() throws IOException {return Double.parseDouble(next());}
		public boolean ready() throws IOException {return br.ready();}
	}
}
