#include <bits/stdc++.h>
using namespace std;
inline bool checkBit(long long n, int i) { return n & (1LL << i); }
inline long long setBit(long long n, int i) { return n | (1LL << i); }
inline long long resetBit(long long n, int i) { return n & (~(1LL << i)); }
inline bool EQ(double a, double b) { return fabs(a - b) < 1e-9; }
inline double dist(double ix, double iy, double jx, double jy) {
  return sqrt(((ix - jx) * (ix - jx)) + ((iy - jy) * (iy - jy)));
}
int marked[1000000 / 64 + 2];
bool isPrime(int x) {
  return (x > 1) &&
         ((x == 2) ||
          ((x & 1) && (!((marked[x >> 6] & (1 << ((x & 63) >> 1)))))));
}
void seive(int n) {
  int i, j;
  for (i = 3; i * i <= n; i += 2) {
    if (!(marked[i >> 6] & (1 << ((i & 63) >> 1)))) {
      for (j = i * i; j <= n; j += i << 1) {
        marked[j >> 6] |= (1 << ((j & 63) >> 1));
      }
    }
  }
}
long long bigMod(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) (r *= a) %= 1000000007;
    b >>= 1;
    (a *= a) %= 1000000007;
  }
  return r;
}
int a[5007];
long long way[5007], cnt[5007], ans;
int main() {
  int n, i, j;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  sort(a, a + n);
  for (i = 0; i < n; i++)
    for (j = 0; j < i; j++) cnt[a[i] - a[j]]++;
  for (i = 1; i <= 5000; i++)
    for (j = 1; j < i; j++) way[i] += cnt[j] * cnt[i - j];
  for (i = 1; i <= 5000; i++) way[i] += way[i - 1];
  for (i = 1; i <= 5000; i++) ans += cnt[i] * way[i - 1];
  long long den = n * (n - 1) / 2;
  den = den * den * den;
  printf("%.10lf\n", ans / (den * 1.0));
  return 0;
}
