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

a.sort()

diff = [0 for i in range(0, 5001)]
dsm = [0 for i in range(0, 10001)]

for i in range(0, n):
    for j in range(0, i):
        diff[a[i] - a[j]] += 1

for i in range(1, 5001):
    for j in range(1, 5001):
        dsm[i + j] += diff[i]*diff[j]
        
for i in range(1, 10001):
    dsm[i] += dsm[i - 1]

dp = [0 for i in range(0, n)]

ans = 0
for i in range(2, n):
    for j in range(0, i):
        dp[i] += dsm[a[i] - a[j] - 1]
    ans += dp[i]
        
ans = 8*ans/(n*n*n*(n - 1)*(n - 1)*(n - 1))
print(ans)

