#include <bits/stdc++.h>
using namespace std;
vector<int> v;
int freq[5005], cum_freq[5005];
int n, C;
long double nn;
void process() {
  int i, j, dif;
  sort(v.begin(), v.end());
  for (i = 0; i < n; i++) {
    for (j = 0; j < i; j++) {
      C++;
      dif = v[i] - v[j];
      freq[dif]++;
    }
  }
  int sum = 0;
  for (i = 0; i < 5005; i++) {
    cum_freq[i] = sum + freq[i];
    sum += freq[i];
  }
}
void input() {
  int x;
  cin >> n;
  nn = n * (n - 1);
  for (int i = 0; i < n; i++) {
    cin >> x;
    v.push_back(x);
  }
}
void ans() {
  int i, j;
  long long int val;
  long double cnt, answer = 0;
  for (i = 0; i < 5005; i++) {
    for (j = 0; j < 5005; j++) {
      val = i + j;
      if (val > 5000) break;
      cnt = freq[i] * freq[j];
      val = C - cum_freq[val];
      cnt *= val;
      cnt /= (long double)C;
      cnt /= (long double)C;
      cnt /= (long double)C;
      answer += cnt;
    }
  }
  cout << fixed << setprecision(10) << answer << endl;
}
void solve() {
  input();
  process();
  ans();
}
int main() { solve(); }
