# include <cstdio>
# include <fstream>
using namespace std;

int n, vec[1010], i;

int ok ( long long nr){
	int i;
	 long long d = nr;
	for (i = 1; i <= n; ++i){
		d = d - ( (d + 1) / 2 + vec[i]);
	}
	if (d == 0) return 1;
	return 0;
}

int ok2 ( long long nr){
	int i;
	 long long d = nr;
	for (i = 1; i <= n; ++i){
		d = d - ( d / 2 + vec[i]);
	}
	if (d == 0) return 1;
	if (d > 0) return 2;
	return 0;
}

 long long bs1 (){
	long long st = 1, dr = (1LL << 62), ret = 0;
	while (st <= dr){
		 long long m = (st + dr) >> 1;
		if (ok (m)){
			ret = m;
			st = m + 1;
		}
		else dr = m - 1;
	}
	return ret;
}

 long long bs2 (){
	 long long st = 1, dr = (1LL << 62), ret = 0;
	while (st <= dr){
		 long long m = (st + dr) >> 1;
		int val = ok2 (m);
		if (val == 1){
			ret = m;
			dr = m - 1;
		}
		else{
			if (val == 2) dr = m - 1;
			else st = m + 1;
		}
	}
	return ret;
}
int main (){
	freopen ("cos.in", "r", stdin);
	ofstream g ("cos.out");
	
	scanf ("%d", &n);
	for (i = 1; i <= n; ++i){
		scanf ("%d", &vec[i]);
	}
	
	g << bs1 () << '\n' << bs2 () << '\n';
	
	g.close ();
	return 0;
}
