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

public class Codef{
    public static void main(String[] args) throws IOException{
        BufferedReader vod=new BufferedReader(new InputStreamReader(System.in));
        int n=Integer.parseInt(vod.readLine());
        StringTokenizer s=new StringTokenizer(vod.readLine());
        int ar[]=new int[n];
        int d[]=new int[5002];
        int c[]=new int[5002];
        long ans=0;
        for (int i=0; i<n; i++)
            ar[i]=Integer.parseInt(s.nextToken());
        Arrays.sort(ar);
        for (int i=0; i<n; i++)
            for (int j=i+1; j<n; j++)
                d[ar[j]-ar[i]]++;
        for (int i=5000; i>0; i--)
            c[i]=c[i+1]+d[i];
        for (int i=0; i<5000; i++)
            if (d[i]>0)
                for (int j=0; j<5000; j++)
                    if (d[j]>0&i+j<5000) 
                        ans+=(long)d[i]*d[j]*c[i+j+1];
        System.out.print(ans/Math.pow(n*(n-1)/2,3));
    }
}