#include <bits/stdc++.h>
using namespace std;
const int N = 2000 + 9;
int n, a[N];
map<int, int> dp[2002][6];
int solve(int turn, int diff, int ind) {
  if (turn == 6) {
    return diff < 0;
  }
  if (dp[ind][turn].count(diff)) return dp[ind][turn][diff];
  int &ret = dp[ind][turn][diff];
  ret = 0;
  if (turn & 1) {
    if (turn < 5) {
      for (int i = 0; i < ind; i++) {
        ret += solve(turn + 1, diff - a[i], i);
      }
    } else {
      for (int i = ind + 1; i < n; i++) {
        ret += solve(turn + 1, diff - a[i], i);
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      ret += solve(turn + 1, diff + a[i], i);
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int sw[6009] = {}, c[6009] = {}, p[6009] = {};
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < i; j++) {
      c[a[i] - a[j]]++;
    }
  }
  for (int i = 1; i < 6000; i++) {
    p[i] = p[i - 1] + c[i];
  }
  for (int i = 0; i < 6000; i++) {
    for (int j = 0; j < i; j++) {
      sw[i] += c[j] * c[i - j];
    }
  }
  long long tw = 0;
  for (int i = 0; i < 6000; i++) {
    tw += sw[i] * (p[5999] - p[i]);
  }
  int t = n * (n - 1) / 2;
  cout << fixed << setprecision(12) << (long double)tw / t / t / t << '\n';
  return 0;
}
