from sys import *

n = int(input())
m = int(5000)

vls = list({int(t) for t in stdin.readline().split()})
r1 = [0 for t in range(m)]
for i in range(n-1):
    for k in range(i+1, n):
        r1[vls[k] - vls[i]] += 1

r2 = [0 for t in range(m)]
for i in range(m):
    for k in range(m-i):
        r2[i+k] += r1[i]*r1[k]

ans = int(0)
for t1 in range(m-1, 0, -1):
    for t2 in range(t1-1, -1, -1):
        ans += r1[t1]*r2[t2]

d = (n-1)*n/2
print("{0:06f}".format(float(ans)/(d**3)))
