#include <bits/stdc++.h>
using namespace std;
long long a[10010];
long long b[10010];
long long c[10010];
signed main() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  long long cnt = 0;
  for (long long i = 1; i <= n; i++)
    for (long long j = i - 1; j >= 1; j--) {
      b[a[i] - a[j]]++;
      cnt++;
    }
  double ans = 0;
  for (long long i = 1; i <= 5000; i++)
    for (long long j = 1; j <= 5000; j++) c[i + j] += b[i] * b[j];
  for (long long i = 1; i <= 5000; i++)
    for (long long j = i - 1; j >= 1; j--)
      ans += 1.0 * b[i] * c[j] / cnt / cnt / cnt;
  printf("%.15lf", ans);
}
