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

public class Main {
	public static void main(String args[]) {
		InputStream intputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(intputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(in, out);
		out.close();
	}

	static class TaskD {
		public void solve(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[] sc = new int[5000];
			for (int i = 0; i < n; ++i)
				for (int j = i + 1; j < n; ++j) {
					++sc[a[j] - a[i]];
				}
			for (int i = 1; i < 5000; ++i) {
				sc[i] += sc[i - 1];
			}
			int num = sc[4999];
			double ans = 0.0;
			for (int i = 4999; i >= 1; --i) {
				int k = 1;
				for (int j = i - 2; j >= 1; --j) {
					if (k > j) k = j;
					while (k < j && i > j + k + 1) {
						++k;
					}
					if (j == k) {
						ans += (double)(sc[i] - sc[i - 1]) / num * (sc[j] - sc[j - 1]) / num * (sc[k] - sc[k - 1]) / num;
						ans += (double)(sc[i] - sc[i - 1]) / num * (sc[j] - sc[j - 1]) / num * sc[k - 1] / num * 2.0;
					} else {
						ans += (double)(sc[i] - sc[i - 1]) / num * (sc[j] - sc[j - 1]) / num * sc[k] / num * 2.0;
					}
				}
			}
			out.println(ans);
		}
	}
	
	static 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 int nextInt() {
            return Integer.parseInt(next());
        }
    }
}