#include <bits/stdc++.h>
#define MOD 1000000007
#define pb push_back
#define F first
#define S second

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

/*
#define ordered_set tree<pair<ll,ll>, null_type,less<pair<ll,ll>>,
    rb_tree_tag,tree_order_statistics_node_update>
*/

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef pair<ll, ll> pll;
const double pi = acos(-1.0);
const double eps = 1e-9;

const int MX = 2e3 + 9;
const int MaxValue = 70;
const ll inf = LLONG_MAX;

int A[MX];
vector <int> NegativeGames;
map <int, int> Po;

int Ways (int x) {
    int l = 0, r = NegativeGames.size() - 1;
    while (r - l > 1) {
        int mid = l + (r - l) / 2;
        if (NegativeGames[mid] < x)
            l = mid;
        else r = mid - 1;
    }
    if (NegativeGames[r] < x)
        return r + 1;
    if (NegativeGames[l] < x)
        return l + 1;
    return 0;
}

void test_case () {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> A[i];
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            if (i == j) continue;
            if (A[i] - A[j] > 0)
                Po[A[i] - A[j]]++;
            else NegativeGames.push_back (A[i] - A[j]);
        }
    }
    sort (NegativeGames.begin(), NegativeGames.end());
    ll A = 0;
    for (auto u: Po)
        for (auto v: Po)
            A += (u.S * v.S) * Ways (-1 * (u.F + v.F));
    ll CntGames = n * (n - 1) / 2;
    long double All = CntGames * CntGames * CntGames;
    cout << fixed << setprecision (10);
    cout << A / All << "\n";
    return ;
}

int main () {
    //freopen("hawawshi.in","r",stdin);
    int T = 1;
    //scanf("%d", &T);
    while (T--)
        test_case();
    return 0;
}
