#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
static vector<long long> convolve(const vector<long long> &a,
                                  const vector<long long> &b) {
  int M = ((int)(a).size()) + ((int)(b).size()) - 1;
  vector<long long> out(M);
  for (int i = 0; i < ((int)(a).size()); i++)
    for (int j = 0; j < ((int)(b).size()); j++) out[i + j] += a[i] * b[j];
  return out;
}
int main(int argc, const char **argv) {
  redirect(argc, argv);
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  sort(begin(a), end(a));
  double choose = N * (N - 1) / 2;
  vector<long long> ways(5001);
  for (int i = 0; i < N; i++)
    for (int j = i + 1; j < N; j++) ways[a[j] - a[i]]++;
  vector<long long> half = convolve(ways, ways);
  reverse(begin(ways), end(ways));
  vector<long long> full = convolve(half, ways);
  long long T = accumulate(full.begin(), full.begin() + 5000, 0LL);
  double ans = T / (choose * choose * choose);
  cout << fixed << setprecision(10) << ans << '\n';
  return 0;
}
