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

public class Main {
    public static void main(String[] args) throws IOException{
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter out = new PrintWriter(new PrintStream(System.out));
        int n=Integer.parseInt(f.readLine());
        int[]arr=new int[n];
        StringTokenizer st=new StringTokenizer(f.readLine());

        for(int i=0;i<n;i++){
            arr[i]=Integer.parseInt(st.nextToken());
        }
        double[]diff=new double[5005];
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                diff[Math.abs(arr[i]-arr[j])]++;
            }
        }
        double []suffix=new double[5001];
        suffix[5000]=diff[5000];
        for(int i=5000-1;i>=0;i--){
            suffix[i]=suffix[i+1]+diff[i];
        }
        double ans=0;
        //ways jerry wins
        for(int i=1;i<5000;i++){
            for(int j=1;j+i+1<5000;j++){
                ans+=diff[i]*diff[j]*suffix[j+i+1];
            }
        }
        double div=(n*(n-1))/2;
        ans/=div;
        ans/=div;
        ans/=div;
        System.out.print(ans);
        f.close();
        out.close();
    }
}
class pair implements Comparable <pair>{
    int num;
    int idx;

    public int compareTo(pair other){
        return num- other.num;
    }


    pair(int a, int b)
    {
        num=a;
        idx=b;
    }
}

