import decimal
n = input()
opr=(n*(n-1))/2.0
to=decimal.Decimal(opr**3)
a = sorted([int(i) for i in raw_input().split(' ')])
difft=[0]*(max(a)-min(a)+1)*2
diffs=set()

for i in range(n):
        for j in range(i+1,n):
                difft[a[j]-a[i]]+=1
                diffs.add(a[j]-a[i])
r2=[0]*(max(a)-min(a)+1)*2
for d1 in diffs:
        r2[d1+d1]+=difft[d1]**2
        for d2 in diffs:
                if d1>=d2:
                        continue
                r2[d1+d2]+=difft[d1]*difft[d2]

wins=0
r2seen=0
for i in range(len(difft)):
        wins+=difft[i]*r2seen
        r2seen+=r2[i]

print decimal.Decimal(wins)/decimal.Decimal(to)

