import java.io.*;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

	void solve() throws IOException {
        int t = 1;
        while (t-- > 0) {
            solveTest();
        }
	}

    void solveTest() throws IOException {
        int n = readInt();
        int[] a = readArr(n);
        Arrays.sort(a);
        long[] diff = new long[5001];
        long totalCount = n * (n-1) / 2;
        totalCount = totalCount * totalCount * totalCount;
        for(int i = 0; i < n; i++) {
            for(int j = i+1; j < n; j++) {
                int d = a[j] - a[i];
                diff[d]++;
            }
        }

        long[] x = new long[10001];
        for(int i = 1; i < 5001; i++) {
            for(int j = 1; j < 5001; j++) {
                x[i + j] += diff[i] * diff[j];
            }
        }

        long[] prX = new long[10001];
        for(int i = 1; i < 10001; i++) {
            prX[i] = x[i] + prX[i-1];
        }

        long truth = 0;
        for(int i = 0; i < n; i++) {
            for(int j = i+1; j < n; j++) {
                int d = a[j] - a[i];
                truth += prX[d-1];
            }
        }

        double res = BigDecimal.valueOf(truth).divide(BigDecimal.valueOf(totalCount), MathContext.DECIMAL128).doubleValue();
        out.println(res);

    }

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    int[] readArr(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readArrL(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = readLong();
        }
        return res;
    }

    public static void main(String[] args) {
        new D().run();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }
}