#include <bits/stdc++.h>
using namespace std;
ifstream in("jerrys_protest.in");
ofstream out("jerrys_protest.out");
const int Vmax = 5005;
int main() {
  int n;
  long long rez = 0;
  cin.sync_with_stdio(false);
  cin >> n;
  vector<int> v(n + 1);
  vector<int> nr(Vmax);
  vector<int> cnt(Vmax);
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j <= n; j++) nr[abs(v[i] - v[j])]++;
  for (int i = Vmax - 5; i >= 0; i--) cnt[i] = nr[i] + cnt[i + 1];
  for (int i = 0; i <= Vmax; i++)
    for (int j = 0; j <= Vmax; j++)
      if (i + j < Vmax) rez = rez + 1LL * nr[i] * nr[j] * cnt[i + j + 1];
  double ans;
  long long numitor = (n * (n - 1)) / 2;
  numitor = numitor * numitor * numitor;
  ans = double(rez) / double(numitor);
  cout << fixed << setprecision(10) << ans;
  return 0;
}
