#include <bits/stdc++.h>
using namespace std;
int cnt[5005], num[50000];
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]]++;
    }
  }
  num[5004] = cnt[5004];
  for (int i = 5003; i >= 0; --i) {
    num[i] = num[i + 1] + cnt[i];
  }
  double ans = 0, den = (n * (n - 1)) / 2;
  for (int i = 0; i < 5005; ++i) {
    for (int j = 0; j < 5005 - i; ++j) {
      ans += cnt[i] * cnt[j] * num[i + j + 1];
    }
  }
  ans = ans / den;
  ans = ans / den;
  ans = ans / den;
  cout << fixed << setprecision((18)) << (ans);
  cout << endl;
  return 0;
}
