def main():
    n = int(input())
    a = list(map(int, input().split()))
    max_element = max(a) + 1
    diff_freq = [0 for i in range(max_element)]
    a.sort()
    for i in range(n):
        for j in range(i):
            diff_freq[a[i] - a[j]] += 1
    largest = [0 for i in range(max_element)]
    for i in range(max_element):
        for j in range(i + 1, max_element):
            largest[i] += diff_freq[j]
    good_ones = 0
#    print('diff_freq', diff_freq)
#    print('largest', largest)

    for i in range(max_element):
        for j in range(i + 1):
            if i + j < max_element:
                good_ones += diff_freq[i] * diff_freq[j] * largest[i + j]
#    print(good_ones)
    ans = good_ones / ((n*(n - 1) / 2) ** 3)
    print(ans)
main()