#include <bits/stdc++.h>
using namespace std;
const long long N = 1e4 + 5;
long long p[N], z[N];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  memset(p, 0, sizeof(p));
  memset(z, 0, sizeof(z));
  for (long long i = 0; i < n - 1; i++)
    for (long long j = i + 1; j < n; j++) p[a[j] - a[i]]++;
  for (long long i = 1; i < N / 2; i++)
    for (long long j = 1; j < N / 2; j++) z[j + i] += (p[i] * p[j]);
  long long ans = 0;
  long long tillnow = 0;
  for (long long i = 1; i < N; i++) {
    ans += (tillnow * p[i]);
    tillnow += z[i];
  }
  ans = (long double)ans;
  long double total = (n * (n - 1) / 2.0);
  cout << fixed << setprecision(17) << ((ans / total) / total) / total;
}
