#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_map>
#include <iomanip>
using namespace std;
int main() {
// your code goes here
ios::sync_with_stdio(false);
int n;
cin>>n;
vector<int> v;
for(int i = 0 ; i< n ; i++){
int temp;
cin>>temp;
v.push_back(temp);
}
int diff[5001]={0};
sort(v.begin(),v.end());
reverse(v.begin(),v.end());
for(int i = 0 ; i < n-1 ; i++)
for(int j = i+1; j<n ; j++)
diff[v[i]-v[j]]++;
long long def[5001]={0};
for(int i = 1; i< 5001; i++)
for(int j = 1; j<5001; j++)
if(diff[i]&&diff[j]&&i+j<5001)
def[i+j]+=(diff[i]*diff[j]);
double ways = 0;
for(int i = 1; i<5001; i++)
if(diff[i])
for(int j = i-1; j>0; j--)
ways+=diff[i]*def[j];
double tt = ((n*(n-1))/2);
double d = tt*tt*tt;
cout.precision(10);
cout<<setprecision(6)<<fixed<<ways/d;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8c2V0PgojaW5jbHVkZSA8dW5vcmRlcmVkX21hcD4KI2luY2x1ZGUgPGlvbWFuaXA+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCS8vIHlvdXIgY29kZSBnb2VzIGhlcmUKCWlvczo6c3luY193aXRoX3N0ZGlvKGZhbHNlKTsKCWludCBuOwoJY2luPj5uOwoJdmVjdG9yPGludD4gdjsKCWZvcihpbnQgaSA9IDAgOyBpPCBuIDsgaSsrKXsKCQlpbnQgdGVtcDsKCQljaW4+PnRlbXA7CgkJdi5wdXNoX2JhY2sodGVtcCk7Cgl9CglpbnQgZGlmZls1MDAxXT17MH07Cglzb3J0KHYuYmVnaW4oKSx2LmVuZCgpKTsKCXJldmVyc2Uodi5iZWdpbigpLHYuZW5kKCkpOwoJZm9yKGludCBpID0gMCA7IGkgPCBuLTEgOyBpKyspCgkJZm9yKGludCBq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