from itertools import accumulate

n = int(input())
A = [int(x) for x in input().split()]
m = max(A)
difference = [0 for i in range(m)]
for i in range(n):
    for j in range(i+1, n):
        difference[abs(A[i]-A[j])] += 1
diffsum = [0 for i in range(2*m)]
for i in range(m):
    for j in range(m):
        diffsum[i+j] += difference[i]*difference[j]
D = list(accumulate(diffsum))
ans = sum(difference[k] * D[k-1] for k in range(m))
print(8*ans/((n*(n-1)) ** 3))
