n=int(input())
b=sorted(list(map(int,input().split())))
diff=[0 for i in range(5001)]
for i in range(1,n):
    j=i-1
    while(j>=0):
        diff[b[i]-b[j]]+=1

        j+=-1

s=[0 for i in range(3*5*10**3)]
for i in range(5001):
    j=i
    while(j>=0):
        s[i+j]+=diff[i]*diff[j]
        j+=-1

ans=0
for i in range(1,5001):
    for j in range(1,i):
        ans+=diff[i]*s[j]


tot=(n*(n-1)/2)**3
print(ans/tot)
