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

public class D implements Runnable {

    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

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

    private void init() throws FileNotFoundException {
        Locale.setDefault(Locale.US);
        String fileName = "";
        if (ONLINE_JUDGE && fileName.isEmpty()) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }
        }
    }

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

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

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

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

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

    public static void main(String[] args) {
        //new Thread(null, new _Solution(), "", 128 * (1L << 20)).start();
        new D().run();
    }

    long timeBegin, timeEnd;

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

    @Override
    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            init();
            solve();
            out.close();
            time();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    int MAX_ARRAY_VALUE = 5010;

    private void solve() {
        int n = readInt();
        int[] a = readIntArray(n);
        Arrays.sort(a);

        int[] difFirst = new int[MAX_ARRAY_VALUE];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < i; j++) {
                difFirst[a[i] - a[j]]++;
            }
        }

        List<Integer> dif2 = new ArrayList<>();
        for (int i = 0; i < MAX_ARRAY_VALUE; i++) {
            for (int j = 0; j < difFirst[i]; j++) {
                dif2.add(i);
            }
        }

        long answer = 0;
        for (int i = 0; i < MAX_ARRAY_VALUE; i++) {
            for (int j = 0; j < MAX_ARRAY_VALUE; j++) {
                if (difFirst[i] > 0 && difFirst[j] > 0) {
                    int firstDif = i + j;
                    int index = -1;
                    int left = 0, right = dif2.size() - 1;
                    while (left <= right) {
                        int mid = (left + right) >> 1;
                        if (dif2.get(mid) > firstDif) {
                            index = mid;
                            right = mid - 1;
                        } else {
                            left = mid + 1;
                        }
                    }
                    if (index > -1) {
                        answer += (long) (n - index) * difFirst[i] * difFirst[j];
                    }
                }
            }
        }

        double zn = 1.0 * dif2.size() * dif2.size() * dif2.size();

        out.printf(Locale.US, "%.7f", 1.0 * answer / zn);
    }
}
