#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll unsigned long long
#define ii pair<int,int>
#define mp make_pair
#define pb push_back
#define INF 1000000000
#define double long double
#define EPS 0.000000000000000001l
int n;
double a[100005],b[100005],p[100005],q[100005];
int main() {
	scanf("%d",&n);
	for (int i=0;i<n;i++) {
		scanf("%Lf",&a[i]);
	}
	for (int i=0;i<n;i++) {
		scanf("%Lf",&b[i]);
	}
	double sp=0.0l,sq=0.0l;
	for (int i=0;i<n;i++) {
		double x=a[i]+b[i];
		double c2=sp-sq-x,c3=a[i]-x*sp;
		double k=sqrt(c2*c2-4.0l*c3+EPS);
		p[i]=(-c2+sqrt(c2*c2-4.0l*c3+EPS))/2.0l;
		q[i]=x-p[i]+EPS;
		sp+=p[i];
		sq+=q[i];
	}
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", p[i]);
	}
	printf("\n");
	for (int i=0;i<n;i++) {
		printf("%.8Lf ", q[i]);
	}
	printf("\n");
}


#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define ll unsigned long long
#define ii pair<int,int>
#define mp make_pair
#define pb push_back
#define INF 1000000000
int n;
double a[100005],b[100005],p[100005],q[100005];
int main() {
	scanf("%d",&n);
	for (int i=0;i<n;i++) {
		scanf("%lf",&a[i]);
	}
	for (int i=0;i<n;i++) {
		scanf("%lf",&b[i]);
	}
	double sp=0.0,sq=0.0;
	for (int i=0;i<n;i++) {
		double x=a[i]+b[i];
		double c2=sp-sq-x,c3=a[i]-x*sp;
		p[i]=(-c2+sqrt(c2*c2-4.0*c3))/2.0;
		q[i]=x-p[i];
		sp+=p[i];
		sq+=q[i];
	}
	for (int i=0;i<n;i++) {
		printf("%.8lf ", p[i]);
	}
	printf("\n");
	for (int i=0;i<n;i++) {
		printf("%.8lf ", q[i]);
	}
	printf("\n");
}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
double p1[1000011];
double p2[1000011];
double a[1000011];
double b[1000011];
int main(){

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	double c1=0;
	double c2=0;
	rep(i,n){
		double cur=-c2+c1+p1[i]+p2[i]+sqrt((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4*(p1[i]-(p1[i]+p2[i])*c2) );
		cur/=2;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		printf("%.10f ",a[i]);
	}
	printf("\n");
	rep(i,n){
		printf("%.10f ",b[i]);
	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
double p1[100011];
 double p2[100011];
 double a[100011];
 double b[100011];
int main(){

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	double c1=0;
	double c2=0;
	rep(i,n){
		double cur=-c2+c1+p1[i]+p2[i]+sqrt((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2) );
		cur/=2.0;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		cout<<setprecision(10)<<a[i]<<" ";

	}
	printf("\n");
	rep(i,n){
		cout<<setprecision(10)<<b[i]<<" ";

	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
double p1[1000011];
 double p2[1000011];
 double a[1000011];
 double b[1000011];
int main(){

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	double c1=0;
	double c2=0;
	rep(i,n){
		double cur=-c2+c1+p1[i]+p2[i]+sqrt((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2) );
		cur/=2.0;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		printf("%.10f ",a[i]);
	}
	printf("\n");
	rep(i,n){
		printf("%.10f ",b[i]);
	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
long double p1[100011];
 long double p2[100011];
 long double a[100011];
 long double b[100011];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	long double c1=0;
	long double c2=0;
	rep(i,n){
		long double cur=-c2+c1+p1[i]+p2[i]+sqrt((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2) );
		cur/=2.0;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		cout<<setprecision(10)<<a[i]<<" ";

	}
	cout<<"\n";
	rep(i,n){
		cout<<setprecision(10)<<b[i]<<" ";

	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
long double p1[100011];
 long double p2[100011];
 long double a[100011];
 long double b[100011];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	long double c1=0;
	long double t;
	long double c2=0;
	rep(i,n){
		if((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2)<=0) t=0;
		else
		  t=(c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2);
		long double cur=-c2+c1+p1[i]+p2[i]+sqrt(t);
		cur/=2.0;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		cout<<setprecision(10)<<a[i]<<" ";

	}
	cout<<"\n";
	rep(i,n){
		cout<<setprecision(10)<<b[i]<<" ";

	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
double p1[1000011];
double p2[1000011];
double a[1000011];
double b[1000011];
int main(){

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	double c1=0;
	double c2=0;
	double t;
	rep(i,n){
		if((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2)<=0) t=0;
		else
		  t=(c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2);
		double cur=-c2+c1+p1[i]+p2[i]+sqrt(t );
		cur/=2;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		printf("%.10f ",a[i]);
	}
	printf("\n");
	rep(i,n){
		printf("%.10f ",b[i]);
	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
long double p1[100011];
 long double p2[100011];
 long double a[100011];
 long double b[100011];
int main(){

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	long double c1=0;
	long double c2=0;

	rep(i,n){
		long double cur=-c2+c1+p1[i]+p2[i]+sqrt((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2) );
		cur/=2.0;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		cout<<setprecision(10)<<a[i]<<" ";

	}
	cout<<"\n";
	rep(i,n){
		cout<<setprecision(10)<<b[i]<<" ";

	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
long double p1[100011];
 long double p2[100011];
 long double a[100011];
 long double b[100011];
int main(){

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	long double c1=0;
	long double c2=0;
	rep(i,n){
		long double cur=-c2+c1+p1[i]+p2[i]+sqrt((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2) );
		cur/=2.0;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		cout<<setprecision(10)<<a[i]<<" ";

	}
	cout<<"\n";
	rep(i,n){
		cout<<setprecision(10)<<b[i]<<" ";

	}

}


#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define f first
#define s second
#define pb push_back
double p1[1000011];
 double p2[1000011];
 double a[1000011];
 double b[1000011];
int main(){

	int n;
	cin >> n;
	rep(i,n){
		cin >> p1[i];
	}
	rep(i,n){
		cin >> p2[i];
	}
	double c1=0;
	double c2=0;
	rep(i,n){
		double cur=-c2+c1+p1[i]+p2[i]+sqrt((c1-c2+p1[i]+p2[i])*(c1-c2+p1[i]+p2[i])-4.0*(p1[i]-(p1[i]+p2[i])*c2) );
		cur/=2.0;
		b[i]=cur;
		a[i]=p1[i]+p2[i]-b[i];
		c1+=a[i];
		c2+=b[i];
	}
	rep(i,n){
		cout<<setprecision(10)<<a[i]<<" ";

	}
	printf("\n");
	rep(i,n){
		cout<<setprecision(10)<<a[i]<<" ";

	}

}


#include <bits/stdc++.h>
using namespace std;

#define sd(x) 		scanf("%d",&x)
#define su(x) 		scanf("%u",&x)
#define slld(x) 	scanf("%lld",&x)
#define sc(x) 		scanf("%c",&x)
#define ss(x) 		scanf("%s",x)
#define sf(x) 		scanf("%f",&x)
#define slf(x)		scanf("%lf",&x)
#define ll 			long long int
#define mod(x,n) 	(x+n)%n
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
ll Mod = 1000000007;

int main()
{
	// auther aniket bansal //
	// freopen("input_file_name.in","r",stdin);
	// freopen("output_file_name.out","w",stdout);

	ll i,j,k,l,m,n,x,y,z,a,b,r,t;
	// int i,j,k,l,m,n,x,y,z,a,b,r;

	cin>>n;
	ll A[n];
	ll sum = 0;

	ll maxx = INT_MIN;
	for(i=0;i<n;i++){
		slld(A[i]);
		sum+=A[i];
		if(maxx < A[i]){
			maxx = A[i];
		}
	}
	ll  ans  =floor((float)sum/(n-1)+1) > maxx ? floor((float)sum/(n-1)+1) : maxx;

	cout<<ans<<endl;

	return 0;

}


#include <bits/stdc++.h>
using namespace std;

#define sd(x) 		scanf("%d",&x)
#define su(x) 		scanf("%u",&x)
#define slld(x) 	scanf("%lld",&x)
#define sc(x) 		scanf("%c",&x)
#define ss(x) 		scanf("%s",x)
#define sf(x) 		scanf("%f",&x)
#define slf(x)		scanf("%lf",&x)
#define ll 			long long int
#define mod(x,n) 	(x+n)%n
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
ll Mod = 1000000007;

int main()
{
	// auther aniket bansal //
	// freopen("input_file_name.in","r",stdin);
	// freopen("output_file_name.out","w",stdout);

	ll i,j,k,l,m,n,x,y,z,a,b,r,t;
	// int i,j,k,l,m,n,x,y,z,a,b,r;

	cin>>n;
	ll A[n];
	ll sum = 0;

	ll maxx = INT_MIN;
	for(i=0;i<n;i++){
		slld(A[i]);
		sum += A[i];
		if(maxx < A[i]){
			maxx = A[i];
		}
	}

	ll  ans  =(sum+n-2)/(n-1) > maxx ? (sum+n-2)/(n-1): maxx;

	cout<<ans<<endl;

	return 0;

}


#include <bits/stdc++.h>
using namespace std;

#define sd(x) 		scanf("%d",&x)
#define su(x) 		scanf("%u",&x)
#define slld(x) 	scanf("%lld",&x)
#define sc(x) 		scanf("%c",&x)
#define ss(x) 		scanf("%s",x)
#define sf(x) 		scanf("%f",&x)
#define slf(x)		scanf("%lf",&x)
#define ll 			long long int
#define mod(x,n) 	(x+n)%n
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
ll Mod = 1000000007;

int main()
{
	// auther aniket bansal //
	// freopen("input_file_name.in","r",stdin);
	// freopen("output_file_name.out","w",stdout);

	ll i,j,k,l,m,n,x,y,z,a,b,r,t;
	// int i,j,k,l,m,n,x,y,z,a,b,r;

	cin>>n;
	ll A[n];
	ll sum = 0;

	ll maxx = INT_MIN;
	for(i=0;i<n;i++){
		slld(A[i]);
		sum += A[i];
		if(maxx < A[i]){
			maxx = A[i];
		}
	}
	ll  ans  =ceil((float)sum/(n-1)) > maxx ? ceil((float)sum/(n-1)): maxx+n-1;

	cout<<ans<<endl;

	return 0;

}


#include <bits/stdc++.h>
using namespace std;

#define sd(x) 		scanf("%d",&x)
#define su(x) 		scanf("%u",&x)
#define slld(x) 	scanf("%lld",&x)
#define sc(x) 		scanf("%c",&x)
#define ss(x) 		scanf("%s",x)
#define sf(x) 		scanf("%f",&x)
#define slf(x)		scanf("%lf",&x)
#define ll 			long long int
#define mod(x,n) 	(x+n)%n
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
ll Mod = 1000000007;

int main()
{
	// auther aniket bansal //
	// freopen("input_file_name.in","r",stdin);
	// freopen("output_file_name.out","w",stdout);

	ll i,j,k,l,m,n,x,y,z,a,b,r,t;
	// int i,j,k,l,m,n,x,y,z,a,b,r;

	cin>>n;
	ll A[n];
	ll sum = 0;

	ll maxx = INT_MIN;
	for(i=0;i<n;i++){
		slld(A[i]);
		sum += A[i];
		if(maxx < A[i]){
			maxx = A[i];
		}
	}
	ll ans2 = ceil((n*maxx)/(n-1));
	ll  ans  =ceil((float)sum/(n-1)) > maxx ? ceil((float)sum/(n-1)): ans2;

	cout<<ans<<endl;

	return 0;

}


#include <bits/stdc++.h>
using namespace std;

#define sd(x) 		scanf("%d",&x)
#define su(x) 		scanf("%u",&x)
#define slld(x) 	scanf("%lld",&x)
#define sc(x) 		scanf("%c",&x)
#define ss(x) 		scanf("%s",x)
#define sf(x) 		scanf("%f",&x)
#define slf(x)		scanf("%lf",&x)
#define ll 			long long int
#define mod(x,n) 	(x+n)%n
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
ll Mod = 1000000007;

int main()
{
	// auther aniket bansal //
	// freopen("input_file_name.in","r",stdin);
	// freopen("output_file_name.out","w",stdout);

	ll i,j,k,l,m,n,x,y,z,a,b,r,t;
	// int i,j,k,l,m,n,x,y,z,a,b,r;

	slld(n);
	ll A[n];
	ll sum = 0;

	ll maxx = INT_MIN;
	for(i=0;i<n;i++){
		slld(A[i]);
		sum+=A[i];
		if(maxx < A[i]){
			maxx = A[i];
		}
	}
	ll  ans  =floor((float)sum/(n-1)+1) > maxx ? ceil((float)sum/(n-1)) : maxx;

	printf("%lld\n", ans);

	return 0;

}


#include <bits/stdc++.h>
using namespace std;

#define sd(x) 		scanf("%d",&x)
#define su(x) 		scanf("%u",&x)
#define slld(x) 	scanf("%lld",&x)
#define sc(x) 		scanf("%c",&x)
#define ss(x) 		scanf("%s",x)
#define sf(x) 		scanf("%f",&x)
#define slf(x)		scanf("%lf",&x)
#define ll 			long long int
#define mod(x,n) 	(x+n)%n
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
ll Mod = 1000000007;

int main()
{
	// auther aniket bansal //
	// freopen("input_file_name.in","r",stdin);
	// freopen("output_file_name.out","w",stdout);

	ll i,j,k,l,m,n,x,y,z,a,b,r,t;
	// int i,j,k,l,m,n,x,y,z,a,b,r;

	slld(n);
	ll A[n];
	ll sum = 0;
	for(i=0;i<n;i++){
		slld(A[i]);
		sum+=A[i];
	}
	ll  ans  =ceil((float)sum/(n-1));

	printf("%lld\n", ans);

	return 0;

}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll maxn = 5e5;

ll n, a[maxn], sum = 0, ans = 0;
int f(ll m){
    if(n * m - sum >= m)
        return 1;
    return 0;
}

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        sum += a[i];
    }
    ll l = 1, r = *max_element(a + 1, a + n + 1) * 2;
    while(r - l > 1){
        ll mid = (r + l) / 2;
        if(f(mid)){
            r = mid;
        }
        else {
            l = mid;
        }
    }
    if(f(r)){
        cout << r;
    }
    else {
        cout << l;
    }
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll maxn = 5e5;

ll n, a[maxn], sum = 0, ans = 0;
int f(ll m){
    if(n * m - sum >= m)
        return 1;
    return 0;
}

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        sum += a[i];
    }
    ll l = *max_element(a + 1, a + n + 1), r = 1e5;
    while(r - l > 1){
        ll mid = (r + l) / 2;
        if(f(mid)){
            r = mid;
        }
        else {
            l = mid;
        }
    }
    if(f(l)){
        cout << l;
    }
    else {
        cout << r;
    }
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll maxn = 5e5;
int main(){
  ll n, a[maxn];
  cin >> n;
  for(int i = 1; i <= n; i++){
  		cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  cout << a[n] + 1;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll maxn = 5e5;

ll n, a[maxn], sum = 0, ans = 0;
int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        sum += a[i];
    }
    while(sum > 0){
        sort(a + 1, a + n + 1);
        for(int i = 2 ; i <= n; i++){
            if(a[i] > 0){
                a[i]--;
                sum--;
            }
        }
        ans++;
    }
    cout << ans;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll maxn = 5e5;

ll n, a[maxn], sum = 0, ans = 0;
int f(ll m){
    if(n * m - sum >= m)
        return 1;
    return 0;
}

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        sum += a[i];
    }
    ll l = *max_element(a + 1, a + n + 1), r = 1e5;
    while(r - l > 1){
        ll mid = (r + l) / 2;
        if(f(mid)){
            r = mid;
        }
        else {
            l = mid;
        }
    }
    if(f(r)){
        cout << r;
    }
    else {
        cout << l;
    }
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll maxn = 5e5;

ll n, a[maxn], sum = 0, ans = 0;
int f(ll m){
    if(n * m - sum >= m)
        return 1;
    return 0;
}

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        sum += a[i];
    }
    ll l = *max_element(a + 1, a + n + 1), r = 2e9;
    while(r - l > 1){
        ll mid = (r + l) / 2;
        if(f(mid)){
            r = mid;
        }
        else {
            l = mid;
        }
    }
    if(f(l)){
        cout << l;
    }
    else {
        cout << r;
    }
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const ll maxn = 5e5;

ll n, a[maxn], sum = 0, ans = 0;
int f(ll m){
    if(n * m - sum >= m)
        return 1;
    return 0;
}

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        sum += a[i];
    }
    ll l = 1, r = *max_element(a + 1, a + n + 1) * 100;
    while(r - l > 1){
        ll mid = (r + l) / 2;
        if(f(mid)){
            r = mid;
        }
        else {
            l = mid;
        }
    }
    if(f(r)){
        cout << r;
    }
    else {
        cout << l;
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
		#ifndef ONLINE_JUDGE
	     freopen("input.txt", "r", stdin);
	     freopen("output.txt", "w", stdout);
	    #endif
	    ll n;
	    cin>>n;
	    ll a[n];
	    ll sum=0,temp=0;
	    for(ll i=0;i<n;i++){
	    	cin>>a[i];
	    	sum+=a[i];
	    	temp=max(temp,a[i]);
	    }
	    ll x = ceil((float)sum/(float)(n-1));
	    ll ans=max(temp,x);
	    cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
		#ifndef ONLINE_JUDGE
	     freopen("input.txt", "r", stdin);
	     freopen("output.txt", "w", stdout);
	    #endif
	    ll n;
	    cin>>n;
	    ll a[n];
	    ll sum=0;
	    for(ll i=0;i<n;i++){
	    	cin>>a[i];
	    	sum+=a[i];
	    }
	    ll ans=ceil((float)sum/(float)(n-1));
	    cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
		#ifndef ONLINE_JUDGE
	     freopen("input.txt", "r", stdin);
	     freopen("output.txt", "w", stdout);
	    #endif
	    ll n;
	    cin>>n;
	    ll a[n];
	    ll sum=0;
	    for(ll i=0;i<n;i++){
	    	cin>>a[i];
	    	sum+=a[i];
	    }
	    ll ans=ceil((float)sum/(float)(n-1));
	    ll x=*max_element(a,a+n);
	    if(ans>x)
	    cout<<ans<<endl;
		else
			cout<<sum<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
		#ifndef ONLINE_JUDGE
	     freopen("input.txt", "r", stdin);
	     freopen("output.txt", "w", stdout);
	    #endif
	    ll n;
	    cin>>n;
	    ll a[n];
	    for(ll i=0;i<n;i++)
	    	cin>>a[i];
	    ll x=*max_element(a,a+n);
	    cout<<x+1<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
		#ifndef ONLINE_JUDGE
	     freopen("input.txt", "r", stdin);
	     freopen("output.txt", "w", stdout);
	    #endif
	    ll n;
	    cin>>n;
	    ll a[n];
	    ll sum=0,temp=0;
	    for(ll i=0;i<n;i++){
	    	cin>>a[i];
	    	sum+=a[i];
	    	temp=max(temp,a[i]);
	    }
	    ll x = ((sum-1)/(n-1))+1;
	    ll ans=max(temp,x);
	    cout<<ans<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
		#ifndef ONLINE_JUDGE
	     freopen("input.txt", "r", stdin);
	     freopen("output.txt", "w", stdout);
	    #endif
	    ll n;
	    cin>>n;
	    ll a[n];
	    ll sum=0;
	    for(ll i=0;i<n;i++){
	    	cin>>a[i];
	    	sum+=a[i];
	    }
	    ll ans=ceil((float)sum/(float)(n-1));
	    ll x=*max_element(a,a+n);
	    if(ans>=x)
	    cout<<ans<<endl;
		else
			cout<<sum<<endl;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
		#ifndef ONLINE_JUDGE
	     freopen("input.txt", "r", stdin);
	     freopen("output.txt", "w", stdout);
	    #endif
	    ll n;
	    cin>>n;
	    ll a[n];
	    ll sum=0,temp=0;
	    for(ll i=0;i<n;i++){
	    	cin>>a[i];
	    	sum+=a[i];
	    	temp=max(temp,a[i]);
	    }
	    ll x = ceil((float)(sum-1)/(float)(n-1));
	    ll ans=max(temp,x);
	    cout<<ans<<endl;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main()
{int b=1,n,i=0,m,c,r=0;
scanf("%d",&n);
vector <int> a (n,0);
while (i<n) {scanf("%d",&(a[i])); i++;}
while (b!=0)
{i=1; a[0]--; m=a[0]; c=0; while (i<n) {a[i]--;
if (a[i]<m) {m=a[i]; c=i;} i++;}
a[c]++; b=a[0]; i=1;
while (i<n) {if (a[i]>b) {b=a[i];}
i++;} r++;}
printf("%d",r);
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main()
{int b,n,i=0,m,c,r=0;
cin >> n;
vector <int> a (n,0);
while (i<n) {scanf("%d",&(a[i])); i++;}
m=a[0];
while (b!=0)
{i=0; b=a[0]; while (i<n) {a[i]--;
if (a[i]<m) {m=a[i]; c=i;}
if (a[i]>b) {b=a[i];}
i++;}a[c]++; m++; r++;}
cout << r-1;
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main()
{int b,n,i=0,m,c,r=0;
cin >> n;
vector <int> a (n,0);
while (i<n) {scanf("%d",&(a[i])); i++;}
while (b!=0)
{i=0; b=a[0]; m=a[0]; c=0; a[0]++; while (i<n) {a[i]--;
if (a[i]<m) {m=a[i]; a[c]--; c=i; a[i]++;}i++;}i=0; while (i<n) {
if (a[i]>b) {b=a[i];}
i++;} r++;}
cout << r;
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main()
{int b,n,i=0,m,c,r=0;
cin >> n;
vector <int> a (n,0);
while (i<n) {scanf("%d",&(a[i])); i++;}
while (b!=0)
{i=0; while (i<n) {a[i]--; i++;} m=a[0]; c=0;
i=1; while (i<n) {if (a[i]<m) {m=a[i]; c=i;}i++;}
a[c]++; b=a[0]; i=1;
while (i<n) {if (a[i]>b) {b=a[i];}
i++;} r++;}
cout << r;
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main()
{int n,i=0,m,c,r=0;
cin >> n;
vector <int> a (n,0);
while (i<n) {scanf("%d",&(a[i])); i++;}
m=a[0];
while (m!=0)
{i=0; while (i<n) {a[i]--;
if (a[i]<m) {m=a[i]; c=i;}
i++;}a[c]++; m++; r++;}
cout << r;
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main()
{int b=1,n,i=0,m,c,r=0;
cin >> n;
vector <int> a (n,0);
while (i<n) {scanf("%d",&(a[i])); i++;}
while (b!=0)
{i=0; while (i<n) {a[i]--; i++;} m=a[0]; c=0;
i=1; while (i<n) {if (a[i]<m) {m=a[i]; c=i;}i++;}
a[c]++; b=a[0]; i=1;
while (i<n) {if (a[i]>b) {b=a[i];}
i++;} r++;}
cout << r;
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;

int main()
{int b,n,i=0,m,c,r=0;
cin >> n;
vector <int> a (n,0);
while (i<n) {scanf("%d",&(a[i])); i++;}
while (b!=0)
{i=0; b=a[0]-1; m=a[0]-1; c=0; a[0]++; while (i<n) {a[i]--;
if (a[i]<m) {m=a[i]; a[c]--; c=i; a[i]++;}i++;}i=0; while (i<n) {
if (a[i]>b) {b=a[i];}
i++;} r++;}
cout << r;
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main() {
    int n;
    scanf ("%d", &n);
    int sum = 0, mx = 0, i = 0;
    while (i < n) {
        int a;
        scanf ("%d", &a);
        sum += a;
        if (a > mx) {
            mx = a;
        }
        i++;
    }

    int ans = (sum + n - 2) / (n - 1);
    cout << max(mx, ans);
    /*
    while (b != 0) {
        i = 1;
        a[0]--;
        m = a[0];
        c = 0;
        while (i < n) {
            a[i]--;
            if (a[i] < m) {
                m = a[i];
                c = i;
            }
            i++;
        }
        a[c]++;
        b = a[0];
        i = 1;
        while (i < n) {
            if (a[i] > b) {
                b = a[i];
            }
            i++;
        }
        r++;
    }
    printf ("%d", r);*/
    return 0;
}


#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
using namespace std;

int main() {
    long long n;
    scanf ("%I64d", &n);
    long long sum = 0, mx = 0, i = 0;
    while (i < n) {
        int a;
        scanf ("%d", &a);
        sum += a;
        if (a > mx) {
            mx = a;
        }
        i++;
    }

    long long ans = (sum + n - 2) / (n - 1);
    cout << max(mx, ans);
    /*
    while (b != 0) {
        i = 1;
        a[0]--;
        m = a[0];
        c = 0;
        while (i < n) {
            a[i]--;
            if (a[i] < m) {
                m = a[i];
                c = i;
            }
            i++;
        }
        a[c]++;
        b = a[0];
        i = 1;
        while (i < n) {
            if (a[i] > b) {
                b = a[i];
            }
            i++;
        }
        r++;
    }
    printf ("%d", r);*/
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[100005],s,e,mid;
bool ok(int x)
{
    long long cnt=0;
    for(int i=1; i<n; i++)
        cnt+=max(0,x-a[i]);
    return cnt>=a[0];
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    s=0,e=1e18;
    while(s<=e){
        mid=(s+e)/2;
        if(ok(mid))
            e=mid-1;
        else
            s=mid+1;
    }
    cout<<s<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[100005],s,e,mid;
bool ok(int x)
{
    long long cnt=0;
    for(int i=1; i<n; i++)
        cnt+=max(0ll,x-a[i]);
    return cnt>=a[0];
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    s=0,e=1e18;
    while(s<=e){
        mid=(s+e)/2;
        if(ok(mid))
            e=mid-1;
        else
            s=mid+1;
    }
    cout<<s<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a[100005],s,e,mid;
bool ok(int x)
{
    int cnt=0;
    for(int i=1; i<n; i++)
        cnt+=max(0,x-a[i]);
    return cnt>=a[0];
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    s=0,e=1e9;
    while(s<=e){
        mid=(s+e)/2;
        if(ok(mid))
            e=mid-1;
        else
            s=mid+1;
    }
    cout<<s<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[100005],s,e,mid;
bool ok(long long x)
{
    long long cnt=0;
    for(int i=1; i<n; i++)
        cnt+=max(0ll,x-a[i]);
    return cnt>=a[0];
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    s=a[n-1],e=1e10;
    while(s<=e){
        mid=(s+e)/2;
        if(ok(mid))
            e=mid-1;
        else
            s=mid+1;
    }
    cout<<s<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int n,a[100005],p[100005],s,e,mid;
bool ok(int x)
{
    int cnt=0;
    for(int i=1; i<n; i++)
        cnt+=max(0,x-a[i]);
    return cnt>=a[0];
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    s=0,e=1e6;
    while(s<=e){
        mid=(s+e)/2;
        if(ok(mid))
            e=mid-1;
        else
            s=mid+1;
    }
    cout<<s<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[100005],s,e,mid;
bool ok(long long x)
{
    long long cnt=0;
    for(int i=1; i<n; i++)
        cnt+=max(0ll,x-a[i]);
    return cnt>=a[0];
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    s=0,e=1e10;
    while(s<=e){
        mid=(s+e)/2;
        if(ok(mid))
            e=mid-1;
        else
            s=mid+1;
    }
    cout<<s<<endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long n,a[100005],s,e,mid;
bool ok(long long x)
{
    long long cnt=0;
    for(int i=1; i<n; i++)
        cnt+=max(0ll,x-a[i]);
    return cnt>=a[0];
}
int main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    cin>>n;
    for(int i=0; i<n; i++)
        cin>>a[i];
    sort(a,a+n);
    s=0,e=1e18;
    while(s<=e){
        mid=(s+e)/2;
        if(ok(mid))
            e=mid-1;
        else
            s=mid+1;
    }
    cout<<s<<endl;
    return 0;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
double sum = 0,a,mx=0;
int main()
{
   int n,i;

   cin>>n;

   for(i=0;i<n;i++)
   {
       cin>>a;
       sum+=a;
       mx = max(mx,a);
   }

   if(ceil(sum/(n-1))<mx)cout<<mx<<endl;

   else
    cout<<fixed<<setprecision(0)<<ceil(sum/(n-1))<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
double n,i,j,k,sum=0,mx=0;
ll binary_Search()
{
    double l=0,r=1e18,ans;

    while(l<=r)
    {
        ll mid = (l+r)/2;

        if(sum/(n-1)<=mid&&mid>=mx)
        {
            ans = mid;
            r = mid-1;
        }

        else
        {
            l = mid+1;
        }
    }

    return ans;
}
int main()
{
    spd;
   double ans,a;
    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>a;
        mx = max(mx,a);
        sum+=a;
    }

    ans = ceil(binary_Search());
    cout<<ans<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
double n,i,j,k,sum=0;
ll binary_Search()
{
    double l=0,r=1e18,ans;

    while(l<=r)
    {
        ll mid = (l+r)/2;

        if(sum/(n-1)<=mid)
        {
            ans = mid;
            r = mid-1;
        }

        else
        {
            l = mid+1;
        }
    }

    return ans;
}
int main()
{
    spd;
   double ans,a;
    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>a;
        sum+=a;
    }

    ans = binary_Search();

   cout<<ceil(ans)<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
double n,i,j,k,sum=0,mx=0;
ll binary_Search()
{
    double l=0,r=1e18,ans;

    while(l<=r)
    {
        ll mid = (l+r)/2;

        if(sum/(n-1)<=mid&&mid>=mx)
        {
            ans = mid;
            r = mid-1;
        }

        else
        {
            l = mid+1;
        }
    }

    return ans;
}
int main()
{
    spd;
   double ans,a;
    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>a;
        mx = max(mx,a);
        sum+=a;
    }

    ans = binary_Search();

    if(ans==(int)ans)
    {
        cout<<ans<<endl;
    }
    else
        cout<<ans+1<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
double n,i,j,k,sum=0,mx=0;
ll binary_Search()
{
    double l=0,r=1e18,ans;

    while(l<=r)
    {
        ll mid = (l+r)/2;

        if(sum/(n-1)<=mid&&mid>=mx)
        {
            ans = mid;
            r = mid-1;
        }

        else
        {
            l = mid+1;
        }
    }

    return ans;
}
int main()
{
    spd;
   double ans,a;
    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>a;
        mx = max(mx,a);
        sum+=a;
    }

    ans = binary_Search();

    if(ans==(int)ans)
    {
        cout<<ans<<endl;
    }
    else
        cout<<((int)ans)+1<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
double n,i,j,k,sum=0,mx=0;
ll binary_Search()
{
    double l=0,r=1e18,ans;

    while(l<=r)
    {
        ll mid = (l+r)/2;

        if(sum/(n-1)<=mid&&mid>=mx)
        {
            ans = mid;
            r = mid-1;
        }

        else
        {
            l = mid+1;
        }
    }

    return ans;
}
int main()
{
    spd;
   double ans,a;
    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>a;
        mx = max(mx,a);
        sum+=a;
    }

    ans = binary_Search();

    if(ans==(int)ans)
    {
        cout<<ans<<endl;
    }

    else
        cout<<ceil(ans)<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
double n,i,j,k,sum=0,mx=0;
ll binary_Search()
{
    double l=0,r=1e18,ans;

    while(l<=r)
    {
        ll mid = (l+r)/2;

        if(sum/(n-1)<=mid&&mid>=mx)
        {
            ans = mid;
            r = mid-1;
        }

        else
        {
            l = mid+1;
        }
    }

    return ans;
}
int main()
{
    spd;
   double ans,a;
    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>a;
        mx = max(mx,a);
        sum+=a;
    }

    ans = binary_Search();

   cout<<ceil(ans)<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
double sum = 0,a,mx=0;
int main()
{
   int n,i;

   cin>>n;

   for(i=0;i<n;i++)
   {
       cin>>a;
       sum+=a;
       mx = max(mx,a);
   }

   if(ceil(sum/(n-1))<mx)cout<<mx<<endl;

   else
    cout<<ceil(sum/(n-1))<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
double sum = 0,a,mx=0;
int main()
{
   ll n,i;

   cin>>n;

   for(i=0;i<n;i++)
   {
       cin>>a;
       sum+=a;
       mx = max(mx,a);
   }

  cout<<(ll) max(mx,ceil(sum/(n-1)))<<endl;
}


#define ll long long
#define pii pair<ll,ll>
#define m_p  make_pair
#define ull unsigned long long
#define spd  ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+5;
double n,i,j,k,sum=0;
ll binary_Search()
{
    double l=0,r=1e18,ans;

    while(l<r)
    {
        ll mid = (l+r)/2;

        if(sum/(n-1)<=mid)
        {
            ans = mid;
            r = mid;
        }

        else
        {
            l = mid+1;
        }
    }

    return ans;
}
int main()
{
    spd;
   double ans,a;
    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>a;
        sum+=a;
    }

    ans = binary_Search();

   cout<<ceil(ans)<<endl;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int long long ans=0;
   for(i=1;i<=n;i++)
   {
    scanf("%d",&A[i]);
   ans=1LL*(ans+A[i]);
   }
   ans=(ans+n-2LL)/(n-1LL);
    printf("%lld\n",ans );
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int ans=0;
   for(i=1;i<=n;i++)
   {
    ans=max(A[i],ans)
   }
    printf("%d\n",ans+1 );
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int ans=0;
   for(i=1;i<=n;i++)
   {
   	scanf("%d",&A[i]);
    ans=max(A[i],ans)
   }
    printf("%d\n",ans+1 );
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int long long ans=0;
   for(i=1;i<=n;i++)
   {
    scanf("%d",&A[i]);
   ans=1LL*(ans+A[i]);
   }
   ans=floor(ans/(n-1));
    printf("%lld\n",ans );
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int ans=0;
   for(i=1;i<=n;i++)
   {
   	scanf("%d",&A[i]);
    ans=max(A[i],ans);
   }
    printf("%d\n",ans+1 );
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int long long ans=0;
   for(i=1;i<=n;i++)
   {
    scanf("%d",&A[i]);
   ans=1LL*(ans+A[i]);
   }
   ans=ceil(ans/(n-1));
    printf("%lld\n",ans );
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int long long ans=0;
   int long long sum=0;
   for(i=1;i<=n;i++)
   {
    scanf("%d",&A[i]);
  sum+=A[i];
   }
   ans=(sum+n-2)/(n-1);
   printf("%lld\n",ans);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int main()
{
   int n;
   scanf("%d",&n);
   int i;
   int long long ans=0;
   for(i=1;i<=n;i++)
   {
    scanf("%d",&A[i]);
   ans=1LL*(ans+A[i]);
   }
   ans=(ans+n-2)/(n-1);
    printf("%lld\n",ans );
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N=1e5+5;
int A[N];
int n;
bool check(int long long mid)
{
    int i;
    int long long s=0;
    for(i=1;i<=n;i++)
    {
        if(mid<A[i])
        {
            return 0;
        }
        s+=(mid-A[i]);
    }
    return s>=mid;
}
int main()
{
   scanf("%d",&n);
   int i;
   int long long ans=0;
   for(i=1;i<=n;i++)
   {
    scanf("%d",&A[i]);
   }
   int long long l=0,r=(1LL<<40);
   while(l<r)
   {
     int long long mid=(l+r)>>1LL;
     if(check(mid))
     {
        r=mid;
     }
     else
     {
        l=mid+1;
     }
   }
   printf("%lld\n",l );
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define ll long long
const int N = 2e5 + 7;

int n, mx;
ll sum;
int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        if (x > mx)mx = x;
        sum += x;
    }
    ll st = mx, en = 1e12, mid;
    while (st < en) {
        mid = (st + en) >> 1;
        if (mid*n - mid >= sum)
            en = mid;
        else
            st = mid + 1;
    }
    cout << en;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define ll long long
const int N = 2e5 + 7;

int n, mx;
ll sum;
int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        if (x > mx)mx = x;
        sum += x;
    }
    ll st = mx, en = 1e15, mid;
    while (st < en) {
        mid = (st + en) >> 1;
        if (1ll * mid * n - mid >= sum)
            en = mid;
        else
            st = mid + 1;
    }
    cout << en;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define ll long long
const int N = 2e5 + 7;

int n, mx;
ll sum;
int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        if (x > mx)mx = x;
        sum += x;
    }
    ll st = mx, en = 1e13, mid;
    while (st < en) {
        mid = (st + en) >> 1;
        if (mid*n - mid >= sum)
            en = mid;
        else
            st = mid + 1;
    }
    cout << en;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define ll long long
const int N = 2e5 + 7;

int n, mx;
ll sum;
int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        if (x > mx)mx = x;
        sum += x;
    }
    ll st = mx, en = 1e15, mid;
    while (st < en) {
        mid = (st + en) >> 1;
        if (mid * n - mid >= sum)
            en = mid;
        else
            st = mid + 1;
    }
    cout << en;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define ll long long
const int N = 2e5 + 7;

int n, mx;
ll sum;
int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        if (x > mx)mx = x;
        sum += x;
    }
    ll st = mx, en = 1e15, mid;
    while (st < en) {
        mid = (st + en) >> 1;
        if (1ll * n * mid - mid >= sum)
            en = mid;
        else
            st = mid + 1;
    }
    cout << en;
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define ll long long
const int N = 2e5 + 7;

int n, mx;
ll sum;
int main() {
    cin.sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x; cin >> x;
        if (x > mx)mx = x;
        sum += x;
    }
    ll st = mx, en = 1e14, mid;
    while (st < en) {
        mid = (st + en) >> 1;
        if (mid*n - mid >= sum)
            en = mid;
        else
            st = mid + 1;
    }
    cout << en;
    return 0;
}


import java.util.Scanner;

public class _348A {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long[] wantedRounds = new long[n];
		long s = 0;
		long max = 0;
		for(int i = 0; i < n; i++) {
			wantedRounds[i] = scanner.nextInt();
			s += wantedRounds[i];
			if (wantedRounds[i] > max) max = wantedRounds[i];
		}

		long avr = (s % (n - 1) ==0) ? (s / (n - 1)) : (s / (n - 1) + 1);

		System.out.println(Math.max(avr, max));

		scanner.close();
	}
}


import java.util.Scanner;

public class _348A {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long[] wantedRounds = new long[n];
        long s = 0;
        for(int i = 0; i < n; i++) {
            wantedRounds[i] = scanner.nextInt();
            s += wantedRounds[i];
        }

        System.out.println((s % (n - 1) ==0) ? (s / (n - 1)) : (s / (n - 1) + 1));

        scanner.close();
    }
}


import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Parser in = new Parser(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    int n;
    int[] a;

    boolean check(long m) {
        long pass = 0;
        for (int i = 0; i < n; i++) {
            if (a[i] > m) return false;
            pass += m-a[i];
        }

        return pass >= m;
    }

    public void solve(int testNumber, Parser in, OutputWriter out) {
        n = in.nextInt();
        a = in.readIntArray(n);

        long st = 0, end = 10000000000L;
        while (st < end) {
            long mid = (st+end)/2;
            if (check(mid)) end = mid;
            else st = mid+1;
        }

        out.println(st);
    }
}

class Parser
{
    private BufferedReader din;
    private StringTokenizer tokenizer;

    public Parser(InputStream in)
    {
        din = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(din.readLine());
            } catch (Exception e) {
                throw new UnknownError();
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt()
    {
        return Integer.parseInt(next());
    }

    public int[] readIntArray(int n)
    {
        int[] ret = new int[n];
        for (int i = 0; i < n; i++) ret[i] = nextInt();
        return ret;
    }

    }

class OutputWriter extends PrintWriter {
    public OutputWriter(Writer out) {
        super(out);
    }

    public OutputWriter(OutputStream out) {
        super(out);
    }

    }


import java.io.IOException;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.StringTokenizer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Parser in = new Parser(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskA {
    int n;
    int[] a;

    boolean check(long m) {
        long pass = 0;
        for (int i = 0; i < n; i++) {
            if (a[i] > m) return false;
            pass += m-a[i];
        }

        return pass >= m;
    }

    public void solve(int testNumber, Parser in, OutputWriter out) {
        n = in.nextInt();
        a = in.readIntArray(n);

        long st = 0, end = 1000000000000000L;
        while (st < end) {
            long mid = (st+end)/2;
            if (check(mid)) end = mid;
            else st = mid+1;
        }

        out.println(st);
    }
}

class Parser
{
    private BufferedReader din;
    private StringTokenizer tokenizer;

    public Parser(InputStream in)
    {
        din = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(din.readLine());
            } catch (Exception e) {
                throw new UnknownError();
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt()
    {
        return Integer.parseInt(next());
    }

    public int[] readIntArray(int n)
    {
        int[] ret = new int[n];
        for (int i = 0; i < n; i++) ret[i] = nextInt();
        return ret;
    }

    }

class OutputWriter extends PrintWriter {
    public OutputWriter(Writer out) {
        super(out);
    }

    public OutputWriter(OutputStream out) {
        super(out);
    }

    }


import java.util.*;
import java.math.*;

public class Main
{
	static long n;
	static long[] a = new long[100100];

	static boolean can(long x)
	{
		long have = 0;
		for(int i = 0; i < n; i ++)
		{
			if(a[i] > x)
				return false;
			have += x-a[i];
		}
		if(have >= x)
			return true;
		return false;
	}
	public static void main(String args[])
	{
		Scanner scan = new Scanner(System.in);

		n = scan.nextInt();
		long res = 0;
		for(int i = 0; i < n; i ++)
		{
			a[i] = scan.nextInt();
			res = Math.max(res, a[i]);
		}

		long L = 0;
		long R = (L+1)*(1<<30)*(1<<10);
		while(L < R)
		{
			// System.out.println( L + " " + R );
			if(L == R)
			{
				res = L;
				break;
			}
			else if(L == R-1)
			{
				if( can(L) )
					res = L;
				else
					res = R;
				break;
			}

			long mid = (L+R)/2;
			if( can(mid) )
				R = mid;
			else
				L = mid;
		}

		System.out.println( res );
	}
}


import java.io.*;
import java.util.*;

public class p348a
{
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[n+1];
        double sum = 0;
        for (int i=1; i<=n;i++)
        {
            a[i] = sc.nextInt();
            sum += a[i];
        }
        Arrays.sort(a);
        System.out.println((int) Math.max(Math.ceil(sum/(n-1)),a[n]));
    }
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int tab[] = new int[n];
        for (int i = 0; i < n; i++) {
            tab[i] = in.nextInt();
        }
        Arrays.sort(tab);
        int max = Integer.MIN_VALUE;
        for (int element : tab) {
            if(element > max) max = element;
        }
        long couldSupervise = 0;
        for (int element : tab) {
            couldSupervise += (max - element);
        }
        if(couldSupervise >= max) {
            System.out.println(max);
            return;
        }
        long rest = max - couldSupervise;
        if(n >= rest) {
            System.out.println(couldSupervise + rest + 1);
        } else {
            System.out.println(couldSupervise + (rest + ((int)Math.ceil(rest / (double) (n-1)))));
        }

    }
}


import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int tab[] = new int[n];
        for (int i = 0; i < n; i++) {
            tab[i] = in.nextInt();
        }
        Arrays.sort(tab);
        int max = Integer.MIN_VALUE;
        for (int element : tab) {
            if(element > max) max = element;
        }
        long couldSupervise = 0;
        for (int element : tab) {
            couldSupervise += (max - element);
        }
        if(couldSupervise >= max) {
            System.out.println(max);
            return;
        }
        long rest = max - couldSupervise;
        if(n > rest) {
            System.out.println(couldSupervise + rest + 1);
        } else {
            System.out.println(couldSupervise + (rest + ((int)Math.ceil(rest / (double) (n-1)))));
        }

    }
}


import static java.lang.Math.*;
import java.io.*;
import java.util.*;

public class Main {
	MyInputReader in;
	PrintWriter out;

	public void run() throws IOException {
		boolean oj = System.getProperty ("ONLINE_JUDGE") != null;
		if (oj == true) {
			in = new MyInputReader (new InputStreamReader (System.in));
		} else {
			in = new MyInputReader (new FileReader (new File ("input.txt")));
		}
		out = new PrintWriter(System.out);
		Long start = System.currentTimeMillis();
		Solver solver = new Solver ();
		solver.solve (in, out);
		//System.out.println ("Hello world");
		Long end = System.currentTimeMillis();
		if (oj == false) {
			System.out.println((end - start) / 1000.0);
		}

		out.close();
	}

	public static void main(String[] args) throws IOException {
		new Main().run();
	}
}

class Solver {
	public void solve (MyInputReader in, PrintWriter out) {
		// out.println ("Hello world");
		int n = in.nextInt();
		int a[] = new int[n];
		for (int i = 0; i < n; ++i) {
			a[i] = in.nextInt();
		}
		long ll = 0, rr = Integer.MAX_VALUE;
		while (rr - ll > 1) {
			long mm = (ll + rr) / 2;
			boolean ok = true;
			for (int i = 0; i < n; ++i) {
				if (a[i] > mm)
					ok = false;
			}
			if (!ok) {
				ll = mm;
			} else {
				long sum = 0;
				for (int i = 0; i < n; ++i) {
					sum += mm - a[i];
				}
				if (sum >= mm) {
					rr = mm;
				} else {
					ll = mm;
				}
			}
		}
		out.println (rr);
	}
}

class MyInputReader {
	BufferedReader in;
	StringTokenizer st;

	MyInputReader (InputStreamReader In) {
		this.in = new BufferedReader (In);
	}

	MyInputReader (FileReader In) {
		this.in = new BufferedReader (In);
	}

	String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(in.readLine());
			} catch (Exception e) {}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

	double nextDouble() {
		return Double.parseDouble(next());
	}
}

class Pair implements Comparable<Pair> {
	int a, b, i;
	public Pair(int a, int b, int i) {
		this.a=a;
		this.b=b;
		this.i=i;
	}

	public int compareTo(Pair o) {
		if (a != o.a) return a - o.a;
		return i - o.i;
	}
}


import static java.lang.Math.*;
import java.io.*;
import java.util.*;

public class Main {
	MyInputReader in;
	PrintWriter out;

	public void run() throws IOException {
		boolean oj = System.getProperty ("ONLINE_JUDGE") != null;
		if (oj == true) {
			in = new MyInputReader (new InputStreamReader (System.in));
		} else {
			in = new MyInputReader (new FileReader (new File ("input.txt")));
		}
		out = new PrintWriter(System.out);
		Long start = System.currentTimeMillis();
		Solver solver = new Solver ();
		solver.solve (in, out);
		//System.out.println ("Hello world");
		Long end = System.currentTimeMillis();
		if (oj == false) {
			System.out.println((end - start) / 1000.0);
		}

		out.close();
	}

	public static void main(String[] args) throws IOException {
		new Main().run();
	}
}

class Solver {
	public void solve (MyInputReader in, PrintWriter out) {
		// out.println ("Hello world");
		int n = in.nextInt();
		int a[] = new int[n];
		for (int i = 0; i < n; ++i) {
			a[i] = in.nextInt();
		}
		long ll = 0, rr = Integer.MAX_VALUE;
		while (rr - ll > 1) {
			long mm = (ll + rr) / 2;
			boolean ok = true;
			long sum = 0;
			for (int i = 0; i < n; ++i) {
				if (a[i] > mm)
					ok = false;
			}
			if (!ok) {
				rr = mm;
			} else {
				for (int i = 0; i < n; ++i) {
					sum += mm - a[i];
				}
				if (sum >= mm) {
					rr = mm;
				} else {
					ll = mm;
				}
			}
		}
		out.println (rr);
	}
}

class MyInputReader {
	BufferedReader in;
	StringTokenizer st;

	MyInputReader (InputStreamReader In) {
		this.in = new BufferedReader (In);
	}

	MyInputReader (FileReader In) {
		this.in = new BufferedReader (In);
	}

	String next() {
		while (st == null || !st.hasMoreTokens()) {
			try {
				st = new StringTokenizer(in.readLine());
			} catch (Exception e) {}
		}
		return st.nextToken();
	}

	int nextInt() {
		return Integer.parseInt(next());
	}

	long nextLong() {
		return Long.parseLong(next());
	}

	double nextDouble() {
		return Double.parseDouble(next());
	}
}

class Pair implements Comparable<Pair> {
	int a, b, i;
	public Pair(int a, int b, int i) {
		this.a=a;
		this.b=b;
		this.i=i;
	}

	public int compareTo(Pair o) {
		if (a != o.a) return a - o.a;
		return i - o.i;
	}
}


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Map;
import java.util.StringTokenizer;

import javax.print.attribute.DocAttributeSet;
import javax.print.attribute.HashDocAttributeSet;

import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {

	 public void solve(int testNumber, InputReader in, PrintWriter out) {
          int n = in.nextInt();
          int[] a = in.nextIntegerArray(n);
          Arrays.sort(a);
          long count = 0;
          while(a[0]  != 0){
        	  count++;
        	  for(int i = 1; i < n; i++)
        		  a[i]--;
             Arrays.sort(a);
             }
          long max = 0;
          for(int i = 1; i < n; i++)
    		  max = Math.max(max, a[i]);
          out.println(max+count);
	 }
}

         //||||||| comparable pair ||||||||
 class pair implements Comparable<pair>{
	 public long first,second;
	 public pair(){
		 first = second = 0;
	 }
	@Override
	public int compareTo(pair arg0) {
		if(this.first > arg0.first)
			return 1;
		else if(this.first < arg0.first)
			return -1;
		else if(this.second > arg0.second)
			return 1;
		else if(this.second < arg0.second)
		     return -1;
		return 0;
	}
 }

   // ||||||| INPUT READER ||||||||
class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public Integer nextInt() {
        return Integer.parseInt(next());
    }

    public Long nextLong() {
    	return Long.parseLong(next());
    }

    public Double nextDouble() {
    	return Double.parseDouble(next());
    }

    public Float nextFloat() {
    	return Float.parseFloat(next());
    }

    public BigInteger nextBigInteger() {
    	return new BigInteger(next());
    }

    public String nextLine() {
    	try {
			return reader.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}

    }

    public int[] nextIntegerArray(int n) {
    	int[] a = new int[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextInt();

    	return a;
    }

    public Long[] nextLongArray(int n) {
    	Long[] a = new Long[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextLong();

    	return a;
    }

    public long[] nextlongArray(int n) {
    	long[] a = new long[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextLong();

    	return a;
    }

    public double[] nextdoubleArray(int n) {
    	double[] a = new double[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextDouble();

    	return a;
    }

    public String[] nextStringArray(int n){
    	String[] s = new String[n];
    	for(int i = 0; i < n; i++)
    		s[i] = next();
    	return s;
    }

    public String[] nextLineStringArray(int n){
    	String[] s = new String[n];
    	for(int i = 0; i < n; i++)
    		s[i] = next();
    	return s;
    }

    }


import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Map;
import java.util.StringTokenizer;

import javax.print.attribute.DocAttributeSet;
import javax.print.attribute.HashDocAttributeSet;

import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskA {

	 public void solve(int testNumber, InputReader in, PrintWriter out) {
          int n = in.nextInt();
          int[] a = in.nextIntegerArray(n);
          Arrays.sort(a);
          long high = (long) (2e9+100);
          long low  = 0;
          lable:
          while(low < high-1){
        	  long mid = (low+high)/2;
        	  long need = 0;
        	  for(int i = 0; i < n; i++){
        		  need += mid-a[i];
        		  if(a[i] > mid){
        			  low = mid;
        			  continue lable;}
        	  }
        	  if(need < mid)low = mid;
        	  else high = mid;
          }
          out.println(high);
	 }
}

         //||||||| comparable pair ||||||||
 class pair implements Comparable<pair>{
	 public long first,second;
	 public pair(){
		 first = second = 0;
	 }
	@Override
	public int compareTo(pair arg0) {
		if(this.first > arg0.first)
			return 1;
		else if(this.first < arg0.first)
			return -1;
		else if(this.second > arg0.second)
			return 1;
		else if(this.second < arg0.second)
		     return -1;
		return 0;
	}
 }

   // ||||||| INPUT READER ||||||||
class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public Integer nextInt() {
        return Integer.parseInt(next());
    }

    public Long nextLong() {
    	return Long.parseLong(next());
    }

    public Double nextDouble() {
    	return Double.parseDouble(next());
    }

    public Float nextFloat() {
    	return Float.parseFloat(next());
    }

    public BigInteger nextBigInteger() {
    	return new BigInteger(next());
    }

    public String nextLine() {
    	try {
			return reader.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}

    }

    public int[] nextIntegerArray(int n) {
    	int[] a = new int[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextInt();

    	return a;
    }

    public Long[] nextLongArray(int n) {
    	Long[] a = new Long[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextLong();

    	return a;
    }

    public long[] nextlongArray(int n) {
    	long[] a = new long[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextLong();

    	return a;
    }

    public double[] nextdoubleArray(int n) {
    	double[] a = new double[n];
    	for(int i = 0; i <  n; i++)
    		a[i] = nextDouble();

    	return a;
    }

    public String[] nextStringArray(int n){
    	String[] s = new String[n];
    	for(int i = 0; i < n; i++)
    		s[i] = next();
    	return s;
    }

    public String[] nextLineStringArray(int n){
    	String[] s = new String[n];
    	for(int i = 0; i < n; i++)
    		s[i] = next();
    	return s;
    }

    }


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * TODO Put here a description of what this class does.
 *
 * @author songm. Created Oct 14, 2013.
 */
public class Main {

    /**
     * TODO Put here a description of what this method does.
     *
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub.

        Scanner scan = new Scanner(System.in);

        int input = scan.nextInt();
        ArrayList<Integer> array = new ArrayList<Integer>();

        int total = 0;
        for (int i = 0; i < input; i++) {
            int in = scan.nextInt();
            array.add(in);
            total+=in;
        }

        int count = 0;
        int min = array.get(0);
        int countMin = 1;

        Collections.sort(array);
        int temp = total/(input-1);
        if(total %2 !=0){
            temp+= 1;
        }
        System.out.println(Math.max(temp, array.get(input-1)));
//      int temp = 0;
//      while (array.get(temp) == array.get(temp + 1) && temp + 1 != input) {
//          countMin+=1;
//          temp += 1;
//      }
//
//      if(countMin - 1 >= min){
//          count = min+1;
//          if(array.get(input-1)>count){
//              count = array.get(input - 1);
//          }
//
//      }else{
//          int mini = 0;
//          while(count< array.get(countMin)){
//              mini += countMin - 1;
//              count += countMin;
//          }
//          count = array.get(input - 1);
//          count += array.get(input - 1)/countMin;
//
//      }

    }

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * TODO Put here a description of what this class does.
 *
 * @author songm. Created Oct 14, 2013.
 */
public class Mafia {

    /**
     * TODO Put here a description of what this method does.
     *
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub.

        Scanner scan = new Scanner(System.in);

        int input = scan.nextInt();
        ArrayList<Integer> array = new ArrayList<Integer>();

        long total = 0;

        for (int i = 0; i < input; i++) {
            int in = scan.nextInt();
            array.add(in);
            total += in;
        }

        int max = Collections.max(array);

        int ret = (int) Math.max(max, (total - 1)
                / (input - 1) + 1);

        System.out.println(ret);
    }

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * TODO Put here a description of what this class does.
 *
 * @author songm. Created Oct 14, 2013.
 */
public class Main {

    /**
     * TODO Put here a description of what this method does.
     *
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub.

        Scanner scan = new Scanner(System.in);

        int input = scan.nextInt();
        ArrayList<Integer> array = new ArrayList<Integer>();

        int total = 0;
        for (int i = 0; i < input; i++) {
            int in = scan.nextInt();
            array.add(in);
            total+=in;
        }

        int count = 0;
        int min = array.get(0);
        int countMin = 1;

        Collections.sort(array);
        if(total %2 !=0){
            total+= 1;
        }
        System.out.println(Math.max((int)total/(input-1), array.get(input-1)));
//      int temp = 0;
//      while (array.get(temp) == array.get(temp + 1) && temp + 1 != input) {
//          countMin+=1;
//          temp += 1;
//      }
//
//      if(countMin - 1 >= min){
//          count = min+1;
//          if(array.get(input-1)>count){
//              count = array.get(input - 1);
//          }
//
//      }else{
//          int mini = 0;
//          while(count< array.get(countMin)){
//              mini += countMin - 1;
//              count += countMin;
//          }
//          count = array.get(input - 1);
//          count += array.get(input - 1)/countMin;
//
//      }

    }

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

/**
 * TODO Put here a description of what this class does.
 *
 * @author songm. Created Oct 14, 2013.
 */
public class Main {

    /**
     * TODO Put here a description of what this method does.
     *
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub.

        Scanner scan = new Scanner(System.in);

        int input = scan.nextInt();
        ArrayList<Integer> array = new ArrayList<Integer>();

        long total = 0;

        for (int i = 0; i < input; i++) {
            int in = scan.nextInt();
            array.add(in);
            total += in;
        }

        Collections.sort(array);

        int ret = (int) Math.max(array.get(input - 1), (total - 1)
                / (input - 1) + 1);

        System.out.println(ret);
    }

}


import java.io.*;
import java.math.*;
import java.util.*;

public class Program {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;

    static final int MOD = 1000000007;
    static final double INF = 10000000000.0;

 	void solve() throws IOException {
 		int n, max = 0;
 		n = nextInt();
 		long sum = 0;

 		for(int i = 0; i < n; i++)
 		{
 			int a = nextInt();
 			max = Math.max(max, a);
 			sum += a;
 		}
 		long x = (sum + n - 2) / (n-1);
 		if (x >= max)
 			out.println(x);
 		else
 			out.println(max);
    }

    Program() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new Program();
    }

    String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }

    String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    class Pair implements Comparable<Pair>{

        char first;
        int second;

        public Pair(char an1, int an2){
            first = an1;
            second = an2;
        }

        @Override
        public int compareTo(Pair o) {
            if (first - o.first == 0)
            	return second - o.second;
            else
            	return first - o.first;
        }
    }
}


import java.util.Scanner;

public class mafia {

	public static int n;
	public static int[]a;

	public static boolean check(long mid){
		long temp =0 ;
		for(int i=0 ; i<n ; i++){
			temp += mid - a[i];
		}
		return(temp >= mid);
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);

		n = input.nextInt();
		a = new int[n];
		long hi = 0;
		long low =0;
		for(int i=0 ; i<n ; i++){
			a[i] = input.nextInt();
			hi += a[i];
			low = Math.max(low, a[i]);
		}

		while(low < hi){
			long mid = low + (hi - low)/2;
			 if(check(mid)){
				 hi = mid;
			 }else{
				 low = mid+1;
			 }
		}
		System.out.println(low);
		input.close();
	}

}


package mafia;

import java.util.Scanner;

public class mafia {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);

		int n = input.nextInt();
		int[] a = new int[n];
		int min = (int) Math.pow(10, 9);
		int minIndex=0;
		for(int i=0 ; i<n ; i++){
			a[i] = input.nextInt();
			if(a[i] <= min ){
				min = a[i];
				minIndex = i;
			}
		}

		int counter = 0;
		int max = 0;
		int j=0;
		int k;
		while(min > 0){
			k = minIndex;
			max = 0;
			for(int i=0 ; i<n ; i++){
				if(i != k ){
					a[i]--;
				}
				if(a[i] < min ){
					min = a[i];
					minIndex = i;
				}
				if(a[i] > max ){
					max = a[i];
					j = i;
				}

			}
			counter++;
		}
		if(min==0){
			counter += a[j];
		}
		 System.out.println(counter);
		input.close();
	}

}


import java.util.Scanner;

public class mafia {

	public static int n;
	public static int[]a;

	public static boolean check(int mid){
		int temp =0 ;
		for(int i=0 ; i<n ; i++){
			temp += mid - a[i];
		}
		return(temp >= mid);
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);

		n = input.nextInt();
		a = new int[n];
		int hi = 0;
		int low =0;
		for(int i=0 ; i<n ; i++){
			a[i] = input.nextInt();
			hi += a[i];
			low = Math.max(low, a[i]);
		}

		while(low < hi){
			int mid = low + (hi - low)/2;
			 if(check(mid)){
				 hi = mid;
			 }else{
				 low = mid+1;
			 }
		}
		System.out.println(low);
		input.close();
	}

}


import java.util.Scanner;

public class mafia {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner input = new Scanner(System.in);

		int n = input.nextInt();
		int[] a = new int[n];
		int min = (int) Math.pow(10, 9);
		int minIndex=0;
		for(int i=0 ; i<n ; i++){
			a[i] = input.nextInt();
			if(a[i] <= min ){
				min = a[i];
				minIndex = i;
			}
		}

		int counter = 0;
		int max = 0;
		int j=0;
		int k;
		while(min > 0){
			k = minIndex;
			max = 0;
			for(int i=0 ; i<n ; i++){
				if(i != k ){
					a[i]--;
				}
				if(a[i] < min ){
					min = a[i];
					minIndex = i;
				}
				if(a[i] > max ){
					max = a[i];
					j = i;
				}

			}
			counter++;
		}
		if(min==0){
			counter += a[j];
		}
		 System.out.println(counter);
		input.close();
	}

}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class A
{
	public static void main(String [] args) throws IOException
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		long [] want = new long[n];
		StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
		for(int i = 0 ; i < n ; i++)
			want[i] = Integer.parseInt(tokenizer.nextToken());

		Arrays.sort(want);
		for(int i = 0 ; i < n/2 ; i++)
		{
			long t = want[i];
			want[i] = want[n-i-1];
			want[n-i-1] = t;
		}

		long sum = 0;
		for(int i = 1 ; i < n ; i++)
			sum += want[i];

		long max = want[0]*(n-2);
		long res = want[0];
		if(max < sum)
		{
			res++;
		}

		System.out.println(res);
	}

}


import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class A
{
	public static void main(String [] args) throws IOException
	{
		BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		long [] want = new long[n];
		StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
		for(int i = 0 ; i < n ; i++)
			want[i] = Integer.parseInt(tokenizer.nextToken());

		Arrays.sort(want);
		for(int i = 0 ; i < n/2 ; i++)
		{
			long t = want[i];
			want[i] = want[n-i-1];
			want[n-i-1] = t;
		}

		long sum = 0;
		for(int i = 1 ; i < n ; i++)
			sum += want[i];

		long max = want[0]*(n-2);
		long res = want[0];
		if(max < sum)
		{
			res+=(sum-max+n-2)/(n-1);
		}

		System.out.println(res);
	}

}


import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long n = s.nextLong();
		long a = 0;
		long max = 0;
		long sum = 0;
		for (int i=0;i<n;i++) {
			a = s.nextLong();
			sum += a;
			if (a>max) max=a;
		}
		long ans = sum/(n-1) + (sum%(n-1) != 0 ? 1 : 0);
		if (max>ans) ans=max;
		System.out.print(ans);
		s.close();
	}

}


import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long n = s.nextLong();
		long a = 0;
		long max = 0;
		long sum = 0;
		for (int i=0;i<n;i++) {
			a = s.nextLong();
			sum += s.nextLong();
			if (a>max) max=a;
		}
		long ans = sum/(n-1) + (sum%(n-1) != 0 ? 1 : 0);
		if (a>ans) ans=a;
		System.out.print(ans);
		s.close();
	}

}


import java.util.Scanner;

public class A {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		long n = s.nextLong();
		long sum = 0;
		for (int i=0;i<n;i++)
			sum += s.nextLong();
		long ans = sum/(n-1) + (sum%(n-1) != 0 ? 1 : 0);
		System.out.print(ans);
		s.close();
	}

}


import java.util.*;

/**
 * Author: Sergei Jakovlev
 * Date: 4.10.13
 * Time: 18:38
 */
public class Mafia {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n_i;
        HashMap<Integer, Integer> wish = new HashMap<Integer, Integer>(n);
        int max = 0;
        int min = Integer.MAX_VALUE;
        for(int i = 0; i < n; i++){
            n_i = sc.nextInt();
            if(n_i > max){
                max = n_i;
            }
            if(n_i < min){
                min = n_i;
            }
            if(wish.containsKey(n_i)) {
                wish.put(n_i, wish.get(n_i) + 1);
            } else {
                wish.put(n_i, 1);
            }
        }

        if(min > 1) {
            wish.put(min, wish.get(min) - 1);
        } else {
            wish.remove(min);
        }

        int total_displ = 0;
        Set<Integer> k = wish.keySet();
        Iterator<Integer> it = k.iterator();
        Integer cur;
        while(it.hasNext()) {
            cur = it.next();
            total_displ += (max - cur) * wish.get(cur);
        }
        int left = min - total_displ;
        if(left <= 0){
            System.out.println(max);
        } else {
            int num = left/(n-1);
            if (left % (n-1) != 0) {
                num++;
            }
            System.out.println(max + num);
        }
    }
}


import java.util.*;

/**
 * Author: Sergei Jakovlev
 * Date: 4.10.13
 * Time: 18:38
 */
public class Mafia {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n_i;
        HashMap<Integer, Integer> wish = new HashMap<Integer, Integer>(n);
        int max = 0;
        int min = Integer.MAX_VALUE;
        for(int i = 0; i < n; i++){
            n_i = sc.nextInt();
            if(n_i > max){
                max = n_i;
            }
            if(n_i < min){
                min = n_i;
            }
            if(wish.containsKey(n_i)) {
                wish.put(n_i, wish.get(n_i) + 1);
            } else {
                wish.put(n_i, 1);
            }
        }

        if(min > 1) {
            wish.put(min, wish.get(min) - 1);
        } else {
            wish.remove(min);
        }

        int total_displ = 0;
        Set<Integer> k = wish.keySet();
        Iterator<Integer> it = k.iterator();
        Integer cur;
        while(it.hasNext()) {
            cur = it.next();
            total_displ += (max - cur) * wish.get(cur);
            if(min <= total_displ){
                break;
            }
        }
        int left = min - total_displ;
        if(left <= 0){
            System.out.println(max);
        } else {
            int num = left/(n-1);
            if (left % (n-1) != 0) {
                num++;
            }
            System.out.println(max + num);
        }
    }
}


import java.util.*;

/**
 * Author: Sergei Jakovlev
 * Date: 4.10.13
 * Time: 18:38
 */
public class Mafia {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n_i;
        HashMap<Integer, Integer> wish = new HashMap<Integer, Integer>(n);
        int max = 0;
        int min = Integer.MAX_VALUE;
        for(int i = 0; i < n; i++){
            n_i = sc.nextInt();
            if(n_i > max){
                max = n_i;
            }
            if(n_i < min){
                min = n_i;
            }
            if(wish.containsKey(n_i)) {
                wish.put(n_i, wish.get(n_i) + 1);
            } else {
                wish.put(n_i, 1);
            }
        }

        if(wish.get(min) > 1) {
            wish.put(min, wish.get(min) - 1);
        } else {
            wish.remove(min);
        }

        int total_displ = 0;
        Set<Integer> k = wish.keySet();
        Iterator<Integer> it = k.iterator();
        Integer cur;
        while(it.hasNext()) {
            cur = it.next();

            if(Integer.MAX_VALUE / wish.get(cur) > max - cur) {
                total_displ = min;
                break;
            } else {
                total_displ += (max - cur) * wish.get(cur);
            }
            if(min <= total_displ){
                break;
            }
        }
        int left = min - total_displ;
        if(left <= 0){
            System.out.println(max);
        } else {
            int num = left/(n-1);
            if (left % (n-1) != 0) {
                num++;
            }
            System.out.println(max + num);
        }
    }
}


import java.util.*;

/**
 * Author: Sergei Jakovlev
 * Date: 4.10.13
 * Time: 18:38
 */
public class Mafia {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n_i;
        HashMap<Integer, Integer> wish = new HashMap<Integer, Integer>(n);
        int max = 0;
        int min = Integer.MAX_VALUE;
        for(int i = 0; i < n; i++){
            n_i = sc.nextInt();
            if(n_i > max){
                max = n_i;
            }
            if(n_i < min){
                min = n_i;
            }
            if(wish.containsKey(n_i)) {
                wish.put(n_i, wish.get(n_i) + 1);
            } else {
                wish.put(n_i, 1);
            }
        }

        if(wish.get(min) > 1) {
            wish.put(min, wish.get(min) - 1);
        } else {
            wish.remove(min);
        }

        int total_displ = 0;
        Set<Integer> k = wish.keySet();
        Iterator<Integer> it = k.iterator();
        Integer cur;
        while(it.hasNext()) {
            cur = it.next();
            total_displ += (max - cur) * wish.get(cur);
            if(min <= total_displ){
                break;
            }
        }
        int left = min - total_displ;
        if(left <= 0){
            System.out.println(max);
        } else {
            int num = left/(n-1);
            if (left % (n-1) != 0) {
                num++;
            }
            System.out.println(max + num);
        }
    }
}


import java.util.*;

/**
 * Author: Sergei Jakovlev
 * Date: 4.10.13
 * Time: 18:38
 */
public class Mafia {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n_i;
        HashMap<Integer, Integer> wish = new HashMap<Integer, Integer>(n);
        int max = 0;
        int min = Integer.MAX_VALUE;
        for(int i = 0; i < n; i++){
            n_i = sc.nextInt();
            if(n_i > max){
                max = n_i;
            }
            if(n_i < min){
                min = n_i;
            }
            if(wish.containsKey(n_i)) {
                wish.put(n_i, wish.get(n_i) + 1);
            } else {
                wish.put(n_i, 1);
            }
        }

        if(wish.get(min) > 1) {
            wish.put(min, wish.get(min) - 1);
        } else {
            wish.remove(min);
        }

        int total_displ = 0;
        Set<Integer> k = wish.keySet();
        Iterator<Integer> it = k.iterator();
        Integer cur;
        while(it.hasNext()) {
            cur = it.next();

            if(Integer.MAX_VALUE / wish.get(cur) < max - cur) {
                total_displ = min;
                break;
            } else {
                total_displ += (max - cur) * wish.get(cur);
            }
            if(min <= total_displ){
                break;
            }
        }
        int left = min - total_displ;
        if(left <= 0){
            System.out.println(max);
        } else {
            int num = left/(n-1);
            if (left % (n-1) != 0) {
                num++;
            }
            System.out.println(max + num);
        }
    }
}


import static java.util.Arrays.deepToString;

import java.io.*;
import java.math.*;
import java.util.*;

public class Main {

    static void solve() {
        int n = nextInt();
        int[] a = new int[n];
        long sum = 0;
        for (int i = 0; i < a.length; i++) {
            a[i] = nextInt();
            sum += a[i];
        }
        Arrays.sort(a);
        long count = a[n-1];
        while (count * (n-1) < sum) {
            count++;
        }
        writer.println(count);
    }

    public static void main(String[] args) throws Exception {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(System.out);

        setTime();
        solve();
        printTime();
        printMemory();

        writer.close();
    }

    static BufferedReader reader;
    static PrintWriter writer;
    static StringTokenizer tok = new StringTokenizer("");
    static long systemTime;

    static void debug(Object... o) {
        System.err.println(deepToString(o));
    }

    static void setTime() {
        systemTime = System.currentTimeMillis();
    }

    static void printTime() {
        System.err.println("Time consumed: "
                + (System.currentTimeMillis() - systemTime));
    }

    static void printMemory() {
        System.err.println("Memory consumed: "
                + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime()
                        .freeMemory()) / 1000 + "kb");
    }

    static String next() {
        while (!tok.hasMoreTokens()) {
            String w = null;
            try {
                w = reader.readLine();
            } catch (Exception e) {
                e.printStackTrace();
            }
            if (w == null)
                return null;
            tok = new StringTokenizer(w);
        }
        return tok.nextToken();
    }

    static int nextInt() {
        return Integer.parseInt(next());
    }

    static long nextLong() {
        return Long.parseLong(next());
    }

    static double nextDouble() {
        return Double.parseDouble(next());
    }

    static BigInteger nextBigInteger() {
        return new BigInteger(next());
    }
}


import static java.lang.System.in;
import static java.lang.System.out;

import java.io.*;
import java.util.*;

public class A349 {
	static final double EPS = 1e-10;
	static final double INF = 1 << 31;
	static final double PI = Math.PI;

	public static Scanner sc = new Scanner(in);
	StringBuilder sb = new StringBuilder();
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public void run() throws IOException {
		String input;
		String[] inputArray;
		input = br.readLine();
		inputArray = input.split(" ");
		long n = Long.valueOf(inputArray[0]);
		input = br.readLine();
		inputArray = input.split(" ");
		long ans =0;
		long max = 0;
		for (int i=0; i<n; i++){
			ans += Long.valueOf(inputArray[i]);
			max = Math.max(max, Long.valueOf(inputArray[i]));
		}
		ans = (ans +n-2)/(n-1);
		ans = Math.max(max, ans);
		sb.append(ans);
		ln(sb);
	}

	public static void main(String[] args) throws IOException {
		new A349().run();
	}
	public static void ln(Object obj) {
		out.println(obj);
	}
}


import static java.lang.System.in;
import static java.lang.System.out;

import java.io.*;
import java.util.*;

public class A349 {
	static final double EPS = 1e-10;
	static final double INF = 1 << 31;
	static final double PI = Math.PI;

	public static Scanner sc = new Scanner(in);
	StringBuilder sb = new StringBuilder();
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public void run() throws IOException {
		String input;
		String[] inputArray;
		input = br.readLine();
		inputArray = input.split(" ");
		long n = Long.valueOf(inputArray[0]);
		input = br.readLine();
		inputArray = input.split(" ");
		long ans =0;
		for (int i=0; i<n; i++)
			ans += Long.valueOf(inputArray[i]);
		ans = (ans +n-2)/(n-1);
		sb.append(ans);
		ln(sb);
	}

	public static void main(String[] args) throws IOException {
		new A349().run();
	}
	public static void ln(Object obj) {
		out.println(obj);
	}
}


import java.util.Scanner;

public class Mafia {

    public static int calcNumRounds(int[] a) {
        int max = 0;
        boolean flag = false;
        for (int i = 0; i < a.length; i++) {
            if (a[i] > max) {max = a[i];}
            if (a[i] == 0) {flag = true;}
        }
        if (flag) {return max;}

        int rounds = max;
        while (true) {
            int sum = 0;
            for (int i = 0; i < a.length; i++) {
                sum += rounds - a[i];
            }
            if (sum >= a.length) {return rounds;}
            rounds++;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int numPlayers = in.nextInt();
        int[] a = new int[numPlayers];

        for (int i = 0; i < numPlayers; i++) {
            a[i] = in.nextInt();
        }
        in.close();
        System.out.println(calcNumRounds(a));
    }
}


import java.util.Scanner;

public class Mafia {

    public static long calcNumRounds(int[] a) {
        long sum = 0;
        long max = 0;
        for (int i = 0; i < a.length; i++) {
            if (a[i] > max) {max = a[i];}
            sum += a[i];
        }

        long rounds = max;
        while (true) {
            if (rounds * a.length >= rounds + sum) {return rounds;}
            rounds++;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int numPlayers = in.nextInt();
        int[] a = new int[numPlayers];

        for (int i = 0; i < numPlayers; i++) {
            a[i] = in.nextInt();
        }
        in.close();
        System.out.println(calcNumRounds(a));
    }
}


import java.util.Scanner;

public class Mafia {

    public static int calcNumRounds(int numPlayers, long sum, int max) {
        int rounds = max;
        while (true) {
            if (rounds * numPlayers - sum >= rounds) {return rounds;}
            rounds++;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int numPlayers = in.nextInt();
        int max = 0;
        long sum = 0;

        for (int i = 0; i < numPlayers; i++) {
            int next = in.nextInt();
            sum += next;
            if (next > max) {max = next;}
        }
        in.close();
        System.out.println(calcNumRounds(numPlayers, sum, max));
    }
}


import java.util.Scanner;

public class Mafia {

    public static int calcNumRounds(int[] a) {
        int rounds = 0;
        while (true) {
            int sum = 0;
            for (int i = 0; i < a.length; i++) {
                sum = rounds - a[i];
            }
            if (sum >= a.length) {return sum;}
            rounds++;
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int numPlayers = in.nextInt();
        int[] a = new int[numPlayers];

        for (int i = 0; i < numPlayers; i++) {
            a[i] = in.nextInt();
        }
        in.close();
        System.out.println(calcNumRounds(a));
    }
}


#include <bits/stdc++.h>

#define IO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define f first
#define s second
#define pb push_back
#define all(a) a.begin(), a.end()
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
typedef unsigned long long ull;

template<typename T1, typename T2> inline void chkmax(T1 & x, T2 y) {if (x < y) x = y;}
template<typename T1, typename T2> inline void chkmin(T1 & x, T2 y) {if (x > y) x = y;}

const int MAXN = 1e5 + 1, BLOCK = 300, CBLOCKS = MAXN / BLOCK + 10;
ll a[MAXN];
ll lb[CBLOCKS], rb[CBLOCKS], numblock[MAXN], mblock[CBLOCKS][BLOCK];
ll sumdist[CBLOCKS][BLOCK];
pair<ll, ll> blockdist[CBLOCKS][BLOCK];
ll n, cblock;

void init() {
    lb[0] = 0;
    cblock = 0;
    int cur = 0;
    for (int i = 0; i < n; ++i) {
        ++cur;
        numblock[i] = cblock;
        if (cur > 1)
            mblock[cblock][cur - 1] = mblock[cblock][cur - 2];
        chkmax(mblock[cblock][cur - 1], a[i]);
        if (cur == BLOCK) {
            rb[cblock++] = i;
            cur = 0;
            lb[cblock] = i + 1;
        }
    }
    if (cur) rb[cblock++] = n - 1;
    for (int cur = 0; cur < cblock; ++cur) {
        for (int i = lb[cur]; i <= rb[cur]; ++i) {
            int cdist = 1, covered = mblock[cur][i - lb[cur]], mx = covered;
            for (int j = i + 1; j <= rb[cur]; ++j) {
                if (j > covered) {
                    ++cdist;
                    covered = mx;
                }
                sumdist[cur][i - lb[cur]] += cdist;
                chkmax(mx, a[j]);
            }
            blockdist[cur][i - lb[cur]] = {cdist, covered};
        }
    }
}

ll get(int num) {
    ll res = 0;
    int cur = numblock[num];
    // counting for this block
    ll cdist = 1, covered = a[num], mx = a[num];
    for (int j = num + 1; j <= rb[cur]; ++j) {
        if (j > covered) {
            ++cdist;
            covered = mx;
        }
        res += cdist;
        chkmax(mx, a[j]);
    }
    if (covered < rb[cur]) cout << 1 / 0;
    if (covered == rb[cur]) {
        ++cdist;
        covered = mx;
    }
    // cout << num << ' ' << res << endl;
    for (++cur; cur < cblock; ++cur) {
        // cout << '!' << cur << ' ' << cdist << endl;
        res += 1ll * cdist * (rb[cur] - lb[cur] + 1);
        if (rb[cur] > covered) {
            if (mblock[cur][covered - lb[cur]] >= mx) {
                res += sumdist[cur][covered - lb[cur]];
                cdist += blockdist[cur][covered - lb[cur]].f;
                covered = blockdist[cur][covered - lb[cur]].s;
            }
            else {
                ++cdist;
                res += min(rb[cur], 1ll * mx) - covered;
                covered = mx;
                if (rb[cur] > covered) {
                    res += sumdist[cur][covered - lb[cur]];
                    cdist += blockdist[cur][covered - lb[cur]].f;
                    covered = blockdist[cur][covered - lb[cur]].s;
                }
            }
        }
        chkmax(mx, mblock[cur][rb[cur] - lb[cur]]);
        if (covered < rb[cur]) cout << 1 / 0;
        if (covered == rb[cur]) {
            ++cdist;
            covered = mx;
        }
    }
    // cout << num << ' ' << res << endl << endl;
    return res;
}

ll solve_stupid(int n) {
    ll res = 0;
    for (int i = 0; i < n; ++i) {
        int mx = a[i], covered = a[i], dist = 1;
        for (int j = i + 1; j < n; ++j) {
            if (j > covered) {
                ++dist;
                covered = mx;
            }
            res += dist;
            chkmax(mx, a[i]);
        }
    }
    return res;
}

int main() {
    IO;
    // freopen("input.txt", "r", stdin);
    cin >> n;
    for (int i = 0; i < n - 1; ++i)
        cin >> a[i], --a[i];
    a[n - 1] = n - 1;
    // init();
    // for (int i = 0; i < n; ++i)
    //     cout << sumdist[numblock[i]][i - lb[numblock[i]]] << ' ';
    // ll ans = 0;
    // for (int i = 0; i < n; ++i) ans += get(i);
    cout << solve_stupid(n);
    return 0;
}


#include <bits/stdc++.h>

#define IO ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)
#define f first
#define s second
#define pb push_back
#define all(a) a.begin(), a.end()
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
typedef unsigned long long ull;

template<typename T1, typename T2> inline void chkmax(T1 & x, T2 y) {if (x < y) x = y;}
template<typename T1, typename T2> inline void chkmin(T1 & x, T2 y) {if (x > y) x = y;}

const int MAXN = 1e5 + 1, BLOCK = 300, CBLOCKS = MAXN / BLOCK + 10;
ll a[MAXN];
ll lb[CBLOCKS], rb[CBLOCKS], numblock[MAXN], mblock[CBLOCKS];
ll sumdist[CBLOCKS][BLOCK];
pair<ll, ll> blockdist[CBLOCKS][BLOCK];
ll n, cblock;

void init() {
    lb[0] = 0;
    cblock = 0;
    int cur = 0;
    for (int i = 0; i < n; ++i) {
        ++cur;
        numblock[i] = cblock;
        chkmax(mblock[cblock], a[i]);
        if (cur == BLOCK) {
            rb[cblock++] = i;
            cur = 0;
            lb[cblock] = i + 1;
        }
    }
    if (cur) rb[cblock++] = n - 1;
    for (int cur = 0; cur < cblock; ++cur) {
        int mx1 = 0;
        for (int i = lb[cur]; i <= rb[cur]; ++i) {
            chkmax(mx1, a[i]);
            int cdist = 1, covered = mx1, mx = mx1;
            for (int j = i + 1; j <= rb[cur]; ++j) {
                if (j > covered) {
                    ++cdist;
                    covered = mx;
                }
                sumdist[cur][i - lb[cur]] += cdist;
                chkmax(mx, a[j]);
            }
            blockdist[cur][i - lb[cur]] = {cdist, covered};
        }
    }
}

ll get(int num) {
    ll res = 0;
    int cur = numblock[num];
    // counting for this block
    int cdist = 1, covered = a[num], mx = a[num];
    for (int j = num + 1; j <= rb[cur]; ++j) {
        if (j > covered) {
            ++cdist;
            covered = mx;
        }
        res += cdist;
        chkmax(mx, a[j]);
    }
    if (covered <= rb[cur]) {
        ++cdist;
        covered = mx;
    }
    // cout << num << ' ' << res << endl;
    for (++cur; cur < cblock; ++cur) {
        // cout << '!' << cur << ' ' << cdist << endl;
        if (rb[cur] > covered) {
            res += 1ll * cdist * (covered - lb[cur] + 1);
            res += sumdist[cur][covered - lb[cur]];
            cdist += blockdist[cur][covered - lb[cur]].f;
            covered = blockdist[cur][covered - lb[cur]].s;
        }
        else
            res += 1ll * cdist * (rb[cur] - lb[cur] + 1);
        chkmax(mx, mblock[cur]);
        if (covered <= rb[cur]) {
            ++cdist;
            covered = mx;
        }
    }
    // cout << num << ' ' << res << endl << endl;
    return res;
}

int main() {
    IO;
    // freopen("input.txt", "r", stdin);
    cin >> n;
    for (int i = 0; i < n - 1; ++i)
        cin >> a[i], --a[i];
    a[n - 1] = n - 1;
    init();
    // for (int i = 0; i < n; ++i)
    //     cout << sumdist[numblock[i]][i - lb[numblock[i]]] << ' ';
    ll ans = 0;
    for (int i = 0; i < n; ++i) ans += get(i);
    cout << ans;
    return 0;
}