#include <bits/stdc++.h>
using namespace std;
const int MAX = 5000;
int main() {
  int n;
  cin >> n;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  vector<unsigned long long> diff(MAX, 0);
  vector<unsigned long long> more_diff(2 * MAX, 0);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) diff[abs(arr[i] - arr[j])]++;
  for (int i = 0; i < MAX; i++)
    for (int j = 0; j < MAX; j++) {
      more_diff[i + j] += diff[i] * diff[j];
    }
  vector<unsigned long long> sums(2 * MAX, 0);
  sums[0] = more_diff[0];
  for (int i = 1; i < more_diff.size(); i++)
    sums[i] = sums[i - 1] + more_diff[i];
  unsigned long long ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int cur = abs(arr[i] - arr[j]);
      ans += sums[cur - 1];
    }
  unsigned long long total = n * (n - 1) / 2;
  total = total * total * total;
  printf("%.9lf\n", double(ans) / total);
  return 0;
}
