# You lost the game.
n = int(input())
L = list(map(int, input().split()))

T = []
for i in range(1,n):
    for j in range(i):
        T += [abs(L[i]-L[j])]
T.sort()

m = len(T)
total = m**3

possible = 0
nouveau = 0
#M = [0 for _ in range(m)]

for k in range(1,m):
    i = 0
    while T[i] < T[k]//2:
        i += 1
    possible += i**2
    j = i
    while T[i] < T[k]:
        while j >= 0 and T[i]+T[j] >= T[k]:
            j -= 1
        possible += (j+1)
        i += 1
print(possible/total)


        
    

        
