

"""
[int(i) for i in raw_input().split(" ")]
raw_input()
raw_input().split(" ")


"""

from collections import *

def main():
	n = int(raw_input())
	a = [int(i) for i in raw_input().split(" ")]
	a.sort()
	
	H = defaultdict(int)
	T = defaultdict(int)
	for i in range(len(a)):
		for j in range(i+1,len(a)):
			H[a[j]-a[i]] += 1
			T[a[j]-a[i]] += 1
	
	print H
	
	for turn in range(2):
		H_new = defaultdict(int)
		for i in H:
			for j in T:
				H_new[i-j] += H[i]*T[j]
		H = H_new
	
	total = 0
	valid = 0
	for i in H:
		total += H[i]
		if i > 0:
			valid += H[i]
	
	print float(valid)/float(total)
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
main()
