#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<int> pos_diff(5002, 0);
  vector<int> neg_diff(10010, 0);
  long double all1 = 0;
  long double all2 = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (i == j) {
        continue;
      }
      int a1 = a[i];
      int a2 = a[j];
      int d = a1 - a2;
      if (d > 0) {
        ++pos_diff[d];
        ++all1;
      }
      if (d < 0) {
        ++neg_diff[-d];
        ++all2;
      }
    }
  }
  for (int i = 10008; i >= 0; --i) {
    neg_diff[i] += neg_diff[i + 1];
  }
  long double ans = 0;
  for (int i = 0; i < 5001; ++i) {
    for (int j = 0; j < 5001; ++j) {
      int d_sum = i + j;
      ans += static_cast<long double>(pos_diff[i]) / all1 *
             static_cast<long double>(pos_diff[j]) / all1 *
             static_cast<long double>(neg_diff[d_sum + 1]) / all2;
    }
  }
  cout << setprecision(16) << ans << endl;
  return 0;
}
