from __future__ import division
from itertools import combinations, combinations_with_replacement

n = int(raw_input())
arr = map(int, raw_input().split())

l = [abs(i - j) for i, j in combinations(arr, 2)]

d = [0]*5007
for i in l:
	d[i] += 1
total = sum(d)

dp = []
p = 0
for i in d:
	p += i
	dp.append(p)

l = set(l)
out = 0
for a, b in combinations_with_replacement(l, 2):
	out += d[a]*d[b]*(total - dp[a + b])

print out/(n*(n - 1)/2)**3
