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

public class SNSTemplate implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void init() throws FileNotFoundException {
        try {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        } catch (Throwable e) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        }
    }

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

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

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

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

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

    public static void main(String[] args) {
        new Thread(null, new SNSTemplate(), "", 1l * 200 * 1024 * 1024).start();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    long memoryTotal, memoryFree;

    void memory() {
        memoryFree = Runtime.getRuntime().freeMemory();
        System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10)
                + " KB");
    }

    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            memoryTotal = Runtime.getRuntime().freeMemory();
            init();
            solve();
            out.close();
            if (System.getProperty("ONLINE_JUDGE") == null) {
                time();
                memory();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    void solve() throws IOException {
        int n = readInt();
        int[] a = readIntArray(n);

        long[] ways = new long[10_000 + 10];
        ways[0] = 0;
        int max = 0;
        int all = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                if (i == j || a[i] <= a[j]) continue;
                int diff = a[i] - a[j];
                ways[diff]++;
                max = Math.max(diff, max);
                all++;
            }
        }

        long[] waysResult = new long[ways.length];
        for (int i = max; i >= 0; i--) {
            if (ways[i] == 0) continue;
            for (int j = max; j >= 0; j--) {
                waysResult[j + i] += ways[j] * ways[i];
            }
        }

        long[] wayspref = new long[ways.length];
        for (int i = wayspref.length - 2; i >=0; i--) {
            wayspref[i] = wayspref[i + 1] + ways[i];
        }

        long good = 0;

        for (int i = ways.length - 2; i >= 0; i--) {
            good += waysResult[i] * wayspref[i + 1];
        }

        long all3 = all * all * all;

        out.println(1d * good / all3);
    }

}