#include <bits/stdc++.h>
using namespace std;
void Weapons19() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  Weapons19();
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  vector<long long int> d(5005);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      d[abs(v[i] - v[j])]++;
    }
  }
  vector<long long int> p(5005);
  for (long long int i = 2; i < 5005; i++) {
    long long int t = 0;
    for (long long int j = 1; j + j <= i; j++) {
      if (j == i - j)
        t += d[j] * d[j];
      else
        t += 2 * d[i - j] * d[j];
    }
    p[i] = t;
  }
  long long int s = 0;
  for (long long int i = 1; i < 5005; i++) p[i] += p[i - 1];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i + 1; j < n; j++) {
      long long int k = abs(v[j] - v[i]);
      s += p[k - 1];
    }
  }
  double ans = s;
  ans *= 1.0;
  long long int k = n * (n - 1);
  k /= 2;
  ans /= k;
  ans /= k;
  ans /= k;
  cout << setprecision(14) << ans;
}
