from collections import Counter

n = int(raw_input())
nums = map(int, raw_input().split())
cc = Counter((abs(nums[i] - nums[j]) for i in range(len(nums)) for j in range(i)))
qq = cc.items()
qq.sort(key=lambda x: x[0])
ssum = sum(map(lambda x: x[1], qq))
sssum = ssum
count = 0
while len(qq) >= 2:
    mx = qq.pop()
    ssum -= mx[1]
    partsum = ssum
    l = 0
    r = len(qq)-1
    while l <= r:
        ppartsum = partsum
        while qq[l][0] + qq[r][0] >= mx[0] and l <= r:
            ppartsum -= qq[r][1]
            r -= 1
        if l <= r:
            count += ppartsum * ppartsum * mx[1]
        partsum -= qq[l][1]
        l += 1
        r = len(qq)-1
print 1.0 * count / sssum**3