'''
D. Jerry's Protest
time limit per test: 2 seconds
memory limit per test: 256 megabytes

Andrew and Jerry are playing a game with Harry as the scorekeeper. 
The game consists of three rounds. In each round, Andrew and Jerry 
draw randomly without replacement from a jar containing n balls, each 
labeled with a distinct positive integer. Without looking, they hand 
their balls to Harry, who awards the point to the player with the 
larger number and returns the balls to the jar. The winner of the
 game is the one who wins at least two of the three rounds.

Andrew wins rounds 1 and 2 while Jerry wins round 3, so Andrew wins 
the game. However, Jerry is unhappy with this system, claiming that 
he will often lose the match despite having the higher overall total. 
What is the probability that the sum of the three balls Jerry drew is 
strictly higher than the sum of the three balls Andrew drew?
Input

The first line of input contains a single integer n (2 ≤ n ≤ 2000) — 
the number of balls in the jar.

The second line contains n integers ai (1 ≤ ai ≤ 5000) — the number 
written on the ith ball. It is guaranteed that no two balls have 
the same number.
Output

Print a single real value — the probability that Jerry has a higher 
total, given that Andrew wins the first two rounds and Jerry wins 
the third. Your answer will be considered correct if its absolute 
or relative error does not exceed 10**(-6).

Namely: let's assume that your answer is a, and the answer of the 
jury is b. The checker program will consider your answer correct, if 
|a-b|/max(1,b)<=10**(-6)

'''

import io
import sys
import time
import random
import bisect
start = time.clock()
#~ test = '''3
#~ 1 2 10'''

#~ sys.stdin = io.StringIO(test)

n = int(input())
balls = sorted(map(int, input().split()))

def find_ge(a, val):
   '''
   a is a sorted, non-empty array
   finds first index i such that a[i]>=val
   if no such index exists (max(a)<val) return len(a)
   '''
   return bisect.bisect_left(a,val)

#~ print(find_ge([1,2,10],3))
#~ exit()

def jerrywinsbytotal(diff):
   '''Returns the number of times when Jerry wins because J>A+diff,
   J,A take possible values in sorted array balls'''
      
   if diff==0:
      return n*(n-1)//2
   if diff<0:
      return n*(n-1)//2-jerrywinsbytotal(-diff)
   # diff>0
   # find first index i such that balls[i]>balls[j]+diff
   c = 0 # count
   for j in range(n):
      #~ print("searching for", balls[j]+diff, "with j=",j)
      i = find_ge(balls, balls[j]+diff)
      #~ print("idx",i)
      if i==n: return c
      c += n-i 
   return c
   
cache = dict()

count = 0
for a1 in range(n):
   for j1 in range(a1):
      diff = balls[a1]-balls[j1]
      if balls[-1]<=balls[0]+diff: # Jerry cannot win
         continue
      for a2 in range(n):
         for j2 in range(a2):
            diff += balls[a2]-balls[j2] # advantage of Andrew
            if balls[-1]<=balls[0]+diff: # Jerry cannot win
               continue
            if diff not in cache:
               cache[diff] = jerrywinsbytotal(diff)
            #~ print(a1,j1,a2,j2,diff,cache[diff])
            count += cache[diff]

s = n*(n-1)//2
print(count/(s**3))            
#~ print(0,jerrywinsbytotal(0))
#~ print(1,jerrywinsbytotal(1))
#~ print(2,jerrywinsbytotal(2))
#~ print(10,jerrywinsbytotal(10))


#~ dur = time.clock()-start
#~ print("Time:",dur)
