#include <bits/stdc++.h>
using namespace std;
long long calc_dist(int N, vector<long long> x, vector<long long> order) {
  long long ans = 0;
  for (int i = 0; i < N - 1; i++) {
    long long p = order.at(i);
    ans += x.at(p + 1) - x.at(p);
    x.at(p) = x.at(p + 1);
  }
  return ans;
}
int main() {
  int N;
  cin >> N;
  vector<long long> x(N);
  vector<long long> y(N);
  for (int i = 0; i < N; i++) {
    long long kari;
    cin >> kari;
    x.at(i) = kari;
    y.at(i) = kari;
  }
  vector<long long> order(N - 1);
  for (int i = 0; i < N - 1; i++) {
    order.at(i) = i;
  }
  long long sum = 0;
  do {
    sum += calc_dist(N, x, order);
    x = y;
  } while (next_permutation(order.begin(), order.end()));
  long long frac = 1;
  for (int i = 1; i < N; i++) {
    frac *= i;
  }
  double kitai = sum / (double)(N - 1);
  long long a = frac * kitai;
  cout << a << endl;
}
