import java.io.*;
import static java.lang.Math.*;
import java.util.*;
import java.lang.*;

public class Main {
    final static boolean debug = false;
    final static String fileName = "";
    final static boolean useFiles = false;

    public static void main(String[] args) throws FileNotFoundException {
        PrintWriter writer = new PrintWriter(System.out);
        new Task(new InputReader(System.in), writer).solve();
        writer.close();
    }
}

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 double nextDouble() {
        return Double.parseDouble(next());
    }

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

    public long nextLong() {
        return Long.parseLong(next());
    }

    public byte nextByte() {
        return Byte.parseByte(next());
    }
}

class Task {
    public void solve() {
        final int MaxS = 10010;
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        Arrays.sort(a);
        long[] d = new long[MaxS];
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                d[a[j] - a[i]]++;
            }
        }
        long[] c = new long[MaxS];
        for (int i = 0; i <= a[n - 1] - a[0]; i++) {
            for (int j = 0; j <= a[n - 1] - a[0]; j++){
                c[i + j] += d[i] * d[j];
            }
        }

        long[] s = new long[MaxS];
        s[0] = c[0];
        for (int i = 1; i < MaxS; i++){
            s[i] = s[i - 1] + c[i];
        }

        long result = 0;
        for (int i = 1; i <= a[n - 1] - a[0]; i++){
            result += d[i] * s[i - 1];
        }
        double dn = n;
        out.println(result * 8.0 / (dn * dn * dn * (dn - 1) * (dn - 1) * (dn - 1)));
    }

    private InputReader in;
    private PrintWriter out;

    Task(InputReader in, PrintWriter out) {
        this.in = in;
        this.out = out;
    }
}
