#include <bits/stdc++.h>
using namespace std;
struct __timestamper {};
int main() {
  int n;
  scanf("%d", &n);
  vector<int> v(n);
  for (int& x : v) scanf("%d", &x);
  sort(v.begin(), v.end());
  int max = v.back();
  vector<double> prob(max);
  double coef = 2.0 / n / (n - 1);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      prob[v[j] - v[i]] += coef;
    }
  vector<double> prob2(2 * max);
  for (int i = 0; i < max; i++)
    for (int j = 0; j < max; j++) prob2[i + j] += prob[i] * prob[j];
  double ans = 0;
  double sum = 0;
  for (int i = 0; i < max; i++) {
    ans += sum * prob[i];
    sum += prob2[i];
  }
  printf("%.10f\n", ans);
  return 0;
}
