#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
const long long MOD = 1000000007;
string s;
vector<int> nums;
vector<int> combination;
vector<long long> diffs(5001, 0);
vector<long long> sums(10000, 0);
long long down = 0;
int myA(int a) { return a < 0 ? -a : a; }
void go(int offset, int k) {
  if (k == 0) {
    down++;
    diffs[myA(combination[0] - combination[1])]++;
    return;
  }
  for (int i = offset; i <= nums.size() - k; ++i) {
    combination.push_back(nums[i]);
    go(i + 1, k - 1);
    combination.pop_back();
  }
}
int main() {
  long long l = 1999000ll * 1999000ll * 1999000ll;
  int n;
  cin >> n;
  nums.resize(n);
  for (long long i = 0; i < (int)n; i++) cin >> nums[i];
  go(0, 2);
  for (int i = 1; i <= 4999; ++i) {
    for (int j = 1; j <= 4999; ++j) {
      if (i == j) {
        if (diffs[i] > 0) {
          sums[i + j] = (diffs[i] * (diffs[i] - 1ll)) / 2ll;
        }
      } else {
        if (diffs[i] > 0 && diffs[j] > 0) {
          sums[i + j] = diffs[i] * diffs[j];
        }
      }
    }
  }
  long long top = 0;
  long long lower = 0;
  for (int j = 1; j <= 4999; ++j) {
    if (diffs[j] > 0) top += (lower * diffs[j]);
    if (sums[j] > 0) lower += (sums[j]);
  }
  cout << setprecision(8) << fixed
       << ((double)top / (double)(down * down * down)) << endl;
  return 0;
}
