#include <bits/stdc++.h>
using namespace std;
inline long long getint() {
  long long _x = 0, _tmp = 1;
  char _tc = getchar();
  while ((_tc < '0' || _tc > '9') && _tc != '-') _tc = getchar();
  if (_tc == '-') _tc = getchar(), _tmp = -1;
  while (_tc >= '0' && _tc <= '9') _x *= 10, _x += (_tc - '0'), _tc = getchar();
  return _x * _tmp;
}
long long mypow(long long _a, long long _x, long long _mod) {
  if (_x == 0) return 1ll;
  long long _tmp = mypow(_a, _x / 2, _mod);
  _tmp = (_tmp * _tmp) % _mod;
  if (_x & 1) _tmp = (_tmp * _a) % _mod;
  return _tmp;
}
inline long long add(long long _x, long long _y,
                     long long _mod = 1000000007ll) {
  long long _ = _x + _y;
  if (_ >= _mod) _ -= _mod;
  return _;
}
inline long long sub(long long _x, long long _y,
                     long long _mod = 1000000007ll) {
  long long _ = _x - _y;
  if (_ < 0) _ += _mod;
  return _;
}
inline long long mul(long long _x, long long _y,
                     long long _mod = 1000000007ll) {
  long long _ = _x * _y;
  if (_ >= _mod) _ %= _mod;
  return _;
}
inline bool equal(double _x, double _y) {
  return _x > _y - 1e-9 && _x < _y + 1e-9;
}
int __ = 1, _cs;
void build() {}
int n, a[2222];
void init() {
  n = getint();
  for (int i = 0; i < n; i++) a[i] = getint();
  sort(a, a + n);
}
double p[22222], p2[22222], psum[22222];
void solve() {
  for (int i = 1; i < n; i++)
    for (int j = 0; j < i; j++) p[a[i] - a[j]]++;
  int mx = a[n - 1] - a[0];
  for (int i = 0; i <= mx; i++) p[i] /= ((double)n * (double)(n - 1)) * 0.5;
  for (int i = 0; i <= mx; i++)
    for (int j = 0; j <= mx; j++)
      if (i + j <= mx) p2[i + j] += p[i] * p[j];
  for (int i = 1; i <= mx; i++) psum[i] = psum[i - 1] + p2[i];
  double ans = 0.0;
  for (int i = 2; i <= mx; i++) ans += p[i] * psum[i - 1];
  printf("%.12f\n", ans);
}
int main() {
  build();
  while (__--) {
    init();
    solve();
  }
}
