//package kz.bsbnb.usci.cli.app;

import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * Created by Bauyrzhan.Makhambeto on 16/02/2016.
 */
public class Main {
    public void run(InputReader in, PrintWriter out){
        int n = in.nextInt();
        int a[] = new int[n];
        int d[] = new int[5005];
        int t[] = new int[5005];
        for(int i=0;i<n;i++)
            a[i] = in.nextInt();

        Arrays.sort(a,0,n);

        for(int i=0;i<n;i++)
            for(int j=i+1;j<n;j++)
                d[a[j] - a[i]]++;


        t[0] = d[0];
        for(int i=1;i<5005;i++)
            t[i] = d[i] + t[i-1];

        int total = 0;

        for(int d3 = 1;d3<=5000;d3++)
            for(int d2 = 1; d2<d3-1;d2++) {
                if(d[d3] > 0 && d[d2] > 0 && t[d3-d2-1] > 0)
                    total += d[d3] * d[d2] * t[d3-d2-1];
            }

        System.out.println(total / (double) (n * n * n));


    }
    public static void main(String [] args){
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Main solver = new Main();
        solver.run(in, out);
        out.close();

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}
