from sys import stdin
n = int(stdin.readline())
a = map(int,stdin.readline().strip().split())

b=[]
a.sort()
den = (n*(n-1))/2
den = den**3
num = 0
ma = a[-1] - a[0]
p = []
for i in xrange(2*ma + 5):
 p.append(0)
#print p
for i in xrange(2*ma+5):
 b.append(0)
#print b
for i in xrange(n):
 for j in xrange(i+1,n):
  b[a[j]-a[i]]+=1

i = ma
 
while i>=0:
 p[i] = p[i+1]+b[i]
 i-=1
#print p
for i in xrange(ma):
 for j in xrange(i,ma):
  #print "for",i,j,b[i],b[j],p[i+j+1]
  num+= b[i]*b[j]*p[i+j+1]
print (num*1.0)/den 