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

public class Main {

        static int n, m, p, q, k, a, b, c, d, cnt = 0, ans = 0;
        static int[] ar, diff, sum;

        public static void main(String[] args) {

                MyScanner sc = new MyScanner();
                out = new PrintWriter(new BufferedOutputStream(System.out));

                n = sc.nextInt();
                ar = new int[n + 1];
                sum = new int[5000 + 2];
                diff = new int[5000 + 1];
                for(int i = 0; i < n; ++i)
                        ar[i] = sc.nextInt();
                for(int i = 1; i < n; ++i)
                        for(int j = 0; j < i; ++j)
                                diff[Math.abs(ar[i] - ar[j])]++;
                for(int i = 5000; i >= 0; --i)
                        sum[i] = sum[i + 1] + diff[i];
                double ans = 0.0;
                for(int i = 0; i <= 5000; ++i)
                        for(int j = 0; j <= 5000; ++j)
                                if(i + j <= 5000)
                                        ans += diff[i] * diff[j] * sum[i + j + 1];
                double den = (double)(n * (n - 1)) / 2.0;
                den = den * den * den;
                out.print(String.format( "%.9f", ans / den));

                out.close();
        }

        public static PrintWriter out;

        public static class MyScanner {
                BufferedReader br;
                StringTokenizer st;

                public MyScanner() {
                        br = new BufferedReader(new InputStreamReader(System.in));
                }

                String next() {
                        while (st == null || !st.hasMoreElements()) {
                                try {
                                        st = new StringTokenizer(br.readLine());
                                } catch (IOException e) {
                                        e.printStackTrace();
                                }
                        }
                        return st.nextToken();
                }

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

                long nextLong() {
                        return Long.parseLong(next());
                }

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

                String nextLine(){
                        String str = "";
                        try {
                                str = br.readLine();
                        } catch (IOException e) {
                                e.printStackTrace();
                        }
                        return str;
                }

        }
}
