n = int(input())
t = list(map(int, input().split()))
m = 5000
d = [0, 0] * m
for a in t:
    for b in t: d[b - a] += 1
for i in range(m, 2 * m): d[i] = d[i - 1] + d[i]
s = 0
for i in range(1, m):
    for j in range(i, m - i):
        s += d[i] * d[j] * d[m + i + j - 1]
print(4 * s / (n * n - n) ** 3)