num = int(input())
l = list(map(int,input().split(' ')))
l.sort()
dif = []
for i in range(num):
    for j in range(i+1,num):
        dif.append(l[j]-l[i])
dif.sort()

s = 0
tot = len(dif)**3
for i in range(len(dif)):
    for j in range(len(dif)):
        left = min(i,j)-1
        right = len(dif)
        curr = dif[i]+dif[j]
        while right-left != 1:
            guess = int((left+right)/2)
            if curr < dif[guess]:
                right = guess
            else:
                left = guess
        print(i,j,right)
        s += len(dif)-right
print(s/tot)
