#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int arr[n + 9];
  double sum[5001] = {0}, arr2[10000] = {0};
  long double ans = 0, m = n * (n - 1) / 2;
  m = m * m * m;
  for (int i = 0; i < n; i++) cin >> arr[i];
  sort(arr, arr + n);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) sum[arr[j] - arr[i]]++;
  for (int i = 1; i <= 4999; i++)
    for (int j = 1; j <= 4999; j++) arr2[i + j] += sum[i] * sum[j];
  for (int i = 1; i <= 9999; i++) arr2[i] += arr2[i - 1];
  for (int i = 1; i <= 4999; i++) ans += sum[i] * arr2[i - 1];
  cout << setprecision(8) << fixed << ans / m;
}
