#include <bits/stdc++.h>
int main() {
  long long int i, met, sum;
  long long int min, Max = 0, we = 1, number, x[100000], dx[100000];
  double reb;
  scanf("%lld", &number);
  min = number - 1;
  for (i = 0; i < number; i++) {
    scanf("%lld", &x[i]);
  }
  for (i = 0; i < number - 1; i++) {
    met = x[number - 1] - x[i];
    Max = Max + met;
    we = we * (i + 1);
  }
  for (i = min; i <= Max; i++) {
    sum = sum + i;
  }
  reb = (double)sum / (double)(number - 1) * we;
  printf("%d", (int)reb);
  return 0;
}
