import bisect
from decimal import *
n=int(raw_input())
balls=map(int, raw_input().split())

diff=[]
for x in range(0, n):
    for y in range(x+1, n):
        diff.append(balls[y]-balls[x])
diff=sorted(diff)
ldiff=len(diff)
a=0
for x in range(ldiff-1, 0, -1):
    t=(diff[x]+1)/2
    pos=bisect.bisect(diff, t)
    a+=pos

denom=(n*(n-1))/2
print str(Decimal(a)/Decimal(denom**3))
