import java.io.*;
import java.util.*;

public class Codeforces
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb=new StringBuilder();
        int n=Integer.parseInt(bu.readLine());
        String s[]=bu.readLine().split(" ");
        int i,a[]=new int[n],j,N=5000,r=0;
        for(i=0;i<n;i++)
        a[i]=Integer.parseInt(s[i]);

        double suf[]=new double[N+2],f[]=new double[N+1],ans=0;
        for(i=0;i<n;i++)
        for(j=i+1;j<n;j++,r++)
        f[Math.abs(a[i]-a[j])]++;
        for(i=5000;i>=0;i--)
        {
            f[i]/=r;
            suf[i]=suf[i+1]+f[i];
        }
        for(i=1;i<5000;i++)
        for(j=1;i+j<5000;j++)
        ans+=suf[i+j+1]*f[i]*f[j];
        System.out.print(ans);
    }
}