#include <bits/stdc++.h>
using namespace std;
long long dp[5002], diff[5002], num[5002];
vector<long long> a, b;
int main() {
  long long n, i, j, k, p, q, temp = 0, x, diff1, diff2, ans = 0, tt;
  long double ab;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  for (i = 0; i < n; i++) {
    temp += n - i - 1;
  }
  diff2 = pow(temp, 3);
  for (i = 0; i < n - 1; i++) {
    for (j = i + 1; j < n; j++) {
      x = a[j] - a[i];
      dp[x]++;
      num[x]++;
    }
  }
  for (i = 5000; i > 0; i--) {
    dp[i - 1] += dp[i];
  }
  for (i = 1; i <= 5000; i++) {
    for (j = 1; j <= 5000; j++)
      if (i + j + 1 < 5001) ans += num[i] * num[j] * dp[i + j + 1];
  }
  ab = (long double)(ans) / (long double)(diff2);
  cout << setprecision(10) << ab;
  return 0;
}
