//  package mainpackage;

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

public class Main {
	public static void main(String... args) throws Exception {
		
		out = new PrintWriter(System.out);
		new Main().solve();
		out.close();
	}

	private static PrintWriter out;
	
	private BufferedReader reader;
	private StringTokenizer st;
	private int n;
	private int[] freq, data, suffixSum;
	
	private void solve() throws Exception {
		
		reader = new BufferedReader(new InputStreamReader(System.in));
		
		n = Integer.parseInt(reader.readLine());
		st = new StringTokenizer(reader.readLine());
		
		data = new int[n];
		freq = new int[5000];
		suffixSum = new int[5000];
		
		for (int i = 0; i < n; ++i) {
		    data[i] = Integer.parseInt(st.nextToken());
		}
		
		reader.close();	
		
		for (int i = 0; i < n; ++i) {
		    for (int j = i + 1; j < n; ++j) {
		        
		        int v = Math.abs(data[i] - data[j]);
		        
		        freq[v] += 2;
		    }
		}
		
		for (int i = 4999; i >= 0; --i) {
		    
		    suffixSum[i] = freq[i];
		    if (i < 4999) {
		        suffixSum[i] += suffixSum[i + 1];
		    }
		}
		
		
		double ans = 0.0;
		
		for (int i = 1; i < 5000; ++i) {
		    if (freq[i] == 0) {
		        continue;
		    }
		    
		    for (int j = i; j + i + 1 < 5000; ++j) {
		        if (freq[j] == 0) {
		            continue;
		        }
		        
		        double p = (i == j) ? 1.0 : 2.0;
		        p *= ((double)freq[i]) / (n * (n - 1));
		        p *= ((double)freq[j]) / (n * (n - 1));
		        p *= ((double)suffixSum[i + j + 1]) / (n * (n - 1));
		        
//		        out.printf("Here: i=%d, j=%d, freq[i]=%d, freq[j]=%d, suffixSum[%d]=%d, p=%.10f%n", i, j, freq[i], freq[j], i + j + 1, suffixSum[i + j + 1], p);
		        
		        ans += p;
		    }
		}
		
		out.printf("%.10f%n", ans);
	}
}
