import java.util.Arrays;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.Locale;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author Tifuera
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        Arrays.sort(a);

        int[] differences = new int[5000];
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                differences[a[j] - a[i]]++;
            }
        }

        int[] suffixSum = new int[differences.length + 1];
        for (int i = differences.length - 1; i >= 0; i--) {
            suffixSum[i] = suffixSum[i + 1] + differences[i];
        }

        int lower = (n * (n - 1)) / 2;

        double p = 0D;
        for (int i = 1; i < n; i++) {
            if (differences[i] > 0) {
                for (int j = i; j < n; j++) {
                    int curSum = i + j;
                    int numPossible = 0;
                    if (curSum + 1 < differences.length) {
                        numPossible = suffixSum[curSum + 1];
                    }

                    double probLoose = (differences[i] * differences[j] * 1D) / (lower * lower);
                    double probWin = numPossible * 1D / lower;
                    p += probLoose * probWin;
                }
            }

        }

        out.println(String.format(Locale.US, "%.10f", p));
    }

}

class InputReader {
    private BufferedReader reader;
    private String[] currentArray;
    private int curPointer;

    public InputReader(InputStream inputStream) {
        reader = new BufferedReader(new InputStreamReader(inputStream));
    }


    public int nextInt() {
        if ((currentArray == null) || (curPointer >= currentArray.length)) {
            try {
                currentArray = reader.readLine().split(" ");
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            curPointer = 0;
        }
        return Integer.parseInt(currentArray[curPointer++]);
    }

}

