
    import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
    import java.math.BigDecimal;
    import java.math.BigInteger;
    import java.math.MathContext;
    import java.util.Arrays;
    import java.util.StringTokenizer;

/**
 * Created by Kamil Khadiev on 11.08.2015.
 */
public class khadiev_8V_d {
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        init(in);
        in.close();
        solve();
        PrintWriter out = new PrintWriter(System.out);
        print(out);
        out.close();

    }
    public static int n,m;
    public static int[] a,b, c, d,e;
    public static BigDecimal ans;
    public static int INF = Integer.MAX_VALUE/2;
static String s;
    private static void init(BufferedReader in) throws IOException {

        n = Integer.parseInt(in.readLine().trim());
        StringTokenizer st = new StringTokenizer(in.readLine().trim());
        a = new int[n];
        for (int i = 0; i < n; i++)
        a[i] = Integer.parseInt(st.nextToken());


    }

    private static void solve() {

        m = n*(n-1)/2;
        b = new int [m];
        Arrays.sort(a);
        int m = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < i; j++) {
                b[m] = a[i] - a[j];
                m++;
            }
        }
        Arrays.sort(b);
        c = new int[5010];
        d = new int[5010];
        int x = -1;
        int j = -1;

        for (int i = 0; i < m; i++){
            if (b[i]!=x){
                x = b[i];
                j++;
                d[j] = 1;
                c[j] = b[i];
            }
            else{
                d[j]++;
            }
        }
        m = j+1;
        e = new int[m];
        e[0] = d[0];
        BigInteger ans1 = new BigInteger("0");
        for (int i = 1; i < m; i++)
            e[i] = e[i-1] + d[i];
        long all = 0;
        for  (int i = 1; i<m; i++){
            for (j = i-1; j >=0; j--){

                int z = c[i]-c[j]-1;
                z = Math.min(z,c[j]);
                int k = Arrays.binarySearch(c,0,j,z);
                if (k<m-1 && c[k+1]==z) k++;
                if (k>-1)
                ans1 = ans1.add(new BigInteger(String.valueOf((long)e[k]*d[j]*d[i])));

            }

        }
        all = (long)e[m-1]*e[m-1]*e[m-1];
        ans = new BigDecimal(ans1.toString());
        ans = ans.multiply(new BigDecimal("100000000"));
        ans = ans.divide(new BigDecimal(String.valueOf(all)), BigDecimal.ROUND_UP);

        ans = ans.round(new MathContext(0));

    }

    private static void print(PrintWriter out) throws IOException {
        out.print("0." +ans.toPlainString());
    }
}
