#include <bits/stdc++.h>
using namespace std;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using sstrm = stringstream;
using ld = long double;
template <typename S, typename T>
inline void chmin(S& a, T b) {
  if (b < a) a = b;
}
template <typename S, typename T>
inline void chmax(S& a, T b) {
  if (a < b) a = b;
}
struct debug_t {};
template <typename T_>
debug_t& operator<<(debug_t& out_, T_& t_) {
  (void)t_;
  return out_;
}
debug_t debug;
constexpr size_t N = 2001;
constexpr size_t D = 5001;
ld d1[D] = {0};
ld d2[D] = {0};
int v[N] = {0};
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(17);
  cout << fixed;
  int n;
  cin >> n;
  for (int i = 0; i < (n); ++i) {
    int x;
    cin >> x;
    v[i] = x;
  }
  ld p1 = ld(2) / (n - 1) / n;
  for (int i = 0; i < (n - 1); ++i)
    for (decltype(i + 1) j = (i + 1); j <= (n - 1); ++j) {
      int x = min(v[i], v[j]);
      int y = max(v[i], v[j]);
      d1[y - x] += p1;
    }
  for (int i = 0; i < (D - 2); ++i) {
    if (d1[i] == 0) continue;
    for (decltype(i) j = (i); j <= (min(D - 1, D - i - 1)); ++j) {
      d2[i + j] = d1[i] * d1[j];
    }
  }
  for (decltype(1) i = (1); i <= (D - 1); ++i) {
    d2[i] += d2[i - 1];
  }
  ld res = 0;
  for (decltype(1) i = (1); i <= (D - 1); ++i) {
    res += d1[i] * d2[i - 1];
  }
  cout << res << "\n";
}
