#include <bits/stdc++.h>
using namespace std;
namespace stuff {
const int MOD = int(1e9) + 7;
const int MAX = 5555;
double prob[MAX], two[MAX];
void solve(int test_num) {
  int N;
  cin >> N;
  vector<int> arr(N);
  for (int i = 0; i < N; ++i) {
    cin >> arr[i];
  }
  sort(arr.begin(), arr.end());
  memset(prob, 0, sizeof(prob));
  const int ways = N * (N - 1) / 2;
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j < N; ++j) {
      prob[arr[j] - arr[i]] += 1.0 / ways;
    }
  }
  memset(two, 0, sizeof(two));
  for (int a = 1; a < MAX; ++a) {
    for (int b = 1; a + b < MAX; ++b) {
      two[a + b] += prob[a] * prob[b];
    }
  }
  double res = 0.0, sum = 0.0;
  for (int x = 1; x < MAX; ++x) {
    res += prob[x] * sum;
    sum += two[x];
  }
  cout << fixed << setprecision(7) << res << endl;
}
void solve() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  for (int t = 1; t <= T; t++) solve(t);
}
}  // namespace stuff
int main() {
  stuff::solve();
  return 0;
}
