import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;

public class D
{
	String line;
	StringTokenizer inputParser;
	BufferedReader is;
	FileInputStream fstream;
	DataInputStream in;
	
	void openInput(String file)
	{

		if(file==null)is = new BufferedReader(new InputStreamReader(System.in));//stdin
		else
		{
			try{
		
				
			fstream = new FileInputStream(file);
			in = new DataInputStream(fstream);
			is = new BufferedReader(new InputStreamReader(in));
			}catch(Exception e)
			{
				System.err.println(e);
			}
		}

	}
	
	void readNextLine()
	{
		try {
			line = is.readLine();
			if(line!=null)inputParser = new StringTokenizer(line, " ");
			//System.err.println("Input: " + line);
		} catch (IOException e) {
			System.err.println("Unexpected IO ERROR: " + e);
		}	
		
	}
	
	int NextInt()
	{
		String n = inputParser.nextToken();
		int val = Integer.parseInt(n);
		
		//System.out.println("I read this number: " + val);
		return val;
	}
    
    double NextDouble()
    {
            String n = inputParser.nextToken();
            double val = Double.parseDouble(n);
            
            //System.out.println("I read this number: " + val);
            return val;
    }
	
	long NextLong()
    {
            String n = inputParser.nextToken();
            
            long val = Long.parseLong(n);
            
            return val;
    }
	
	String NextString()
	{
		String n = inputParser.nextToken();
		return n;
	}
	
	void closeInput()
	{
		try {
			is.close();
		} catch (IOException e) {
			System.err.println("Unexpected IO ERROR: " + e);
		}
			
	}
	
	
	public static void main(String [] argv)
	{
		String filePath=null;
		if(argv.length>0)filePath=argv[0];
		new D(filePath);
	}

	public D(String inputFile)
	{
		openInput(inputFile);
		//readNextLine();
		int T=1;//NextInt();
		StringBuilder sb = new StringBuilder();
		for(int t=1; t<=T; t++)
		{
			readNextLine();
			int N=NextInt();
			readNextLine();
			Integer [] a = new Integer[N];
			for(int i=0; i<N; i++)
			{
				a[i] = NextInt();
			}
			Arrays.sort(a);
			
			int [] r1 = new int[5001];
			for(int i=0; i<N; i++)
				for(int j=i+1; j<N; j++)
					r1[a[j]-a[i]]++;
			
			int [] r2 = new int[10001];
			for(int i=1; i<5001; i++)
				if(r1[i]>0)
				for(int j=1; j<5001; j++)
					if(r1[j]>0)
						r2[i+j]++;
			int cnt=0;
			for(int i=0; i<10001; i++)
			{
				if(r2[i]==0)continue;
				for(int j=i+1; j<5001; j++)
					if(r1[j]>0)
					cnt+=r1[j]*r2[i];
			}
			double ans = (double)cnt / N;
			ans /= N;
			ans /= N;
			sb.append(ans);
		}
		System.out.print(sb);
		
		closeInput();		
	}

}