#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[n][5001];
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < n; j++) dp[i][arr[i] - arr[j]]++;
  }
  float prob[5001];
  memset(prob, 0, sizeof(prob));
  for (int i = 1; i < 5000; i++) {
    int count = 0;
    for (int j = 1; j < n; j++) count += dp[j][i];
    prob[i] = (float)(count) / C(n);
  }
  float 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;
}
