#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  vector<long long int> p1(a[n - 1] - a[0] + 1, 0);
  for (long long int i = n - 1; i >= 0; i--) {
    for (long long int j = i - 1; j >= 0; j--) {
      p1[a[i] - a[j]]++;
    }
  }
  vector<long long int> p2(2 * (a[n - 1] - a[0]) + 1, 0);
  for (long long int i = 0; i < p1.size(); i++) {
    for (long long int j = 0; j < p1.size(); j++) {
      p2[i + j] += p1[i] * p1[j];
    }
  }
  for (long long int i = 1; i < p2.size(); i++) {
    p2[i] += p2[i - 1];
  }
  double ans = 0;
  for (long long int i = 1; i < p1.size(); i++) {
    ans += p1[i] * p2[i - 1];
  }
  ans = ans / n;
  ans = ans / n;
  ans = ans / n;
  cout << ans;
  return 0;
}
