#include <bits/stdc++.h>
using namespace std;
long long int cnt[5005], num[5010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(a, a + n);
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      cnt[a[j] - a[i]]++;
    }
  }
  for (int i = 5004; i >= 0; --i) {
    num[i] = num[i + 1] + cnt[i];
  }
  long long int ans = 0;
  int den = (n * (n - 1)) / 2;
  for (int i = 1; i < 5005; ++i) {
    for (int j = 1; j < 5005 - i; ++j) {
      ans += (cnt[i] * cnt[j] * num[i + j + 1]);
    }
  }
  double ret = ans;
  ret = ret / den;
  ret = ret / den;
  ret = ret / den;
  cout << fixed << setprecision((18)) << (ret);
  cout << endl;
  return 0;
}
