#include <bits/stdc++.h>
using namespace std;
void fast() {
  cin.tie(0);
  cin.sync_with_stdio(0);
}
const int MAX = 5e3 + 1;
long long prefix[5 * MAX], pairs[MAX], n;
int main() {
  fast();
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      pairs[abs(arr[i] - arr[j])]++;
    }
  }
  for (int i = MAX - 1; i >= 0; --i) {
    prefix[i] = pairs[i] + prefix[i + 1];
  }
  long long ans = 0;
  for (int i = 0; i < MAX; ++i) {
    for (int j = 0; j < MAX; ++j) {
      int a = pairs[i];
      int b = pairs[j];
      int c = prefix[i + j + 1];
      ans += (a * b * c);
    }
  }
  cout << fixed << setprecision(10) << 1.0 * ans / (n * n * n);
}
