n , m = input() , map(int,raw_input().split())
a = {}
for i in xrange(n-1):
	for j in xrange(i+1,n):
		x = abs(m[i]-m[j])
		if x in a:
			a[x]+=1
		else:
			a[x]=1

d = [i for i in a]
b = [0]*10005
for i in xrange(len(d)):
	for j in xrange(i,len(d)):
		if d[i]==d[j]:
			b[d[i]+d[j]] += a[d[i]]*a[d[j]]
 		else:
			b[d[i]+d[j]] += a[d[i]]*a[d[j]]*2

for i in xrange(1,len(b)): b[i]=b[i]+b[i-1]
ans=0
for i in xrange(n-1):
	for j in xrange(i+1,n):
		ans+=b[abs(m[i]-m[j])-1]

den = (n*(n-1)/2)**3
print ans/float(den)