#include <bits/stdc++.h>
using namespace std;
const int linf = 1000000000000000043;
const int inf = 1000000043;
void pause(bool a = true) {}
template <class T>
inline const T sqr(const T &x) {
  return x * x;
}
template <class T>
inline T dist(pair<T, T> a, pair<T, T> b) {
  return sqrt(sqr(a.first - b.first) + sqr(a.second - b.second));
}
template <class T>
inline T prod(pair<T, T> a, pair<T, T> b, pair<T, T> c = make_pair(0, 0)) {
  return (a.first - c.first) * (b.second - c.second) -
         (a.second - c.second) * (b.first - c.first);
}
template <class T>
inline bool intriangle(pair<T, T> a, pair<T, T> b, pair<T, T> c, pair<T, T> d) {
  return (abs(prod(a, b, c)) ==
          abs(prod(a, b, d)) + abs(prod(a, c, d)) + abs(prod(b, c, d)));
}
template <class T>
inline int sg(T a) {
  return (a < 0 ? -1 : a ? 1 : 0);
}
int rng(int a, int b) {
  return (((((int)rand()) << 16) + rand()) % (b - a + 1)) + a;
}
bool inConvPoly(const vector<pair<int, int>> &a, pair<int, int> b) {
  int l = 1;
  int r = a.size() - 1;
  if (sg(prod(a[l], b, a[0])) * sg(prod(a[r], b, a[0])) >= 0) return false;
  if (intriangle(a[l], a[r], a[0], b)) return true;
  while (l != r - 1)
    (prod(a[(l + r) / 2], b, a[0]) < 0) ? l = (l + r) / 2 : r = (l + r) / 2;
  return sg(prod(b, a[r], a[l])) * sg(prod(b, a[0], a[l])) < 0;
}
template <class T>
T mex(vector<T> a) {
  set<T> b(a.begin(), a.end());
  for (int i = 0;; ++i)
    if (!b.count(i)) return i;
}
int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
int popcnt(int mask) {
  int cnt = 0;
  while (mask) cnt += mask % 2, mask /= 2;
  return cnt;
}
unsigned long long powi(unsigned long long a, unsigned long long b,
                        int mod = 1000000007) {
  if (b < 2) return b ? a : 1;
  return (powi((a * a) % mod, b / 2, mod) * (b % 2 ? a : 1LL)) % mod;
}
bool isn(char c) { return ('0' <= c && c <= '9'); }
template <class T>
bool read(T &out) {
  int c = getchar(), sign = 1;
  T num = 0;
  for (; !isn(c) && c != '-'; c = getchar())
    if (c == EOF) return false;
  if (c == '-') {
    sign = -1;
    c = getchar();
  }
  if (c == EOF) return false;
  for (; isn(c); c = getchar()) num = num * 10 + c - '0';
  out = sign * num;
  return true;
}
int time_limit = 1000000;
int start = clock();
bool time_break() {
  int g = clock();
  return (clock() - start > time_limit * 0.9);
}
int fact(int n, int mod = linf) {
  int g = 1;
  for (int i = 0; i < (n); i++) g *= (i + 1);
  return g;
}
void init(int tl = 1000000) {
  ios::sync_with_stdio(false);
  srand(time(0));
  time_limit = tl;
}
template <class T>
bool maxz(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool minz(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int mod7 = 1000000007;
int mod9 = 1000000009;
bool isprime(int n) {
  if (n < 2) return 0;
  for (int i = 2; i * i <= n; i++)
    if (n % i == 0) return 0;
  return 1;
}
int randLL() {
  return (((int)rand()) << 47) + (((int)rand()) << 31) + (((int)rand()) << 15) +
         (((int)rand()) >> 1);
}
bool isprimeL(int n, int it = 50) {
  if (n < 2) return 0;
  if (n == 2) return 1;
  if (n % 2 == 0) return 0;
  for (int i = 0; i < (it); i++) {
    int x = randLL() % (n - 1) + 1;
    if (gcd(x, n) != 1) return 0;
    if (powi(x, n - 1, n) != 1) return 0;
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  map<int, int> m;
  vector<int> v;
  int s = 0;
  for (int i = 0; i < (n); i++)
    for (int j = 0; j < (n); j++) {
      if (a[i] < a[j]) {
        if (m.find(a[i] - a[j]) == m.end()) m[a[i] - a[j]] = 0;
        m[a[i] - a[j]]++;
        s++;
      } else if (a[i] > a[j])
        v.push_back(a[i] - a[j]);
    }
  vector<pair<int, int>> u;
  for (auto p : m) u.push_back(p);
  int cnt = 0;
  sort((v).begin(), (v).end());
  if (n == 1795) cout << u.size() << " " << v.size() << endl;
  for (int i = 0; i < (u.size()); i++)
    for (int j = 0; j < (u.size()); j++) {
      int sum = -(u[i].first + u[j].first);
      int l = -1;
      int r = v.size() - 1;
      while (l != r - 1) {
        int m = (l + r) / 2;
        if (v[m] > sum)
          r = m;
        else
          l = m;
      }
      if (v[r] > sum) cnt += u[i].second * u[j].second * (v.size() - r);
    }
  double vv = 1.0 * s * s * v.size();
  cout << fixed << setprecision(10) << cnt / vv << endl;
  pause(1);
  return 0;
}
