#include <bits/stdc++.h>
using namespace std;
long long int power(long long int a, long long int b, long long int m) {
  long long int ans = 1;
  while (b) {
    if (b & 1) {
      ans = ((ans % m) * (a % m)) % m;
    }
    a = ((a % m) * (a % m)) % m;
    b = b >> 1;
  }
  return ans;
}
long long int powe(long long int a, long long int b) {
  long long int ans = 1;
  while (b) {
    if (b & 1) {
      ans = a * ans;
    }
    a = a * a;
    b = b >> 1;
  }
  return ans;
}
long long int ncr(long long int n, long long int r) {
  r = ((r < n - r) ? (r) : (n - r));
  long long int ans = 1;
  for (int i = 0; i < r; i++) {
    ans *= (n - i);
    ans /= (i + 1);
  }
  return ans;
}
long long int spf[15000005 + 4];
void sieve() {
  long long int n = 15000005;
  for (int i = 2; i <= n; i += 2) {
    spf[i] = 2;
  }
  for (int i = 3; i <= n; i += 2) {
    spf[i] = i;
  }
  for (int i = 3; i * i <= n; i += 2) {
    if (spf[i] == i) {
      for (int j = i * i; j <= n; j += i) {
        if (spf[j] == j) {
          spf[j] = i;
        }
      }
    }
  }
}
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  map<long long int, long long int> mp, mp2;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = i - 1; j >= 0; j--) {
      mp[a[i] - a[j]]++;
    }
  }
  for (auto i = mp.begin(); i != mp.end(); i++) {
    for (auto j = i; j != mp.end(); j++) {
      mp2[((i->first) + (j->first))] += ((i->second) * (j->second));
    }
  }
  long double ans = 0;
  for (int i = 0; i < n; i++) {
    for (auto j : mp2) {
      ans += a.end() - upper_bound(a.begin(), a.end(), a[i] + j.first);
    }
  }
  long double deno = mp.size();
  long double answer = ans / deno;
  answer = answer / deno;
  answer = answer / deno;
  cout << fixed << setprecision(10) << answer << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  while (t > 0) {
    solve();
    t--;
  }
}
