#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
ll mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr.begin(), arr.end());
  vector<int> diff(5000, 0);
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      diff[arr[j] - arr[i]]++;
    }
  }
  vector<int> suff(5000, 0);
  for (int i = 5000 - 1; i >= 0; i--) {
    suff[i] = (i != 5000 - 1 ? suff[i + 1] : 0) + diff[i];
  }
  ll ans = 0;
  for (int i = 1; i < 5000; i++) {
    for (int j = 1; j < 5000; j++) {
      if (i + j < 5000 - 1) ans += (diff[i] * 1LL * diff[j] * suff[i + j + 1]);
    }
  }
  ld p = (ans * 2.0 * 2.0 * 2.0 * 1.0) /
         (1.0 * n * n * n * (n - 1) * (n - 1) * (n - 1));
  cout << p;
}
