#include <bits/stdc++.h>
using namespace std;
int i;
long long l, r, mid, n, ma, a[200000], s;
bool ok() {
  s = 0;
  for (i = 1; i <= n; i++) {
    s += mid - a[i];
    if (s >= mid) return true;
  }
  return false;
}
int main() {
  cin >> n;
  ma = 0;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    ma = max(a[i], ma);
  }
  l = ma;
  r = 1 << 30;
  for (i = 1; i <= 20; i++) r = r * 2;
  while (l < r) {
    mid = (l + r) >> 1;
    if (ok())
      r = mid;
    else
      l = mid + 1;
  }
  cout << l << endl;
  return 0;
}
