#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-9;
const int INF = (int)1e9;
const int N = (int)1e6 + 5;
const long long M = (int)1e9 + 7;
vector<int> sum, raz;
int a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (a[i] - a[j] > 0) raz.push_back(a[i] - a[j]);
  int m = (int)raz.size();
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++) sum.push_back(raz[i] + raz[j]);
  long double ans = 0, cnt = 8.0 / (n * n * n * (n - 1) * (n - 1) * (n - 1));
  for (int i = 0; i < m; i++) {
    int cur = lower_bound(sum.begin(), sum.end(), raz[i]) - sum.begin();
    ans += cnt * cur;
  }
  cout.precision(10);
  cout << fixed << ans;
  return 0;
}
