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

public class Main {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = sc.nextInt();
        double samplespace = cube(nP2(n));
        Integer[] a = sc.nextIntegerArray(n);
        Arrays.sort(a);
        int max = a[n - 1];
        int[] cnt = new int[max];
        for (int i = 0; i < n; i++)
            for (int j = i + 1; j < n; j++)
                cnt[a[j] - a[i]]++;
        long poss = 0;
        for (int i = 1; i < cnt.length; i++)
            cnt[i] += cnt[i - 1];
        for (int one = 1; one < max; one++) {
            for (int two = 1; two < max; two++) {
                int need = one + two;
                if (need >= max) continue;
                int bigger = cnt[max - 1] - cnt[need];
                poss += 1l * (cnt[one] - cnt[one - 1]) * (cnt[two] - cnt[two - 1]) * bigger;

            }
        }
        out.println(poss / samplespace);
        out.flush();
        out.close();
    }

    static long cube(long x) {
        return x * x * x;
    }

    static long nP2(int n) {
        return n * (n - 1) / 2;
    }

    static class Scanner {

        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream system) {
            br = new BufferedReader(new InputStreamReader(system));
        }


        public String next() throws IOException {
            while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public String nextLine() throws IOException {
            return br.readLine();
        }

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

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public char nextChar() throws IOException {
            return next().charAt(0);
        }

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

        public boolean ready() throws IOException {
            return br.ready();
        }


        public int[] nextIntArray(int n) throws IOException {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) throws IOException {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }


        public Integer[] nextIntegerArray(int n) throws IOException {
            Integer[] a = new Integer[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public double[] nextDoubleArray(int n) throws IOException {
            double[] ans = new double[n];
            for (int i = 0; i < n; i++)
                ans[i] = nextDouble();
            return ans;
        }

        public short nextShort() throws IOException {
            return Short.parseShort(next());
        }

    }
}