#!/usr/bin/python3
dd = dict()

def cnt(num, diff):
    if num <= diff[0]:
        return 0
    elif num > diff[-1]:
        return len(diff)
    else:
        left = 0
        right = len(diff)-1
        while right - left > 1:
            mid = (left+right)//2
            if diff[mid] < num:
                left = mid
            else:
                right = mid
        #print((num, diff, left))
        return left+1

def calc(num, diff):
    ans = 0
    for i in diff:
        t = 0
        if i in dd:
            t = dd[i]
        else:
            t = cnt(num-i, diff)
            dd[i] = t
        if t > 0:
            ans += t
        else:
            break
        #print(str(ans))
    return ans

n = int(input())
a = tuple(map(int, input().split()))

diff = []
a = sorted(a)
for i in range(n-1):
    for j in range(i+1, n):
        diff.append(a[j]-a[i])
diff = sorted(diff)
d = dict()
ans = 0
for i in range(len(diff)-1, 0, -1):
    t = 0
    if diff[i] in d:
        t = d[diff[i]]
    else:
        t = calc(diff[i], diff)
        d[diff[i]] = t
    if t > 0:
        ans += t
    else:
        break

total = (n*(n-1)//2)**3
#print((ans, total))
print(str(ans/total))
