//package CodeForces.VentureCup2016ELR;

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

/**
 * Created by ilya on 13.02.16.
 */

public class D626 {
    static int max = 5001;

    public static void main(String[] args) {
        sc sc = new sc();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = sc.nextInt();
        int [] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        int[] count = new int[max];
        for(int i = 0; i < n; i++) {
            for(int j = 0; j < n; j++) {
                if(a[i] - a[j] > 0) count[a[i] - a[j]]++;
            }
        }
        int[] ar = new int[max + 1];
        for(int i = max - 1; i >= 0; i--) ar[i] = ar[i + 1] + count[i];
        long totalcount = 0, wincount = 0;
        for(int first = 1; first < max; first++) {
            for(int second = 1; second < max; second++) {
                long occurs = (long) count[first] * count[second];
                totalcount += (long) n * (n - 1) * occurs / 2;
                if(first + second + 1 < ar.length) wincount += (long) ar[first + second + 1] * occurs;
            }
        }
        out.println((double) wincount / totalcount);
        out.close();
    }

    public static class sc {
        BufferedReader br;
        StringTokenizer st;

        public sc() {
            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();
        }

        Integer 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;
        }
    }

}

