#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) { cerr << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << " , ";
  err(++it, args...);
}
namespace fastIO {
bool IOerror = 0;
inline char nc() {
  static char buf[100000], *p1 = buf + 100000, *pend = buf + 100000;
  if (p1 == pend) {
    p1 = buf;
    pend = buf + fread(buf, 1, 100000, stdin);
    if (pend == p1) {
      IOerror = 1;
      return -1;
    }
  }
  return *p1++;
}
inline bool blank(char ch) {
  return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
}
inline void read(int &x) {
  char ch;
  while (blank(ch = nc()))
    ;
  if (IOerror) return;
  for (x = ch - '0'; (ch = nc()) >= '0' && ch <= '9'; x = x * 10 + ch - '0')
    ;
}
}  // namespace fastIO
using namespace fastIO;
const double PI = acos(-1.0);
const double eps = 1e-8;
const int maxn = 3e5 + 7;
const int N = 1e4 + 10;
const int mod = 998244353;
long long qp(long long b, long long n) {
  long long r = 1;
  if (n < 0) n += mod - 1;
  b %= mod;
  for (; n; n >>= 1, b = b * b % mod)
    if (n & 1) r = r * b % mod;
  return r;
}
int sgn(double x) {
  if (x < -eps) return -1;
  return x > eps ? 1 : 0;
}
int n;
long long dp[3][N];
long long sum[N], suf[N];
int a[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  long long _c2 = (n * (n - 1) / 2);
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      dp[0][a[j] - a[i]]++;
    }
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      dp[1][a[j] - a[i]]++;
    }
  }
  for (int i = 1; i <= 10000; ++i) {
    for (int j = 1; j < i; ++j) {
      int k = i - j;
      dp[2][i] += dp[0][j] * dp[1][k];
    }
    sum[i] = sum[i - 1] + dp[2][i];
  }
  double ans = 0;
  for (int i = 10000; i >= 1; --i) {
    ans += sum[i - 1] * dp[0][i];
  }
  printf("%.12lf\n", 1.0 * ans / _c2 / _c2 / _c2);
}
