import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.StreamTokenizer;
import java.io.IOException;

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

    static class TaskD {
        public StreamTokenizer st;

        public void solve(int testNumber, StreamTokenizer st, PrintWriter out) {
            this.st = st;
            int n = nextInt();
            int arr[] = new int[n];
            long N = n * (n - 1) / 2;
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
//            N+=i*(i+1);
            }
            Arrays.sort(arr);
            double rez = 0;
            for (int i = n - 1; i >= 2; i--) {
                int x = arr[i];
                long numb = 0;
                for (int j = i - 1; j >= 0; j--) {
                    int y = arr[j];
                    int s = x - y - 1;
                    if (s == 0) continue;
                    int pos = Arrays.binarySearch(arr, 0, i - 1, s);
                    if (pos < 0) {
                        pos = -pos - 1;
                    }
                    for (int q = pos; q > 0; q--) {
                        int tmp = s - arr[q];
                        int p = Arrays.binarySearch(arr, 0, q, tmp);
                        if (p >= 0) {
                            numb += (p + 1);
                        } else {
                            numb += (-p - 1);
                        }
                    }

                }
                double v = (double) numb / N;
                v /= N;
                v /= N;
                rez += v;
            }
            out.println(rez);
        }

        int nextInt() {
            try {
                st.nextToken();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (int) st.nval;
        }

    }
}

