#include <bits/stdc++.h>
using namespace std;
int C(int n) { return (n * (n - 1)) / 2; }
int main() {
  int n;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) scanf("%d", &arr[i]);
  sort(arr, arr + n);
  int dp[5001];
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) dp[arr[i] - arr[j]]++;
  }
  double prob[5001];
  memset(prob, 0, sizeof(prob));
  for (int i = 1; i < 5000; i++) prob[i] = (double)(dp[i]) / C(n);
  double s = 0;
  double two[10001];
  memset(two, 0, sizeof(two));
  for (int i = 1; i < 5000; i++) {
    two[i + i] += prob[i] * prob[i];
    for (int j = 1; j < 5000; j++)
      if (j != i) two[i + j] += (prob[i] * prob[j]);
  }
  double res = 0;
  for (int i = 1; i < 5000; i++) {
    for (int j = 0; j < i; j++) res += prob[i] * two[j];
  }
  cout << setprecision(10) << res;
}
