# 8VC Venture Cup 2016 - Elimination Round D. Jerry’s Protest

#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <cmath>
#include <vector>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define L(i) i<<1
#define R(i) i<<1|1
#define INF  0x3f3f3f3f
#define pi acos(-1.0)
#define eps 1e-9
#define maxn 1000100
#define MOD 1000000007

int n,m;
int a[2020];
double p[5050],sum[5050];

int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
int t,C = 1;
//scanf("%d",&t);
while(scanf("%d",&n) != EOF)
{
for(int i = 0; i < n; i++)
scanf("%d",&a[i]);
sort(a,a+n);
memset(p,0,sizeof(p));
for(int i = 0; i < n; i++)
for(int j = i+1; j < n; j++)
p[a[j]-a[i]] += 2.0/n/(n-1);
sum[5010] = 0;
for(int i = 5009; i > 0; i--)
sum[i] = sum[i+1] + p[i];
double ans = 0;
for(int i = 1; i < 5050; i++)
for(int j = 1; j < 5050; j++)
{
if(i+j > 5010)
break;
ans += p[i] * p[j] * sum[i+j+1];
}
printf("%.15lf\n",ans);
}
return 0;
}


02-16 511

02-20 470

02-18 367

02-15 295

02-18 1237

02-14 562

01-19 258

01-16 137

01-19 121

01-21 163