n , m = input() , map(int,raw_input().split())
a = [0]*5010
for i in xrange(n-1):
	for j in xrange(i+1,n):
		a[abs(m[i]-m[j])]+=1
b = [0]*5010
for i in xrange(1,5001):
	j=i
	while j+i<=5000:
		b[i+j] = a[i]*a[j]
		j+=1
for i in range(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)