Awruk is taking part in elections in his school. It is the final round. He has only one opponent — Elodreip. The are $n$ students in the school. Each student has exactly $k$ votes and is obligated to use all of them. So Awruk knows that if a person gives $a_i$ votes for Elodreip, than he will get exactly $k - a_i$ votes from this person. Of course $0 \le k - a_i$ holds.

Awruk knows that if he loses his life is over. He has been speaking a lot with his friends and now he knows $a_1, a_2, \dots, a_n$ — how many votes for Elodreip each student wants to give. Now he wants to change the number $k$ to win the elections. Of course he knows that bigger $k$ means bigger chance that somebody may notice that he has changed something and then he will be disqualified.

So, Awruk knows $a_1, a_2, \dots, a_n$ — how many votes each student will give to his opponent. Help him select the smallest winning number $k$. In order to win, Awruk needs to get strictly more votes than Elodreip.


-----Input-----

The first line contains integer $n$ ($1 \le n \le 100$) — the number of students in the school.

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \leq a_i \leq 100$) — the number of votes each student gives to Elodreip.


-----Output-----

Output the smallest integer $k$ ($k \ge \max a_i$) which gives Awruk the victory. In order to win, Awruk needs to get strictly more votes than Elodreip.


-----Examples-----
Input
5
1 1 1 5 1

Output
5
Input
5
2 2 3 2 2

Output
5


-----Note-----

In the first example, Elodreip gets $1 + 1 + 1 + 5 + 1 = 9$ votes. The smallest possible $k$ is $5$ (it surely can't be less due to the fourth person), and it leads to $4 + 4 + 4 + 0 + 4 = 16$ votes for Awruk, which is enough to win.

In the second example, Elodreip gets $11$ votes. If $k = 4$, Awruk gets $9$ votes and loses to Elodreip.

Source: codeforces | Difficulty: EASY
Tags: Mathematics

Implementation


Solutions:
n = int(input())
a = list(map(int, input().split()))
mayor = max(a)
el = sum(a)
while mayor > 0:
	total = 0
	for i in range(len(a)):
		aux = a[i]
		aux = mayor - aux
		total = total + aux
	if total > el:
		print(mayor)
		break
	else:
		mayor = mayor + 1


n = input()
a = list(map(int, input().split()))
e = max(a)
b = []
c = e * 2 + 1
for i in range(len(a)):
	b.append(e - a[i])
while e <= c:
	if sum(b) > sum(a):
		print(e)
		break
	else:
		for j in range(len(b)):
			b[j] += 1
		e += 1


n = int(input())
elodreip = [int(x) for x in input().split()]
k = max(elodreip)
awruk = [k - x for x in elodreip]
if sum(awruk) > sum(elodreip):
	print(k)
else:
	while sum(awruk) <= sum(elodreip):
		k += 1
		awruk = [k - x for x in elodreip]
	print(k)


n = int(input())
li = list(map(int, input().split()))
k = max(li)
t = [k - i for i in li]
while sum(li) >= sum(t):
	k = k + 1
	t = [k - i for i in li]
print(k)


n = int(input())
L = list(map(int, input().split()))
s = sum(L)
F = []
for k in range(max(L), sum(L) * 10):
	for j in range(n):
		F.append(k - L[j])
	if sum(F) > s:
		print(k)
		break
	else:
		F = []


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
m = max(a)
while True:
	if n * m - s > s:
		print(m)
		break
	else:
		m += 1


N = int(input())
Lll = list(map(int, input().split()))
Lll.sort()
maxx = Lll[N - 1]
tot = maxx * N
s = 0
for i in range(N):
	s += Lll[i]
while maxx:
	if maxx * N - s > s:
		print(maxx)
		break
	maxx += 1


import math
n = int(input())
l = list(map(int, input().split()))
s = 0
for i in l:
	s += i
	t = math.ceil(2 * s / n)
	if t == 2 * s / n:
		t -= -1
print(max(max(l), t))


import collections, atexit, math, sys, bisect
sys.setrecursionlimit(1000000)

def getIntList():
	return list(map(int, input().split()))
try:
	import numpy

	def dprint(*args, **kwargs):
		print(*args, file=sys.stderr)
	dprint('debug mode')
except Exception:

	def dprint(*args, **kwargs):
		pass
inId = 0
outId = 0
if inId > 0:
	dprint('use input', inId)
	sys.stdin = open('input' + str(inId) + '.txt', 'r')
if outId > 0:
	dprint('use output', outId)
	sys.stdout = open('stdout' + str(outId) + '.txt', 'w')
	atexit.register(lambda : sys.stdout.close())
(N,) = getIntList()
za = getIntList()
s = sum(za)
t = max(za)
for i in range(t, 10000):
	me = i * N - s
	if me > s:
		print(i)
		sys.exit()


n = int(input())
l = list(map(int, input().split()))
m = max(l)
while 1:
	s = r = 0
	for i in range(len(l)):
		r += m - l[i]
		s += l[i]
	if r > s:
		print(m)
		break
	else:
		m += 1


N = int(input())
a = list(map(int, input().split()))
maxi = max(a)
sume = 0
suma = 0
while True:
	suma = 0
	sume = 0
	for i in range(N):
		sume += a[i]
		suma += maxi - a[i]
	if suma > sume:
		break
	else:
		maxi += 1
print(maxi)


n = int(input())
a = list(map(int, input().split()))
a.sort()
k = a[n - 1]
suma = sum(a)
if k * n - suma > suma:
	print(k)
	exit()
while True:
	if k * n - suma > suma:
		break
	else:
		k += 1
print(k)


n = int(input())
A = [int(x) for x in input().split()]
s = sum(A)
M = max(A)
for K in range(M, M + 300):
	votes = K * n - s
	if votes > s:
		print(K)
		break


n = int(input())
a = [int(x) for x in input().split(' ')]
e = sum(a)
ma = max(a)
aw = sum([ma - x for x in a])
if aw > e:
	print(ma)
else:
	while aw <= e:
		ma += 1
		aw = sum([ma - x for x in a])
	print(ma)


n = int(input())
l = [int(x) for x in input().split()]
max1 = 0
sum1 = 0
s = sum(l)
d = max(l)
for i in range(1, 202):
	sum1 = 0
	for j in range(n):
		if i - l[j] >= 0:
			sum1 += i - l[j]
	if sum1 > s and i >= d:
		max1 = i
		break
print(max1)


import math
n = int(input())
l = list(map(int, input().split()))
s = 2 * sum(l)
z = s / n
p = max(l)
an = int(z + 1)
print(max(p, an))


x = int(input())
l = list(map(int, input().split()))
res = max(l)
while res * len(l) - sum(l) <= sum(l):
	res += 1
print(res)


n = int(input())
a = list(map(int, input().split()))
print(max(a + [sum(a) * 2 // n + 1]))


def go():
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	x = max(a)
	s1 = 0
	s2 = 0
	for i in range(n):
		s1 += a[i]
		s2 += x - a[i]
	if s2 > s1:
		return x
	while s1 >= s2:
		x += 1
		s2 += n
	return x
print(go())


n = int(input())
lst = list(map(int, input().strip().split(' ')))
Sum = 0
m = max(lst)
s = sum(lst)
while m:
	Sum = m * n - s
	if Sum > s:
		print(m)
		break
	m += 1


n = int(input())
a = [int(i) for i in input().split(' ')]
k = max(a)
while True:
	b = sum(a)
	if k * n - b > b:
		print(k)
		break
	else:
		k += 1


import math
n = int(input())
a = list(map(int, input().split()))
print(max(math.ceil((sum(a) * 2 + 1) / n), max(a)))


n = int(input())
arr = list(map(int, input().split()))
sm = sum(arr)
mx = max(arr)
if n * mx > sm * 2:
	print(mx)
else:
	for mxi in range(mx + 1, 202):
		if n * mxi > sm * 2:
			print(mxi)
			exit(0)


n = int(input())
u = list(map(int, input().split()))
p2 = sum(u) + 1
k = max(u)
p1 = 0
for i in range(n):
	p1 += k - u[i]

def high(b):
	if b != int(b):
		b += 1
	return int(b)
print(high(max(0, p2 - p1) / n) + k)


n = int(input())
l = list(map(int, input().split()))
k = max(l)
s = 0
m = 0
while m <= sum(l):
	p = []
	for i in range(len(l)):
		p.append(k - l[i])
		m = sum(p)
	if sum(p) > sum(l):
		print(k)
		break
	else:
		k = k + 1


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
i = max(a)
r = 0
while True:
	ss = 0
	for j in a:
		ss = ss + (i - j)
	if ss > s:
		r = i
		break
	i = i + 1
print(r)


from math import ceil
n = int(input())
a = [int(i) for i in input().split()]
print(max(int(2 * sum(a) / n + 1), max(a)))


import math
n = int(input())
a = list(map(int, input().split()))
print(max(math.floor(2 * sum(a) / len(a) + 1), max(a)))


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
k = max(a)
while True:
	l = [k - a[i] for i in range(n)]
	if sum(l) > s:
		print(k)
		break
	k += 1


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
k = max(a)
while True:
	if n * k - s > s:
		print(k)
		break
	k += 1


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
N = int(input())
A = [int(x) for x in input().split()]
e = 2 * sum(A)
ans = max(e // N + 1, max(A))
print(ans)


n = int(input())
arr = [int(e) for e in input().split()]
s = sum(arr)
maxE = max(arr)
for i in range(maxE, 10 ** 9, 1):
	s_ = 0
	for j in range(n):
		s_ += i - arr[j]
	if s_ > s:
		print(i)
		exit()


n = int(input())
l = [int(x) for x in input().split()]
s = sum(l)
m = max(l)
while True:
	prod = m * n
	if prod - s > s:
		break
	else:
		m = m + 1
print(m)


n = int(input())
s = list(map(int, input().split()))
summ = sum(s)
maxx = max(s)
x = max(maxx, 2 * summ // n + 1)
print(x)


def elections(arr):
	k = max(arr)
	while True:
		a = sum(arr)
		b = 0
		for i in arr:
			b += k - i
		if b > a:
			return k
		k += 1
n = int(input())
arr = list(map(int, input().split()))
print(elections(arr))


n = int(input())
l = list(map(int, input().split()))
k = 2 * sum(l) // n + 1
print(max(max(l), k))


n = int(input())
l = list(map(int, input().split()))
s = max(l)
a = sum(l)
c = []
for i in range(n):
	c.append(s - l[i])
b = sum(c)
while b <= a:
	b += n
	s += 1
print(s)


n = int(input())
A = input().split()
A = [int(ai) for ai in A]
k = max(A)
v_E = sum(A)
while n * k <= 2 * v_E:
	k += 1
print(k)


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
print(max((s * 2 + n) // n, max(l)))


gi = lambda : list(map(int, input().split()))
(n,) = gi()
l = gi()
su = sum(l)
ma = max(l)
ans = sum([ma - e for e in l])
while ans <= su:
	ma += 1
	ans = sum([ma - e for e in l])
print(ma)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
s = sum(a)
k = 1000000
for i in range(m, k, 1):
	ss = 0
	for j in range(0, n):
		ss += i - a[j]
	if ss > s:
		p = i
		break
print(p)


def inint():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def main():
	n = inint()
	a = inlist()
	k = max(a)
	sm = sum(a)
	while k * n - sm <= sm:
		k += 1
	print(k)
main()


n = int(input())
a = [int(i) for i in input().split()]
m = max(a)
s = sum(a)
s0 = sum([m - i for i in a])
while s0 <= s:
	s0 += n
	m += 1
print(m)


n = int(input())
a = list(map(int, input().split()))
sumi = sum(a)
k = max(a)
while sumi >= n * k - sumi:
	k += 1
print(k)


n = int(input())
a = list(map(int, input().split()))
maxn = max(a)
sumn = sum(a)
sum = 0
while maxn * n <= 2 * sumn:
	maxn += 1
print(maxn)


n = int(input())
a = list(map(int, input().split()))
tmp = 0
k = max(a)
for i in a:
	tmp += k - i
while True:
	if tmp > sum(a):
		print(k)
		exit()
	tmp += n
	k += 1


import math, itertools, fractions, heapq, collections, bisect, sys, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	l = LI()
	sm = sum(l)
	mx = max(l)
	for i in range(mx, 1000):
		ans = 0
		for x in l:
			ans += i - x
		if ans > sm:
			return i
print(main())


from math import inf as inf
from math import *
from collections import *
import sys
input = sys.stdin.readline
t = 1
while t:
	t -= 1
	n = int(input())
	a = list(map(int, input().split()))
	k = max(a)
	s1 = sum(a)
	while 1:
		s2 = 0
		for j in a:
			s2 += max(0, k - j)
		if s2 > s1:
			break
		k += 1
	print(k)


import math
import bisect
import itertools
import sys

def mindiff(a):
	b = a[:]
	b.sort()
	m = 10000000000
	for i in range(len(b) - 1):
		if b[i + 1] - b[i] < m:
			m = b[i + 1] - b[i]
	return m

def lcm(a, b):
	return a * b // math.gcd(a, b)

def merge(a, b):
	i = 0
	j = 0
	c = 0
	ans = []
	while i < len(a) and j < len(b):
		if a[i] < b[j]:
			ans.append(a[i])
			i += 1
		else:
			ans.append(b[j])
			c += len(a) - i
			j += 1
	ans += a[i:]
	ans += b[j:]
	return (ans, c)

def mergesort(a):
	if len(a) == 1:
		return (a, 0)
	mid = len(a) // 2
	(left, left_inversion) = mergesort(a[:mid])
	(right, right_inversion) = mergesort(a[mid:])
	(m, c) = merge(left, right)
	c += left_inversion + right_inversion
	return (m, c)

def is_prime(num):
	if num == 2:
		return True
	if num == 3:
		return True
	if num % 2 == 0:
		return False
	if num % 3 == 0:
		return False
	t = 5
	a = 2
	while t <= int(math.sqrt(num)):
		if num % t == 0:
			return False
		t += a
		a = 6 - a
	return True

def ceil(a, b):
	if a % b == 0:
		return a // b
	else:
		return a // b + 1

def binsearch(arr, b, low, high):
	if low == high:
		return low
	if arr[math.ceil((low + high) / 2)] < b:
		return binsearch(arr, b, low, math.ceil((low + high) / 2) - 1)
	else:
		return binsearch(arr, b, math.ceil((low + high) / 2), high)
n = int(input())
a = list(map(int, input().split()))
if 2 * sum(a) // n + 1 < max(a):
	exit(print(max(a)))
print(2 * sum(a) // n + 1)


n = int(input())
arr = list(map(int, input().split()))
maxi = max(arr)
f = 0
for i in range(n):
	f += arr[i]
if n * maxi - f > f:
	print(maxi)
else:
	while n * maxi - f <= f:
		maxi += 1
	print(maxi)


def A(students_number, voices):
	k = max(voices)
	while True:
		result = 0
		for i in voices:
			result += k - i - i
		if result <= 0:
			k += 1
		else:
			return k
students_number = int(input())
voices = [int(x) for x in input().split()]
print(A(students_number, voices))


def main():
	N = int(input())
	vals = [int(i) for i in input().split()]
	sum = 0
	max = 0
	for x in vals:
		sum = sum + x
		if x > max:
			max = x
	new_sum = 0
	curr_test = max
	while new_sum <= sum:
		new_sum = 0
		for x in vals:
			new_sum = new_sum + (curr_test - x)
		curr_test = curr_test + 1
	print(curr_test - 1)
main()


def main():
	n = int(input())
	a = list(map(lambda x: int(x), input().split(' ')))
	e_vote = sum(a)
	m_a = max(a)
	if m_a * n > e_vote * 2:
		print(m_a)
		return
	a_vote = 0
	for i in a:
		a_vote += m_a - i
	diff = e_vote + 1 - a_vote
	ans = m_a + diff // n + (1 if diff % n != 0 else 0)
	print(ans)
	return
main()


import sys

def solve(io):
	N = io.read_int()
	A = io.read_int_array(N)
	for k in range(max(A), 222):
		elo = sum(A)
		awr = sum([k - Ai for Ai in A])
		if awr > elo:
			io.println(k)
			break

class IO:
	in_stream = None
	out_stream = None
	raw = ''
	buf = []
	pos = 0

	def __init__(self, input_stream, output_stream):
		self.in_stream = input_stream
		self.out_stream = output_stream

	def read_to_buffer(self):
		self.raw = self.in_stream.readline().rstrip('\n')
		self.buf = self.raw.split()
		self.pos = 0

	def read_string(self):
		while self.pos == len(self.buf):
			self.read_to_buffer()
		ans = self.buf[self.pos]
		self.pos += 1
		return ans

	def read_int(self):
		return int(self.read_string())

	def read_float(self):
		return float(self.read_string())

	def read_string_array(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.read_string())
		return arr

	def read_int_array(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.read_int())
		return arr

	def read_float_array(self, N, offset=0):
		arr = [None] * offset
		for _ in range(0, N):
			arr.append(self.read_float())
		return arr

	def read_line(self):
		while self.pos == len(self.buf):
			self.read_to_buffer()
		if self.pos > 0:
			raise ValueError('Cannot call read_line in the middle of a line.')
		return self.raw

	def print(self, s):
		self.out_stream.write(str(s))

	def println(self, s):
		self.print(s)
		self.print('\n')

	def println_array(self, arr, sep=' '):
		self.println(sep.join((str(x) for x in arr)))

	def flush_output(self):
		self.out_stream.flush()
pythonIO = IO(sys.stdin, sys.stdout)
solve(pythonIO)
pythonIO.flush_output()


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
for k in range(max(a), 250):
	if n * k > s * 2:
		print(k)
		exit(0)


x = int(input())
y = [int(_) for _ in input().split()]
(z, k) = ([0] * x, 0)
while sum(z) <= sum(y):
	k += 1
	for i in range(x):
		z[i] = k - y[i]
	if max(y) <= k:
		pass
	else:
		z = [0] * x
print(k)


arr_len = int(input())
items = [int(x) for x in input().split(' ')]
votes = sum(items)
max_vote = max(items)
res = max(votes * 2 // arr_len + 1, max_vote)
import sys
sys.stdout.write(str(res))


n = int(input())
a = list(map(int, input().split()))
maxx = max(a)
summ = sum(a)
ans = 0
while ans * n + n * maxx - summ <= summ:
	ans += 1
print(ans + maxx)


n = int(input())
arr = list(map(int, input().split()))
val = sum(arr)
val *= 2
k = val // n + 1
if k < max(arr):
	k = max(arr)
print(str(k) + '\n')


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
for i in range(max(a), 1000):
	t = 0
	for j in range(n):
		t += i - a[j]
	if t > s:
		print(i)
		break


def main():
	n = int(input())
	a = list(map(int, input().split()))
	ans = max(2 * min(a) + 1, max(a))
	cur_sum = 0
	neighb_sum = sum(a)
	while cur_sum < neighb_sum:
		for i in range(n):
			cur_sum += ans - a[i]
		if cur_sum > neighb_sum:
			return ans
		ans += 1
		cur_sum = 0
print(main())


n = int(input())
a = list(map(int, input().split()))
k = -1
if n == 1:
	print(2 * a[0] + 1)
else:
	for i in range(n):
		k = max(k, a[i])
	p = sum(a)
	for i in range(k, 10000):
		if i * n - p > p:
			print(i)
			break


n = int(input())
a = list(map(int, input().split()))
k = max(a)
s = 0
s1 = 0
for i in range(n):
	s += a[i]
	s1 += k - a[i]
d = 0
if s1 < s:
	d = (s - s1) // n + min(1, (s - s1) % n)
if s1 + n * d == s:
	d += 1
k += d
print(k)


n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
m = max(arr)
while 1:
	if n * m - s > s:
		print(m)
		break
	m += 1


import sys
import itertools
import math
M_PI = 3.141592653589793
n = int(input())
a = list(map(int, input().split()))
s = sum(a)
k = max(2 * s // n + 1, max(a))
print(int(k))


def sum(l):
	ans = 0
	for x in l:
		ans += x
	return ans
n = int(input())
votes = [int(x) for x in input().split()]
ans = int(2.0 * sum(votes) / n + 1)
print(max(ans, max(votes)))


n = int(input())
a = list(map(int, input().split()))
b = max(a)
c = sum(a)
d = 0
for i in range(n):
	d += b - a[i]
if d > c:
	print(b)
else:
	while d <= c:
		d += n
		b += 1
	print(b)


a = int(input())
x = list(map(int, input().split()))
print(max((lambda i: i if i > sum(x) / a * 2 else i + 1)(round(sum(x) / a * 2)), max(x)))


import math
n = int(input())
a = [int(num) for num in input().split()]
k = 0
av = n * k - sum(a)
ev = sum(a)
while av <= ev:
	av = n * k - sum(a)
	ev = sum(a)
	if av > ev:
		print(max(max(a), k))
		break
	else:
		k = k + 1


n = int(input())
a = list(map(int, input().split()))
k = max(a)
l = sum(a)
m = 0
while m <= l:
	s = [k - i for i in a]
	m = sum(s)
	k += 1
print(k - 1)


n = int(input())
x = list(map(int, input().split()))
y = 0
for i in x:
	y += i
d = 2 * y // n + 1
if d < max(x):
	print(max(x))
else:
	print(d)


n = int(input())
a = [int(x) for x in input().split()]
mxa = max(a)
sma = sum(a)
k = mxa
while k * n - sma <= sma:
	k += 1
print(k)


from math import *
n = int(input())
a = list(map(int, input().split()))
summa = sum(a)
print(max(max(a), (2 * summa + n) // n))


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
m = max(a)
print(max(m, (2 * s + n) // n))


import math
n = int(input())
l = list(map(int, input().split()))
suml = sum(l)
maxl = max(l)
a = 2 * suml // n + 1
res = max(a, maxl)
print(res)


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
mx = max(l)
test = True
while test:
	k = 0
	for i in range(n):
		k += mx - l[i]
	if k > s:
		print(mx)
		test = False
	mx += 1


n = int(input())
z = list(map(int, input().split()))
harus = sum(z) + 1
temp = max(z)
vote = 0
status = True
while status:
	for i in z:
		vote += temp - i
	if vote >= harus:
		print(temp)
		status = False
		break
	else:
		vote = 0
		temp += 1


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	n = I()
	a = LI()
	m = max(a)
	t = u = 0
	for c in a:
		t += c
		u += m - c
	if u > t:
		return m
	return m + (t - u + n) // n
print(main())


rd = lambda : list(map(int, input().split()))
(n, a) = (rd()[0], rd())
print(max(max(a), sum(a) * 2 // n + 1))


nn = input()
arr = list(map(int, input().split(' ')))
curr_max = max(arr)
elod = sum(arr)
awruk = curr_max * len(arr) - elod
while awruk <= elod:
	curr_max += 1
	awruk += len(arr)
print(curr_max)


n = int(input())
b = list(map(int, input().split()))
su = 0
m = b[0]
for t in b:
	if t > m:
		m = t
	su = su + t
k = 2 * su // n
if n * k - su > su:
	if k > m:
		print(2 * su // n)
	else:
		print(m)
elif k + 1 > m:
	print(k + 1)
else:
	print(m)


(n, data) = (int(input()), list(map(int, input().split())))
k = max(data)
S = 2 * sum(data)
k_n = k * n
if S >= k_n:
	k += (S - k_n) // n + 1
print(k)


import math
n = float(input())
a = [int(x) for x in input().split()]
sum_a = sum(a)
max_a = max(a)
if 2 * sum_a % n == 0:
	print(max(int(2 * sum_a / n + 1), max_a))
else:
	print(max(math.ceil(2 * sum_a / n), max_a))


import math
n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in range(n):
	sum += a[i]
big = max(a)
biggish = math.ceil((2 * sum + 1) / n)
print(max(big, biggish))


n = int(input())
a = list(map(int, input().split()))
for i in range(max(a), 100000000):
	if sum([j for j in a]) < sum([i - j for j in a]):
		break
print(i)


number_of_students = int(input())
w = input()
elodreip = []
elodreip = w.split(' ')
for i in range(0, len(elodreip), 1):
	elodreip[i] = int(elodreip[i])
elodreip_votes = sum(elodreip)
max_vote = max(elodreip)
for k in range(max_vote, 202, 1):
	suma = 0
	for elem in elodreip:
		suma += k - elem
	if suma > elodreip_votes:
		print(k)
		break


n = int(input())
l = list(map(int, input().split()))
k = sum(l)
x = int(2 * k / n) + 1
if x < max(l):
	print(max(l))
else:
	print(x)


n = int(input())
l = list(map(int, input().split()))
k = max(l)
l1 = []
while sum(l1) <= sum(l):
	for i in range(n):
		l1.append(k - l[i])
	if sum(l1) <= sum(l):
		l1 = []
		k += 1
print(k)


def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
a = li()
s = sum(a)
k = max(a)
while 1:
	if n * k - s > s:
		print(k)
		break
	k += 1


n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
m = max(arr)
res = 2 * s // n + 1
if res < m:
	print(m)
else:
	print(res)


def vybory(lst):
	(s, k) = (sum(lst), 0)
	for i in range(len(lst)):
		k = max(k, lst[i])
	while k * len(lst) - s <= s:
		k += 1
	return k
n = int(input())
a = [int(j) for j in input().split()]
print(vybory(a))


n = int(input())
l = list(map(int, input().split()))
s = 2 * sum(l)
for i in range(100000):
	if n * i > s:
		print(max(i, max(l)))
		exit(0)


x = int(input())
l = list(map(int, input().split()))
d = max(l)
f = 0
while True:
	f = sum(list(map(lambda x: abs(x - d), l)))
	if f > sum(l):
		break
	else:
		d = d + 1
print(d)


a = int(input())
b = list(map(int, input().split()))
w = sum(b)
e = max(b)
k = []
for i in range(e, 305):
	for j in range(0, len(b)):
		k.append(i - b[j])
	if sum(k) > w:
		print(i)
		break
	else:
		k = []


n = int(input())
sum = 0
x = 0
a = input().split()
for i in range(n):
	a[i] = int(a[i])
	sum += a[i]
	x = max(x, a[i])
while sum > (x * n - 1) // 2:
	x += 1
print(x)


import sys
import math

def main():
	[n] = map(int, next(sys.stdin).split())
	ar = list(map(int, next(sys.stdin).split()))
	x = sum(ar) * 2 + 1
	print(max(max(ar), math.ceil(x / n)))
main()


from sys import stdin, stdout, exit
n = int(stdin.readline())
a = list(map(int, stdin.readline().split()))
ans = 1
for i in range(n):
	ans = max(ans, a[i])
while True:
	(awruk, elodreip) = (0, 0)
	for i in range(n):
		awruk += ans - a[i]
		elodreip += a[i]
	if awruk > elodreip:
		stdout.write('%d' % ans)
		exit(0)
	ans += 1


n = int(input())
l = list(map(int, input().split()))
k = max(l)
while True:
	if sum([abs(k - i) for i in l]) > sum(l):
		break
	else:
		k += 1
print(k)


import math
n = int(input())
a = list(map(int, input().split()))
k = max(a)
ans = math.ceil((2 * sum(a) + 1) / n)
if ans >= k:
	print(ans)
else:
	print(k)


n = int(input())
l = [int(i) for i in input().split()]
eud = sum(l)
for i in range(max(l), 100000):
	ans = 0
	for j in l:
		ans += i - j
	if ans > eud:
		print(i)
		break


n = int(input())
a = list(map(int, input().split()))
x = sum(a)
if (2 * x + 1) % n == 0:
	y = (2 * x + 1) // n
else:
	y = (2 * x + 1) // n + 1
if max(a) > y:
	print(max(a))
else:
	print(y)


a = int(input())
b = list(map(int, input().split()))
c = sum(b)
d = 1
while 1:
	if d * a - c > c and d >= max(b):
		print(d)
		break
	d += 1


n = int(input())
votes_Elodreip = list(map(int, input().split()))
sum_evotes = sum(votes_Elodreip)
votes_Awruk = []
max_e = max(votes_Elodreip)
for i in range(n):
	votes_Awruk.append(max_e - votes_Elodreip[i])
sum_avotes = sum(votes_Awruk)
if sum_avotes > sum_evotes:
	k = max_e
else:
	k = (sum_evotes - sum_avotes) // n + 1 + max_e
print(k)


n = int(input())
m = list(map(int, input().split()))
for i in range(2 * max(m) + 2):
	if n * i > 2 * sum(m) and i >= max(m):
		print(i)
		break


n = int(input())
elodreip = list(map(int, input().split()))
k = max(elodreip)
while True:
	if k > 2 * sum(elodreip) / n:
		break
	else:
		k += 1
print(k)


def main():
	n = int(input())
	a = list(map(int, input().split()))
	k = max(a)
	s = sum(a)
	print(max(k, (2 * s + n) // n))
main()


from math import *
n = int(input())
a = list(map(int, input().split()))
a.sort()
k = a[-1]
elo = sum(a)
ans = 0
for i in range(n):
	ans += k - a[i]
diff = ans - elo
if diff > 0:
	print(k)
else:
	k = k + ceil(abs(diff) / n)
	ans = 0
	for i in range(n):
		ans += k - a[i]
	if ans > elo:
		print(k)
	else:
		print(k + 1)


n = int(input())
a = list(map(int, input().split()))
m = max(a) - 1
awr = 0
while awr <= sum(a):
	m += 1
	awr = 0
	for i in a:
		awr += m - i
print(m)


def fun():
	n = int(input())
	l = list(map(int, input().split()))
	s = sum(l)
	m = max(l)
	while 1:
		fl = list(map(lambda x: m - x, l))
		s1 = sum(fl)
		if s1 > s:
			print(m)
			return
		else:
			m = m + 1
fun()


from sys import stdin
n = int(stdin.readline().strip())
s = list(map(int, stdin.readline().strip().split()))
mx = max(s)
sm = sum(s)
y = 0
while y <= sm:
	y = 0
	for i in s:
		y += mx - i
	mx += 1
print(mx - 1)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
b = list()
for i in range(n):
	b.append(m - a[i])
s1 = sum(a)
s2 = sum(b)
while s1 >= s2:
	m += 1
	s2 += n
print(m)


studs = int(input())
votes = [int(x) for x in input().split()]
k = max(votes)
e_sum = sum(votes)
a_sum = 0
while True:
	a_sum = sum([k - x for x in votes])
	if a_sum > e_sum:
		break
	k += 1
print(k)


import sys

def main():
	(_, *l) = map(int, sys.stdin.read().strip().split())
	return max(max(l), int(2 * sum(l) / len(l)) + 1)
print(main())


n = int(input())
l = list(map(int, input().split()))
m = max(l)
s = sum(l)
while True:
	cur = sum([m - i for i in l])
	if cur > s:
		break
	m += 1
print(m)


n = int(input())
L = [int(x) for x in input().split()]
print(max(2 * sum(L) // n + 1, max(L)))


n = int(input())
a = list()
s1 = input().split()
sum1 = 0
for i in range(n):
	a.append(int(s1[i]))
	sum1 += a[i]
a.sort()
max = a[n - 1]
while True:
	flag = False
	sum_tmp = 0
	for i in range(n):
		sum_tmp += max - a[i]
	if sum_tmp > sum1:
		flag = True
	if flag:
		print(max)
		break
	max += 1


n = int(input())
ai = list(map(int, input().split()))
num = sum(ai) * 2 + 1
ans = max(max(ai), num // n + (num % n != 0))
print(ans)


n = int(input())
l = list(map(int, input().split()))
a = max(l)
x = a * n
s = sum(l)
if x - s > s:
	print(a)
else:
	for i in range(1, a + 2):
		x += n
		if x - s > s:
			print(a + i)
			break


n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in a:
	sum += i
print(max((2 * sum + n) // n, max(a)))


n = int(input())
a = [int(i) for i in input().split()]
s = sum(a)
for k in range(max(a), 10000):
	if n * k - s > s:
		print(k)
		exit()


input()
a = list(map(int, input().split()))
mx = max(a)
ans = 0
s = 0
for i in a:
	ans += mx - i
	s += i
if ans > s:
	print(mx)
	exit(0)
print(mx + (s - ans) // len(a) + 1)


n = int(input())
A = [int(num) for num in input().split(' ')]
opponent_votes = sum(A)
min_k = max(A)
while sum([min_k - a for a in A]) <= opponent_votes:
	min_k += 1
print(min_k)


n = int(input())
t = list(map(int, input().split()))
print(max(max(t), (2 * sum(t) + n) // n))


import math
n = int(input())
a = [int(x) for x in input().split()]
print(max(1 + math.floor(sum(a) / n * 2), max(a)))


from math import ceil
n = int(input())
array = sorted(list(map(int, input().split())))
largest = array[-1]
totalvotes2 = 0
for i in range(0, n):
	totalvotes2 += array[i]
sol = int(ceil(2 * totalvotes2 / n))
if 2 * totalvotes2 / n < largest:
	print(largest)
elif sol * n == totalvotes2 * 2:
	print(sol + 1)
else:
	print(sol)


n = int(input())
arr = [int(x) for x in input().split()]
max1 = max(arr)
sum1 = sum(arr)
while True:
	k = max1
	sum2 = 0
	for i in range(len(arr)):
		sum2 += k - arr[i]
	if sum2 > sum1:
		print(k)
		break
	max1 += 1


n = int(input())
a = input().split(' ')[:n]
for k in range(len(a)):
	a[k] = int(a[k])
k = max(a)
while n * k <= 2 * sum(a):
	k += 1
print(k)


n = int(input())
a = [int(s) for s in input().split()]
for k in range(max(a), 10 ** 10):
	if sum(a) < n * k - sum(a):
		print(k)
		break


import math
n = int(input())
v = list(map(int, input().split()))
t = sum(v)
m = max(v)
k = math.ceil((2 * t + 1) / n)
print(max(k, m))


n = int(input())
lst = [int(i) for i in input().split()]
sum1 = 0
sum2 = 0
max1 = max(lst)
for i in lst:
	sum1 = sum1 + i
	sum2 = sum2 + max1 - i
if sum1 < sum2:
	print(max1)
else:
	d = sum1 - sum2
	r = (d + 1) % n
	if d == 0:
		print(max1 + 1)
	elif r == 0:
		print(max1 + (d + 1) // n)
	else:
		print(max1 + (d + 1) // n + 1)


a = int(input())
l = [int(i) for i in input().strip().split()]
d = max(l)
e = sum(l)
c = 0
for i in range(d, 2 * d + 2):
	c = 0
	for j in range(len(l)):
		c = c + (i - l[j])
	if c > e:
		print(i)
		break


n = int(input())
al = list(map(int, input().split()))
print(max(max(al), ((sum(al) << 1) + n) // n))


n = int(input())
l = list(map(int, input().split()))
val = max(l)
while True:
	if val * n > 2 * sum(l):
		print(val)
		break
	else:
		val += 1


import math
i = int(input())
s = list(map(int, input().split()))
ma = max(s)
ki = math.ceil(sum(s) * 2 / len(s))
if 2 * sum(s) == ki * len(s):
	ki += 1
print(max(ma, ki))


n = int(input())
xs = list(map(int, input().split()))
max_x = max(xs)
bad = sum(xs)
good = n * max_x - bad
print(max_x + max(0, 1 + (bad - good) // n))


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import Decimal
from decimal import *
from collections import defaultdict, deque
import heapq
from decimal import Decimal
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = 1000000007
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
n = int(input())
l = list(map(int, input().split(' ')))
v = sum(l)
m = max(l)
total = m * n
while m * n < 2 * v + 1:
	m += 1
print(m)


__author__ = 'Dilshod'
n = int(input())
m = list(map(int, input().split()))
cnt = max(m)
e = sum(m)
while 1:
	a = 0
	for i in range(n):
		a += cnt - m[i]
	if a > e:
		print(cnt)
		exit()
	cnt += 1


n = int(input())
list = [int(i) for i in input().split()]
som = sum(list)
k = max(list)
while True:
	if n * k - som > som:
		print(k)
		exit()
	k += 1


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
mx = max(l)
while mx * n - s <= s:
	mx += 1
print(mx)


n = int(input())
li = list(map(int, input().split()))
a = max(li)
s = 0
while True:
	for i in range(n):
		s += a - li[i]
	if s <= sum(li):
		a += 1
		s = 0
	else:
		print(a)
		break


n = int(input().strip())
a = list(map(int, input().strip().split()))
lo = max(a)
s = sum(a)
import math
k = 2 * s // n
if n * k > 2 * s:
	print(max(k, lo))
else:
	print(max(k + 1, lo))


from math import ceil
n = int(input())
a = list(map(int, input().split()))
print(max(max(a), ceil(2 * sum(a) / n + 1e-07)))


from math import ceil
n = int(input())
a = list(map(int, input().split()))
(m, t, s, f) = (max(a), sum(a), 0, 1)
for e in a:
	s += m - e
	if s > t:
		print(m)
		f = 0
		break
if f:
	print(m + ceil((t - s) / n + 1e-09))


n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
i = max(arr)
while True:
	cnt = 0
	for j in arr:
		cnt += i - j
	if cnt > s:
		break
	else:
		i += 1
print(i)


x = int(input())
a = [int(x) for x in input().split()]
s = 0
mx = 0
for x in a:
	if x > mx:
		mx = x
	s += x
k = mx
while True:
	s1 = 0
	for x in a:
		s1 += k - x
	if s1 > s:
		print(k)
		exit(0)
	k += 1


n = int(input())
a = [int(s) for s in input().split(' ')]
k = max(2 * sum(a) // n + 1, max(a))
print(k)


n = int(input())
ar = list(map(int, input().split()))
if max(ar) * n > 2 * sum(ar):
	print(max(ar))
else:
	req = sum(ar) + 1
	votes = (req * 2 - 1) / n
	if votes == int(votes):
		print(int(votes))
	else:
		print(int(votes) + 1)


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
z = max(l)
for i in range(z, 210, 1):
	q = 0
	for j in l:
		q += i - j
	if q > s:
		break
	else:
		continue
print(i)


import math
n = int(input())
t = list(map(int, input().split()))
maxl = 0
add = 0
for i in t:
	maxl = max(maxl, i)
	add += i
print(max(math.ceil((add * 2 + 1) / n), maxl))


n = int(input())
votes = tuple(map(int, input().split()))
max_vote = max(votes)
total_elodreip = sum(votes)
total = 0
for i in votes:
	total += max_vote - i
while total <= total_elodreip:
	total += n
	max_vote += 1
print(max_vote)


n = int(input())
a = list(map(int, input().split()))
ald = sum(a)
kstart = max(a)
while True:
	k = kstart * n
	elo = k - ald
	if elo > ald:
		break
	kstart += 1
print(kstart)


import math

def victory(n, a):
	opp_votes = sum(a)
	k = max(a)
	while True:
		votes = sum((k - v for v in a))
		if votes > opp_votes:
			return k
		k += 1
n = int(input())
a = list(map(int, input().split()))
print(victory(n, a))


n = int(input())
a = list(map(int, input().split()))
k = sum(a) * 2 // n + 1
if k >= max(a):
	print(k)
else:
	print(max(a))


n = int(input())
A = list(map(int, input().split()))
s = sum(A)
m = max(A)
l = 0
for i in A:
	l += m - i
if l > s:
	print(m)
else:
	while l <= s:
		m += 1
		l = 0
		for i in A:
			l += m - i
	print(m)


import sys
n = int(input())
a = [*map(int, input().split())]
tot = sum(a)
mn = max(a)
for i in range(mn, 1001):
	if i * n - tot > tot:
		print(i)
		sys.exit(0)


T_ON = 0
DEBUG_ON = 1
MOD = 998244353

def solve():
	n = read_int()
	A = read_ints()
	print(max(max(A), math.ceil((2 * sum(A) + 1) / n)))

def main():
	T = read_int() if T_ON else 1
	for i in range(T):
		solve()

def debug(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import math
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def First():
	print('First')

def Second():
	print('Second')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def lcm(a, b):
	d = gcd(a, b)
	return a * b // d

def is_even(x):
	return x % 2 == 0

def is_odd(x):
	return x % 2 == 1

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def gen_primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


n = int(input())
a = list(map(int, input().split(' ')))
s = sum(a) * 2 + 1
x = 0
for i in a:
	x = max(x, i)
while x * n < s:
	x += 1
print(x)


input()
numbers = [int(x) for x in input().split()]
opponent = sum(numbers)
k = max(numbers)
count = 0
for val in numbers:
	count = count + k - val
while count <= opponent:
	k = k + 1
	count = count + len(numbers)
print(k)


n = int(input())
L = list(map(int, input().split()))
v = sum(L)
m = max(L)
s = 0
for i in range(n):
	s += m - L[i]
while s <= v:
	s += n
	m += 1
print(m)


n = input()
a_list = [int(x) for x in input().split()]
bad = sum(a_list)
k = max(a_list)
lena = len(a_list)
while bad >= lena * k - bad:
	k += 1
print(k)


from math import ceil
n = int(input())
a = list(map(int, input().split()))
r = 2 * sum(a)
if r % n == 0:
	print(max(ceil(r / n) + 1, max(a)))
else:
	print(max(ceil(r / n), max(a)))


n = input()
j = 0
inp = list(map(int, input().split()))
for i in range(0, int(n)):
	j = j + inp[i]
k = int(2 * j / int(n)) + 1
for i in range(0, int(n)):
	if k < int(inp[i]):
		k = int(inp[i])
print(k)


from math import ceil
n = int(input())
arr = list(map(int, input().split()))
elod = sum(arr)
me = sum([max(arr) - x for x in arr])
if me < elod:
	more = ceil((elod + 1 - me) / n)
	print(max(arr) + more)
elif me == elod:
	print(max(arr) + 1)
else:
	print(max(arr))


n = int(input())
arr = list(map(int, input().split()))
o = sum(arr)
for i in range(max(arr), 10 ** 5):
	if i * n - o > o:
		print(i)
		break


from math import ceil
n = int(input())
l = list(map(int, input().split()))
k = ceil((2 * sum(l) + 1) / n)
if k >= max(l):
	print(k)
else:
	print(max(l))


def solution(n, a):
	i = max(a)
	while i * n <= 2 * sum(a):
		i += 1
	return i

def answer():
	n = int(input())
	a = [int(x) for x in input().split()]
	print(solution(n, a))
answer()


n = int(input())
l = list(map(int, input().split()))
k = max(l)
e_votes = sum(l)
a_votes = k * n - e_votes
diff = e_votes - a_votes
if diff < 0:
	print(k)
else:
	tmp = diff // n
	print(tmp + k + 1)


n = int(input())
l = list(map(int, input().split()))
x = max(l)
s = sum(l)
i = x
while True:
	l1 = []
	j = 0
	while j < n:
		l1.append(i - l[j])
		j = j + 1
	if sum(l1) > sum(l):
		print(i)
		break
	else:
		i = i + 1


n = int(input())
l = [*map(int, input().split())]
s = 2 * sum(l)
res = max(s // n + 1, max(l))
print(res)


n = int(input())
el = map(int, input().split())
el = list(el)
start_k = max(el)
el_total = sum(el)
aur_begin = sum([start_k - x for x in el])
if aur_begin > el_total:
	print(start_k)
	exit()
diff = el_total - aur_begin
add = diff // n + 1
print(start_k + add)


n = int(input())
l = list(map(int, input().split()))

def sum(l):
	b = 0
	for i in range(len(l)):
		b += l[i]
	return b

def max(l):
	b = 0
	for i in range(len(l)):
		if l[i] > b:
			b = l[i]
	return b
size = n
sum = sum(l)
max = max(l)
(cap, nega) = (0, 0)
while True:
	capa = size * max
	nega = capa - sum
	if nega > sum:
		break
	max += 1
print(max)


n = int(input())
l = list(map(int, input().split()))
a = sum(l)
m = max(l)
f = 0
while 1:
	sum1 = m * n - a
	if sum1 > a:
		print(m)
		break
	else:
		m += 1


import math

def election(arr):
	return max(math.ceil((2 * sum(arr) + 1) / len(arr)), max(arr))
n = int(input())
arr = list(map(int, input().split()))
print(election(arr))


from math import ceil
n = int(input())
a = [int(x) for x in input().split()]
m = max(a)
s = sum([x for x in a])
print(max(m, ceil(2 * s / n + 1e-12)))


n = int(input())
a = list(map(int, input().split(' ')))
sum = 0
minn = 0
for i in range(len(a)):
	sum += a[i]
	minn = max(minn, a[i])
while minn * n - sum <= sum:
	minn = minn + 1
print(minn)


n = int(input())
sing = list(map(int, input().split()))
print(max(2 * sum(sing) // n + 1, max(sing)))


n = int(input())
A = list(map(int, input().split()))
E = sum(A)
x = max(A)
for i in range(x, 100000):
	if i * n - E > E:
		break
print(i)


n = int(input())
arr = list(map(int, input().split()))
sum = arr[0]
curmax = arr[0]
for i in range(1, len(arr)):
	if arr[i] > curmax:
		curmax = arr[i]
	sum = sum + arr[i]
newsum = sum + sum + 1
k = newsum // len(arr)
if newsum % len(arr) > 0:
	k = k + 1
if curmax > k:
	k = curmax
print(k)


import itertools
import math
import collections
try:
	n = int(input())
	l = list(map(int, input().split()))
	s = sum(l)
	m = max(l)
	p = 0
	while p < s:
		t = [] * int(len(l))
		for j in range(0, len(l)):
			t.append(m - l[j])
		p = sum(t)
		if p > s:
			break
		else:
			m += 1
	print(m)
except:
	pass


n = int(input())
ar = list(map(int, input().split()))
k = max(ar)
while True:
	(s1, s2) = (0, 0)
	for e in ar:
		s1 += e
		s2 += k - e
	if s2 > s1:
		break
	k += 1
print(k)


n = int(input())
ai = list(map(int, input().split()))
opposite_votes = sum(ai)
k = max(ai)
my_votes = k * n - opposite_votes
while my_votes <= opposite_votes:
	k = k + 1
	my_votes = k * n - opposite_votes
print(k)


n = int(input())
a = [int(i) for i in input().split()]
c = max(a)
while True:
	x = 0
	y = 0
	for el in a:
		x += el
		y += c - el
	if x < y:
		break
	c += 1
print(c)


from math import ceil
n = int(input())
a = list(map(int, input().split(' ')))
score = sum(a)
k = ceil(score * 2 / n)
if k < max(a):
	print(max(a))
elif k * n - score == score:
	print(k + 1)
else:
	print(k)


n = int(input())
A = list(map(int, input().split()))
print(max(max(A), (2 * sum(A) + n) // n))


n = int(input())
l = list(map(int, input().split()))
ans = max(l)
y = [0]
while sum(y) <= sum(l):
	for i in range(n):
		y.append(abs(ans - l[i]))
	if sum(y) <= sum(l):
		ans += 1
		y = []
print(ans)


n = int(input())
a = [int(s) for s in input().split()]

def ceil(a, b):
	return -(-a / b)
k = max(a)
sa = sum(a)
while k * n <= sa * 2:
	k += 1
print(k)


n = int(input())
ar = list(map(int, input().split()))
sum = 0
q = max(ar)
for i in ar:
	sum += i
w = n * q - sum
if w > sum:
	print(q)
else:
	r = sum - w
	t = r // n
	print(t + 1 + q)


import sys
pin = sys.stdin.readline
pout = sys.stdout.write
ran = range
t = int(pin())
total = list(map(int, pin().split()))
sum1 = 0
sum2 = 0
maxe = max(total)
while True:
	sum1 = 0
	sum2 = 0
	for i in ran(t):
		sum1 = sum1 + total[i]
		sum2 = sum2 + (maxe - total[i])
	if sum2 > sum1:
		print(maxe)
		break
	maxe = maxe + 1


n = int(input())
a = list(map(int, input().split()))
sum = 0
for i in a:
	sum += i
k = 2 * sum // n + 1
z = max(a)
if z >= k:
	k = z
print(k)


n = int(input())
ll = list(map(int, input().split()))
lsum = sum(ll)
k = max(ll)
while n * k - lsum <= lsum:
	k = k + 1
print(k)


from sys import stdin, stdout
from math import sqrt
import math
import heapq
from itertools import accumulate
N = int(input())
arr = [int(x) for x in stdin.readline().split()]
summ = sum(arr)
for k in range(max(arr), 401):
	total_votes = k * N
	Awruk = total_votes - summ
	if Awruk > summ:
		print(k)
		quit()


n = int(input())
l = list(map(int, input().split()))
ans = sum(l)
print(max(max(l), (ans * 2 + n) // n))


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
m = max(a)
k = 0
while k * n - s <= s or k < m:
	k += 1
print(k)


n = int(input())
a = list(map(int, input().split()))
a1 = sum(a)
a2 = max(a)
k = 2 * a1 // n + 1
print(max(a2, k))


n = int(input())
a = [int(n) for n in input().split()]
k = max(a)
S = 0
for i in range(n):
	S += a[i]
while k * n - S <= S:
	k += 1
print(k)


n = int(input())
a = list(map(int, input().split()))
b = sum(a)
c = b * 2 + 1
if c % n > 0:
	c = c // n + 1
else:
	c = c // n
if c >= max(a):
	print(c)
else:
	print(max(a))


import math
cnt = int(input())
vals = list(map(int, input().split(' ')))
print(max(max(vals), math.ceil((sum(vals) * 2 + 1) / cnt)))


gcd = lambda a, b: gcd(b, a % b) if b else a

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	d = max(arr)
	while True:
		res = 0
		for i in arr:
			res += d - i
		if res > sum(arr):
			print(d)
			return
		d += 1
main()


n = int(input())
arr = []
arr = input().split()
arr = [int(x) for x in arr]
maxno = -1
sum = 0
for iter in range(0, n):
	sum = sum + arr[iter]
	if maxno < arr[iter]:
		maxno = arr[iter]
sum_d = sum + sum
if sum_d % n != 0:
	while sum_d % n != 0:
		sum_d = sum_d + 1
	op = int(sum_d / n)
else:
	op = int(sum_d / n) + 1
if op > maxno:
	print(op)
else:
	print(maxno)


def diff(x):
	for i in range(x):
		l1[i] = m - l[i]
	return sum(l1)
x = int(input())
l = list(map(int, input().split()))
l1 = l[:]
s = sum(l)
m = max(l1)
a = diff(x)
while s >= a:
	m = m + 1
	a = diff(x)
print(m)


n = int(input())
a = [int(i) for i in input().split()]
k = a[0]
s2 = 0
for i in a:
	s2 += i
	if i > k:
		k = i
s = 0
for i in a:
	s += k - i
while s <= s2:
	k += 1
	s = 0
	for i in a:
		s += k - i
print(k)


a = int(input())
b = list(map(int, input().split(' ')))
r = 2 * sum(b) / len(b)
r = int(r // 1) + 1
m = max(b)
if r < m:
	r = m
print(r)


import math
n = int(input())
a = list(map(int, input().split()))
d = max(a)
s = 2 * sum(a)
ans = s // n
ans = ans + 1
if ans < d:
	ans = d
print(ans)


from math import ceil
n = int(input())
a = list(map(int, input().split()))
target = sum(a)
up = max(a)
ans = 0
if 2 * target % n == 0:
	ans = 2 * target // n + 1
else:
	ans = ceil(2 * target / n)
print(max(ans, up))


n = int(input())
A = list(map(int, input().split()))
k = max(A)
s = sum(A)
while k * n - s <= s:
	k += 1
print(k)


n = int(input())
a = list(map(int, input().split()))
b = sum(a)
print(max(max(a), (b + b + n) // n))


import math
n = int(input())
a = [int(x) for x in input().split()]
k = max(a)
for j in range(k, 10001):
	if j * n - sum(a) > sum(a):
		print(j)
		break


n = int(input())
a = list(map(int, input().split(' ')))
s = max(a)
p = sum(a)
su = 0
for i in range(n):
	su = su + s - a[i]
if su > p:
	print(s)
else:
	c = 0
	while 1:
		c = c + 1
		su = su + n
		if su > p:
			break
	print(s + c)


import math
samu = int(input())
birthday = input().split()
birthday = list(map(int, birthday))
special = sum(birthday)
sakib = max(birthday)
sakumas = 2 * special / samu
if sakumas == math.floor(sakumas):
	sakumas = int(sakumas + 1)
else:
	sakumas = int(math.ceil(sakumas))
print(max(sakib, sakumas))


from math import gcd
n = int(input())
l = list(map(int, input().split()))
t = sum(l)
p = max(l)
for i in range(p, 10000000000):
	if n * i > 2 * t:
		print(i)
		exit(0)


n = int(input())
total = 0
mx = 0
a = list(map(int, input().split()))
for i in a:
	mx = max(mx, i)
	total += i
total *= 2
total += n
total /= n
print(int(max(total, mx)))


from math import sqrt

def main():
	n = int(input())
	vals = [int(v) for v in input().split()]
	min_v = min(vals)
	max_v = max(vals)
	for i in range(max_v, 2 * max_v + 2):
		s1 = sum(vals)
		s2 = sum([i - v for v in vals])
		if s2 > s1:
			print(i)
			return
main()


n = int(input())
a = list(map(int, input().split()))
a.sort()
k = a[-1]
c = 0
while 1:
	for i in range(n):
		c += k - a[i]
	if c > sum(a):
		break
	else:
		k += 1
		c = 0
print(k)


I = lambda : map(int, input().split())
n = int(input())
a = list(I())
x = max(a)
e = sum(a)
v = x * n - e
if v > e:
	print(x)
else:
	print(2 * e // n + 1)


n = int(input())
arr = list(map(int, input().split()))
su = sum(arr)
ans = 2 * su // n + 1
for i in range(n):
	if arr[i] > ans:
		ans = arr[i]
print(ans)


n = int(input())
a = list(map(int, input().split()))
s1 = sum(a)
k1 = max(a)
while 1:
	c = []
	for i in a:
		k2 = k1 - i
		c.append(k2)
		s2 = sum(c)
	if s2 > s1:
		print(k1)
		break
	k1 = k1 + 1


n = int(input())
a = input().split()
for (i, item) in enumerate(a):
	a[i] = int(item)
s = sum(a)
k = max(s * 2 // n + 1, max(a))
print(k)


a = int(input())
b = list(map(int, input().split()))
print(max(max(b), sum(b) * 2 // a + 1))


n = int(input())
a = list(map(int, input().split()))
a_tot = sum(a)
for k in range(max(a), 210):
	votes = 0
	for j in range(n):
		votes += k - a[j]
	if votes > a_tot:
		print(k)
		break


n = int(input())
a = list(map(int, input().split()))
tot = sum(a)
for k in range(max(a), 100000, 1):
	if k * n - 2 * tot > 0:
		print(k)
		exit(0)


from math import ceil
n = int(input())
a = list(map(int, input().split()))
m = max(a)
s = sum(a)
if n * m - s > s:
	print(m)
else:
	print(ceil((2 * s - n * m) / n) + m if ceil((2 * s - n * m) / n) != (2 * s - n * m) / n else ceil((2 * s - n * m) / n) + m + 1)


t = int(input())
a = list(map(int, input().split()))
b = max(a)
c = sum(a)
k = b
count = 0
i = 0
while count <= c:
	for i in range(t):
		count = count + k - a[i]
	if count > c:
		print(k)
		break
	else:
		k = k + 1
		count = 0


[n] = list(map(int, input().split()))
a = list(map(int, input().split()))
a_sum = 0
a_max = 0
for i in a:
	a_sum += i
	if i > a_max:
		a_max = i
k = a_max
while True:
	r_sum = 0
	for i in a:
		r_sum += k - i
	if r_sum <= a_sum:
		k += 1
	else:
		break
print(k)


input()
a = [*map(int, input().split())]
r = max(a)
while sum((r - x for x in a)) <= sum(a):
	r += 1
print(r)


n = int(input())
a = list(map(int, input().split()))
res = max(a)
Sum = sum(a)
while res * len(a) <= 2 * Sum:
	res += 1
print(res)


def g_couple(itr):
	a = next(itr)
	for b in itr:
		yield (a, b)
		a = b

def g_input(str):
	nb = 0
	for c in str:
		if c != ' ':
			nb = nb * 10 + int(c)
		else:
			yield nb
			nb = 0
	yield nb

def main():
	n = int(input())
	votes = list(g_input(input()))
	k = max(votes)
	opponent = sum(votes)
	while k * n / 2 <= opponent:
		k += 1
	print(k)
main()


n = int(input())
lista = list(map(int, input().strip().split()))
min_k = max(lista)
bads = sum(lista)
goods = min_k * n - bads
if goods > bads:
	print(min_k)
else:
	while bads >= goods:
		min_k += 1
		goods += n
	print(min_k)


n = int(input())
a = list(map(int, input().split()))
m = max(a)
while m * n - sum(a) <= sum(a):
	m += 1
print(m)


a = int(input())
b = [int(i) for i in input().split()]
sum1 = sum2 = 0
kl = max(b)
for i in b:
	sum1 += i
	sum2 += max(b) - i
while sum1 >= sum2:
	sum2 += a
	kl += 1
print(kl)


studentNum = int(input())
students = list(map(int, input().split()))
eldreipVotes = sum(students)
k = max(students)
awrukVotes = 0
while awrukVotes <= eldreipVotes:
	awrukVotes = 0
	for i in range(len(students)):
		awrukVotes += k - students[i]
	if awrukVotes <= eldreipVotes:
		k += 1
print(k)


n = int(input())
a = [int(d) for d in input().split()]
k = max(a)
sm = sum(a)
for i in range(k, 100000002):
	val = 0
	for j in a:
		val += i - j
	if val > sm:
		print(i)
		break


def solve(n, votes):
	s = sum(votes)
	mx = max(votes)
	closest = (s * 2 + n) // n
	return max(closest, mx)

def driver():
	n = int(input())
	votes = [*map(lambda x: int(x), input().split())]
	print(solve(n, votes))
driver()


n = int(input())
string = input().split(' ')
for i in range(n):
	string[i] = int(string[i])
Avotes = 0
Evotes = sum(string)
k = max(string) - 1
while Evotes >= Avotes:
	k += 1
	Avotes = 0
	for item in string:
		Avotes += k - item
print(k)


n = int(input())
a = list(map(int, input().split()))
a.sort()
fs = sum(a)
maxi = a[len(a) - 1]
new = 0
k = maxi
while new < fs:
	new = 0
	for i in range(len(a)):
		new += abs(a[i] - k)
	if new > fs:
		break
	else:
		k += 1
print(k)


a = int(input())
c = list(map(int, input().split()))
b = sum(c)
m = max(c)
while True:
	if m * a <= 2 * b:
		m += 1
	else:
		break
print(m)


n = int(input())
lis = list(map(int, input().split()))
s = sum(lis)
for i in range(max(lis), max(lis) + 300):
	if i * n - s > s:
		print(i)
		break


def Awruk_wins(stds_votes, max_vote):
	Elodreip_votes = sum(stds_votes)
	Awruk_votes = len(stds_votes) * max_vote - Elodreip_votes
	if Awruk_votes > Elodreip_votes:
		return True
	return False
no_of_stds = int(input())
votes = list(map(int, input().split()))
max_votes = max(votes)
while not Awruk_wins(votes, max_votes):
	max_votes += 1
print(max_votes)


student_numbers = int(input())
ais = list(map(int, input().split()))
opp_votes = sum(ais)
k = starting_k = max(ais)
votes = student_numbers * starting_k - opp_votes
while votes <= opp_votes:
	k += 1
	votes = student_numbers * k - opp_votes
print(k)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
l = max(a)
r = 300
if l * n - s > s:
	print(l)
else:
	while r - l > 1:
		m = (r + l) // 2
		if m * n - s > s:
			r = m
		else:
			l = m
	print(r)


def f(l, k):
	l2 = [k - l[i] for i in range(len(l))]
	return sum(l2) > sum(l)
n = int(input())
l = [int(x) for x in input().split()]
st = max(l)
for k in range(st, 100000000):
	if f(l, k):
		print(k)
		break


n = int(input())
y = []
y = [int(k) for k in input().split(' ')]
s1 = sum(y)
if n == 1:
	print(2 * y[0] + 1)
else:
	z = max(y)
	y.remove(z)
	x = max(y)
	y.append(z)
	d = z + x + 1
	b = []
	b = [d - int(k) for k in y]
	s2 = sum(b)
	while s2 > s1:
		d = d - 1
		if d >= max(y):
			b = []
			b = [d - int(k) for k in y]
			s2 = sum(b)
		else:
			break
	print(d + 1)


n = int(input())
a = [int(x) for x in input().split()]
s = sum(a)
m = max(a)
k = 2 * s // n
if k * n - s <= s:
	k += 1
k = max(m, k)
print(k)


import math
import bisect
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
inp = lambda : int(input())
strng = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
strl = lambda : list(input().strip())
mul = lambda : map(int, input().strip().split())
mulf = lambda : map(float, input().strip().split())
seq = lambda : list(map(int, input().strip().split()))

def mex(arr):
	nList = set(arr)
	mex = 0
	while mex in nList:
		mex += 1
	return mex

def results(arr, n):
	arr.sort()
	k = max(arr)
	b = sum(arr)
	a = k * n - b
	while a <= b:
		k += 1
		a += n
	return k

def main():
	n = inp()
	a = seq()
	result = results(a, n)
	print(result)
main()


from math import ceil
a = int(input())
mass = input().split()
for i in range(a):
	mass[i] = int(mass[i])
k = int(sum(mass) * 2 / a) + 1
if k < max(mass):
	k = max(mass)
print(k)


import sys
n = input()
n = int(n)
tab = []
tab = input()
tab = tab.split(' ')
tab = list(map(int, tab))
a = max(tab)
licz = 0
licz2 = 0
if n == 1:
	print(2 * a + 1)
	sys.exit()
for i in tab:
	licz += a - i
	licz2 += i
if licz > licz2:
	print(a)
elif licz2 == licz:
	print(a + 1)
else:
	c = licz2 - licz + 1
	b = c // n
	if c % n != 0:
		b += 1
	print(b + a)


n = int(input())
idx___vote = [int(x) for x in input().split()]
votes = sum(idx___vote)
ans = votes + votes + 1
ans += n - 1
ans //= n
ans = max(max(idx___vote), ans)
print(ans)


n = int(input())
list1 = list(map(int, input().split()))
k = list1[0]
k = max(list1)
while n * k <= 2 * sum(list1):
	k = k + 1
print(k)


import math
from collections import defaultdict

def input_ints():
	return list(map(int, input().split()))

def solve():
	n = int(input())
	a = input_ints()
	k = max(a)
	s = sum(a)
	while True:
		if k * n - s > s:
			print(k)
			return
		k += 1
solve()


def main():
	n = int(input())
	vote = list(map(int, input().split()))
	total_e_vote = sum(vote)
	hyp = max(vote)
	while hyp:
		total_a_vote = 0
		for i in vote:
			total_a_vote += hyp - i
		if total_a_vote <= total_e_vote:
			hyp += 1
		else:
			print(hyp)
			break
main()


import math
n = int(input())
mat = list(map(int, input().split()))
sug = 2 * sum(mat) // n + 1
k = max(sug, max(mat))
print(k)


n = int(input())
a = list(map(int, input().split()))
k = max(a)
while k * len(a) <= 2 * sum(a):
	k = k + 1
print(k)


n = int(input())
a = list(map(int, input().strip().split()))
Max = max(a)
k = Max
Sum = sum(a)
while k * n <= Sum * 2:
	k += 1
print(k)


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush, heappop
import math
from collections import *
from functools import reduce, cmp_to_key, lru_cache
import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline
M = mod = 10 ** 9 + 7

def factors(n):
	return sorted(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))

def inv_mod(n):
	return pow(n, mod - 2, mod)

def li():
	return [int(i) for i in input().rstrip().split()]

def st():
	return str(input().rstrip())[2:-1]

def val():
	return int(input().rstrip())

def li2():
	return [str(i)[2:-1] for i in input().rstrip().split()]

def li3():
	return [int(i) for i in st()]
n = val()
l = li()
su = sum(l)
low = max(l)
high = 10 ** 2000
while low <= high:
	mid = low + high >> 1
	if mid * n - su > su:
		high = mid - 1
		ans = mid
	else:
		low = mid + 1
print(ans)


n = int(input())
m = list(map(int, input().split()))
r = 0
t = max(m)
for i in m:
	r += t - i
if sum(m) < r:
	print(t)
else:
	print(t + (sum(m) - r) // n + 1)


n = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(n):
	s = s + a[i]
amax = a[n - 1]
k = 2 * s // n + 1
if k > amax:
	print(k)
else:
	k = amax
	print(k)


N = int(input())
a = list(map(lambda x: int(x), input().split(' ')))
k = max(a)
b = sum(a)
while 1:
	if N * k - b > b:
		print(k)
		break
	k = k + 1


n = int(input())
polje = []
on = 0
ovaj = 0
polje = [int(i) for i in input().split()]
k = max(polje)
while 1:
	for i in range(n):
		ovaj += polje[i]
		on += k - polje[i]
	if on > ovaj:
		break
	k += 1
	ovaj = 0
	on = 0
print(k)


def solve(nums):
	total = sum(nums)
	maxnum = max(nums)
	if maxnum * len(nums) - total > total:
		return maxnum
	while True:
		maxnum += 1
		if maxnum * len(nums) - total > total:
			return maxnum
n = input()
lst = list(map(int, input().split(' ')))
print(solve(lst))


n = int(input())
a = [int(i) for i in input().split()]
for j in range(max(a), 202):
	s = 0
	for m in a:
		s += j - m
	if sum(a) < s:
		break
print(j)


import math
length = int(input())
arr = list(map(int, input().split()))
print(max(max(arr), math.ceil((sum(arr) * 2 + 1) / length)))


n = int(input())
a = list(map(int, input().split(' ')))[:n]
i = max(a)
while 1:
	b = []
	for j in a:
		b.append(i - j)
	if sum(b) > sum(a):
		break
	else:
		i += 1
print(i)


n = int(input())
s = [int(i) for i in input().split()]
k = max(s)
c = 0
while sum(s) > c:
	for i in range(n):
		c += k - s[i]
	if sum(s) < c:
		break
	else:
		k += 1
		c = 0
print(k)


n = int(input())
a = list(map(int, input().split()))
l = 2 * sum(a) // n
if l > max(a):
	print(l + 1)
elif l < max(a):
	print(max(a))
else:
	print(l + 1)


from sys import stdin, stdout
import cProfile, math
from collections import Counter
from bisect import bisect_left, bisect, bisect_right
import itertools
from copy import deepcopy
from fractions import Fraction
printHeap = str()
memory_constrained = False
P = 10 ** 9 + 7
import sys
sys.setrecursionlimit(10000000)

class Operation:

	def __init__(self, name, function, function_on_equal, neutral_value=0):
		self.name = name
		self.f = function
		self.f_on_equal = function_on_equal

def add_multiple(x, count):
	return x * count

def min_multiple(x, count):
	return x

def max_multiple(x, count):
	return x
sum_operation = Operation('sum', sum, add_multiple, 0)
min_operation = Operation('min', min, min_multiple, 1000000000.0)
max_operation = Operation('max', max, max_multiple, -1000000000.0)

class SegmentTree:

	def __init__(self, array, operations=[sum_operation, min_operation, max_operation]):
		self.array = array
		if type(operations) != list:
			raise TypeError('operations must be a list')
		self.operations = {}
		for op in operations:
			self.operations[op.name] = op
		self.root = SegmentTreeNode(0, len(array) - 1, self)

	def query(self, start, end, operation_name):
		if self.operations.get(operation_name) == None:
			raise Exception('This operation is not available')
		return self.root._query(start, end, self.operations[operation_name])

	def summary(self):
		return self.root.values

	def update(self, position, value):
		self.root._update(position, value)

	def update_range(self, start, end, value):
		self.root._update_range(start, end, value)

	def __repr__(self):
		return self.root.__repr__()

class SegmentTreeNode:

	def __init__(self, start, end, segment_tree):
		self.range = (start, end)
		self.parent_tree = segment_tree
		self.range_value = None
		self.values = {}
		self.left = None
		self.right = None
		if start == end:
			self._sync()
			return
		self.left = SegmentTreeNode(start, start + (end - start) // 2, segment_tree)
		self.right = SegmentTreeNode(start + (end - start) // 2 + 1, end, segment_tree)
		self._sync()

	def _query(self, start, end, operation):
		if end < self.range[0] or start > self.range[1]:
			return None
		if start <= self.range[0] and self.range[1] <= end:
			return self.values[operation.name]
		self._push()
		left_res = self.left._query(start, end, operation) if self.left else None
		right_res = self.right._query(start, end, operation) if self.right else None
		if left_res is None:
			return right_res
		if right_res is None:
			return left_res
		return operation.f([left_res, right_res])

	def _update(self, position, value):
		if position < self.range[0] or position > self.range[1]:
			return
		if position == self.range[0] and self.range[1] == position:
			self.parent_tree.array[position] = value
			self._sync()
			return
		self._push()
		self.left._update(position, value)
		self.right._update(position, value)
		self._sync()

	def _update_range(self, start, end, value):
		if end < self.range[0] or start > self.range[1]:
			return
		if start <= self.range[0] and self.range[1] <= end:
			self.range_value = value
			self._sync()
			return
		self._push()
		self.left._update_range(start, end, value)
		self.right._update_range(start, end, value)
		self._sync()

	def _sync(self):
		if self.range[0] == self.range[1]:
			for op in self.parent_tree.operations.values():
				current_value = self.parent_tree.array[self.range[0]]
				if self.range_value is not None:
					current_value = self.range_value
				self.values[op.name] = op.f([current_value])
		else:
			for op in self.parent_tree.operations.values():
				result = op.f([self.left.values[op.name], self.right.values[op.name]])
				if self.range_value is not None:
					bound_length = self.range[1] - self.range[0] + 1
					result = op.f_on_equal(self.range_value, bound_length)
				self.values[op.name] = result

	def _push(self):
		if self.range_value is None:
			return
		if self.left:
			self.left.range_value = self.range_value
			self.right.range_value = self.range_value
			self.left._sync()
			self.right._sync()
			self.range_value = None

	def __repr__(self):
		ans = '({}, {}): {}\n'.format(self.range[0], self.range[1], self.values)
		if self.left:
			ans += self.left.__repr__()
		if self.right:
			ans += self.right.__repr__()
		return ans

def display(string_to_print):
	stdout.write(str(string_to_print) + '\n')

def primeFactors(n):
	factors = dict()
	for i in range(2, math.ceil(math.sqrt(n)) + 1):
		while n % i == 0:
			if i in factors:
				factors[i] += 1
			else:
				factors[i] = 1
			n = n // i
	if n > 2:
		factors[n] = 1
	return factors

def isprime(n):
	if n < 4:
		return True
	if n % 2 == 0:
		return False
	if n % 3 == 0:
		return False
	i = 5
	w = 2
	while i * i <= n:
		if n % i == 0:
			return False
		i += w
		w = 6 - w
	return True

def test_print(*args):
	if test:
		print(args)

def display_list(list1, sep=' '):
	stdout.write(sep.join(map(str, list1)) + '\n')

def get_int():
	return int(stdin.readline().strip())

def get_tuple():
	return map(int, stdin.readline().split())

def get_list():
	return list(map(int, stdin.readline().split()))
memory = dict()

def clear_cache():
	global memory
	memory = dict()

def cached_fn(fn, *args):
	global memory
	if args in memory:
		return memory[args]
	else:
		result = fn(*args)
		memory[args] = result
		return result
TestCases = False
test = False

def main():
	n = get_int()
	li = get_list()
	sm = sum(li)
	k = max(li)
	while True:
		if k * n - sm > sm:
			print(k)
			break
		k += 1
if TestCases:
	for _ in range(get_int()):
		cProfile.run('main()') if test else main()
else:
	cProfile.run('main()') if test else main()


n = int(input())
Num = list(map(int, input().split()))
max = max(Num)
while max * n - sum(Num) <= sum(Num):
	max += 1
print(str(max))


k = 0
x = int(input())
a = list(map(int, input().split()))
r = max(a)
while k <= sum(a):
	k = r * len(a) - sum(a)
	r = r + 1
print(r - 1)


n = int(input())
a = list(map(int, input().split()))
maxa = max(a)
suma = sum(a)
k = maxa
while True:
	sumk = k * n
	sumb = sumk - suma
	if sumb > suma:
		print(k)
		break
	k += 1


a = int(input())
b = input().split()
c = 0
au = 0
el = 0
for i in range(a):
	el += int(b[i])
	if int(b[i]) > c:
		c = int(b[i])
au = c * a - el
if el > au:
	print((el - au) // a + 1 + int(c))
elif el == au:
	print(c + 1)
else:
	print(c)


n = int(input())
a = [int(i) for i in input().split()]
s = sum(a)
m = max(a)
ans = -1
for k in range(m, m * 10):
	if s < n * k - s:
		ans = k
		break
print(ans)


n = int(input())
a = list(map(int, input().split()))
el = sum(a)
k = max(a)
aur = k * n - el
while aur <= el:
	aur += n
	k += 1
print(k)


n = int(input())
a = [int(i) for i in input().split()]
b = sum(a)
for i in range(max(a), max(a) * 4):
	if n * i - b > b:
		print(i)
		break


n = int(input())
(m, o) = [0, 0]
a = list(map(int, input().split()))
b = max(a)
m = max(m, b)
o += sum(a)
o *= 2
o += n
o //= n
print(max(o, m))


n = int(input())
l = [int(x) for x in input().split()]
k = max(l)
su = sum(l)
su2 = su * 2 + 1
from math import ceil
print(max(k, ceil(su2 / n)))


n = input()
n = int(n)
arr = [0 for i in range(n)]
arr = input().split()
for i in range(n):
	arr[i] = int(arr[i])
a = sum(arr)
k = max(arr)
while n * k - a <= a:
	k = k + 1
print(k)


x = int(input())
max = 0
sum = 0
for i in input().split():
	i = int(i)
	if i > max:
		max = i
	sum += i
while not x * max - sum > sum:
	max += 1
print(max)


n = int(input())
l = [*map(int, input().split())]
k = max(l)
x = n * k
while x - sum(l) <= sum(l):
	x += n
	k += 1
print(k)


n = int(input())
a = [int(x) for x in input().split()]
init = sum(a)
m = max(a)
arr = [m - x for x in a]
summa = sum(arr)
while summa <= init:
	m += 1
	summa += n
print(m)


def main():
	n = int(input())
	votes = [int(c) for c in input().split()]
	k = max(votes)
	while True:
		sum_competitor = sum(votes)
		my_sum = sum([k - v for v in votes])
		if my_sum > sum_competitor:
			print(k)
			return
		k += 1
main()


class CodeforcesTask1043ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.votes = []

	def read_input(self):
		self.n = int(input())
		self.votes = [int(x) for x in input().split(' ')]

	def process_task(self):
		k = max(self.votes)
		while k * self.n - sum(self.votes) <= sum(self.votes):
			k += 1
		self.result = str(max(max(self.votes), k))

	def get_result(self):
		return self.result
Solution = CodeforcesTask1043ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


num = int(input())
lst = input().split()
for i in range(len(lst)):
	lst[i] = int(lst[i])
sumVotes = sum(lst)
outRes = 2 * sumVotes
outRes = int(outRes / num) + 1
lstMax = max(lst)
outRes = max(outRes, lstMax)
print(outRes)


import math
import sys
DEBUG = False

def inp():
	return sys.stdin.readline().rstrip()

def dprint(*value, sep=' ', end='\n'):
	if DEBUG:
		print(*value, sep=sep, end=end)

def solve(N, A):
	mx = max(A)
	sm = sum(A)
	return max(2 * sm // N + 1, mx)

def main():
	N = int(inp())
	A = [int(e) for e in inp().split()]
	assert len(A) == N
	print(solve(N, A))
main()


n = int(input())
lst = [int(x) for x in input().split()]
k = max(lst)
i = True
while i:
	if k * n - sum(lst) <= sum(lst):
		k += 1
		continue
	i = False
print(k)


n = int(input())
xs = list(map(int, input().split()))
max_x = max(xs)
bad = sum(xs)
good = sum((max_x - x for x in xs))
ans = 0
while True:
	if ans * n + good > bad:
		print(ans + max_x)
		break
	ans += 1


def scand():
	return int(input())

def scana():
	return [int(x) for x in input().split()]
n = scand()
a = scana()
summ = sum(a)
for i in range(max(a), 10000):
	if i * n - summ > summ:
		print(i)
		break


nb = int(input())
liste = [int(x) for x in input().split()]
k = max(liste)
adep = sum(liste)
r = 0
while True:
	for loop in range(len(liste)):
		r += k - liste[loop]
	if adep < r:
		break
	else:
		k += 1
		r = 0
print(k)


n = int(input())
a = [int(x) for x in input().split()]
elo = sum(a)
k = max(a)
s = 0
while 1:
	s = 0
	for i in range(n):
		s += k - a[i]
	if s > elo:
		break
	else:
		k += 1
print(k)


n = int(input())
d = 0
m = 0
l = list(map(int, input().split()))
for i in range(n):
	d += l[i]
	if l[i] > m:
		m = l[i]
for i in range(202):
	w = (i * n - 1) // 2
	if w >= d:
		break
print(max(m, i))


n = int(input())
s = map(int, input().split())
r = list(s)
for k in range(max(r), 10 ** 9):
	d = k * n - 2 * sum(r)
	if d > 0:
		print(k)
		break
	else:
		continue


n = int(input())
l = list(map(int, input().split()))
sum1 = x = 0
for i in l:
	sum1 += i
k = max(l)
while x <= sum1:
	x = k * n - sum1
	if x > sum1:
		break
	k += 1
print(k)


def sum(a):
	s = 0
	for i in a:
		s = s + i
	return s

def lst(a, k):
	x = []
	for i in a:
		x.append(abs(k - i))
	return x
n = int(input())
a = list(map(int, input().split()))
k = max(a)
while 1:
	if sum(lst(a, k)) > sum(a):
		break
	else:
		k += 1
print(k)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
k = max(a)
sum_k = 0
for x in a:
	sum_k += k - x
while sum_k <= s:
	k += 1
	sum_k = 0
	for x in a:
		sum_k += k - x
print(k)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
k = max(a)
r = sum([k - i for i in a])
d = r - s
if d > 0:
	print(k)
else:
	print(k + 1 + -d // n)


from math import ceil
n = int(input())
a = [int(i) for i in input().split(' ')]
k_float = 2 * sum(a) / n
if ceil(k_float) == k_float:
	k = ceil(k_float) + 1
else:
	k = ceil(k_float)
k = max(k, max(a))
print(k)


n = int(input())
li = list(map(int, input().split()))
b = sum(li)
a = max(li)
while a * n - b < b:
	a = a + 1
if a * n - b == b:
	print(a + 1)
else:
	print(a)


amount = int(input())
array = [int(s) for s in input().split()]
max_ = max(array)
sum_ = sum(array)
i = 1
while i * amount - sum_ <= sum_:
	i += 1
if i < max_:
	print(max_)
else:
	print(i)


n = int(input())
data = list(map(int, input().split()))
print(max(sum(data) * 2 // n + 1, *data))


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
m = max(l)
ans = 0
while True:
	if n * m - s > s:
		ans = m
		break
	m += 1
print(ans)


import math
n = int(input())
array = list(map(int, input().split()))
k = 2 * sum(array) // n + 1
v = max(array)
print(max(k, v))


input()
a = list(map(int, input().split()))
x = max(a)
while True:
	if x * len(a) - sum(a) > sum(a):
		break
	x += 1
print(x)


n = int(input())
arr = [int(i) for i in input().split(' ')]
m = max(arr)
s = 0
for each in arr:
	s = s + each
while True:
	ansv = m * n - s
	if ansv > s:
		print(m)
		break
	else:
		m = m + 1


n = int(input())
l = list(map(int, input().split()))
e = sum(l)
m = max(l)
a = 0
while e >= a:
	a = 0
	for i in range(n):
		a += m - l[i]
	m += 1
print(m - 1)


n = int(input())
l = list(map(int, input().split()))
b = sum(l)
k = max(l)
while True:
	a = n * k - b
	if a > b:
		print(k)
		break
	else:
		k = k + 1


from math import ceil
n = int(input())
a = list(map(int, input().split()))
S = 0
max = a[0]
for i in range(n):
	S = S + a[i]
	if max < a[i]:
		max = a[i]
k = ceil((1 + 2 * S) / n)
if k < max:
	k = max
print(k)


import sys
input = sys.stdin.readline
mii = lambda : map(int, input().split())
n = int(input())
a = list(mii())
k = max(a)
e = sum(a)
have = k * n - e
while have <= e:
	k += 1
	have += n
print(k)


from fractions import Fraction
import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def solve():
	n = int(inp())
	a = lis()
	s = sum(a)
	m = max(a)
	if 2 * s % n == 0:
		lol = 2 * s / n + 1
	else:
		lol = ceil(2 * s / n)
	print(max(int(lol), m))
testcase(1)


n = int(input())
ais = [int(a) for a in input().split()]
min_k = max(ais)
elodreip_votes = sum(ais)
awruk_votes = sum((min_k - a for a in ais))
needed_votes = elodreip_votes - awruk_votes + 1
if needed_votes < 0:
	needed_votes = 0
k = min_k + (needed_votes + n - 1) // n
print(k)


import math

def solve(xs):
	n = len(xs)
	max_vote = max(xs)
	other_votes = sum(xs)
	free = sum([max_vote - x for x in xs])
	other_votes = sum(xs)
	k = 1 + (other_votes - free + n * max_vote) // n
	return max(k, max_vote)
n = int(input())
xs = list(map(int, input().split()))[:n]
print(solve(xs))


n = int(input())
l = list(map(int, input().split()))

def f(l):
	k = max(l) - 1
	d = 0
	s = sum(l)
	while d <= s:
		k += 1
		d = 0
		for i in l:
			d += k - i
	return k
print(f(l))


import math
n = int(input())
sm = 0
mx = int(-10 ** 5)
for x in input().split():
	x = int(x)
	sm += x
	mx = max(x, mx)
k = math.floor(2 * sm / n) + 1
print(k if k >= mx else mx)


n = int(input())
suma = 0
mx = 0
for q in map(int, input().split()):
	suma += q
	if mx < q:
		mx = q
print(max(2 * suma // n + 1, mx))


n = int(input())
(*a,) = map(int, input().split())
k = max(a)
c = k * n - sum(a)
while c <= sum(a):
	k += 1
	c += n
print(k)


def main():
	num = input()
	temp_list = input().split(' ')
	main_list = []
	for i in range(len(temp_list)):
		main_list.append(int(temp_list[i]))
	add = sum(main_list)
	k = max(main_list)
	test_list = []
	z = 0
	while add >= z:
		for i in range(len(main_list)):
			test_list[:] = [k - j for j in main_list]
			z = sum(test_list)
		k += 1
	print(k - 1)
main()


import math
n = int(input())
a = list(map(int, input().split()))
k_min = max(a)
k = k_min
s_min = sum(a)
s = sum([k_min - x for x in a])
print(k_min + int(math.ceil(max(0, s_min - s + 1) / n)))


a = int(input())
b = input().split()
n = 0
s = 0
k = 0
for i in range(len(b)):
	n += int(b[i])
	s += 1
	if int(b[i]) > k:
		k = int(b[i])
m = 0
kk = 0
while m < n:
	m = 0
	for i in range(a):
		m += kk - int(b[i])
	if m > n:
		break
	else:
		kk += 1
if kk > k:
	print(kk)
else:
	print(k)


N = int(input())
votes = list(map(int, input().strip().split(' ')))
MAX = max(votes)
total = MAX * N
SUM = sum(votes)
while SUM >= MAX * N - SUM:
	MAX += 1
print(MAX)


n = int(input())
A = list(map(int, input().split()))
s = sum(A)
k = (2 * s - 1) // n + 1
k = max(k, max(A))
if n * k - s <= s:
	k += 1
print(k)


n = int(input())
a = list(map(int, input().split()))
s = 0
s1 = 0
mx = 0
for i in range(len(a)):
	s += a[i]
	if mx < a[i]:
		mx = a[i]
for i in range(len(a)):
	s1 += mx - a[i]
	a[i] = mx
l = mx
while s - s1 >= 0:
	s -= n
	l += 1
print(l)


n = int(input())
a = list(map(int, input().split()))
k = max(a)
v = []
for i in a:
	v.append(k - i)
z = sum(v)
while sum(a) >= z:
	z += n
	k += 1
print(k)


n = int(input())
vote = list(map(int, input().split()))
(votes, i) = (sum(vote), max(vote))
while True:
	if votes < i * n - votes:
		print(i)
		break
	i += 1


n = int(input())
l = list(map(int, input().split()))
j = int(2 * sum(l) / n) + 1
if j >= max(l):
	print(j)
else:
	print(max(l))


import math
n = int(input())
a = [int(x) for x in input().split()]
max_ = max(a)
temp = 2 * sum(a)
res = 0
if temp % n == 0:
	res = temp // n + 1
else:
	res = math.ceil(temp / n)
k = max(res, max_)
print(k)


n = int(input())
a = list(map(int, input().split()))
s = 0
for i in range(n):
	s = s + a[i]
k = s * 2 // n + 1
q = 0
m = 0
for i in range(n):
	if a[i] > k:
		q = 1
		if a[i] > m:
			m = a[i]
if q == 0:
	print(k)
else:
	print(m)


import sys
import math
n = int(input())
lisa = [int(x) for x in input().strip().split()]
suma = sum(lisa)
amax = max(lisa)
for i in range(amax, 500):
	if i * n - suma > suma:
		print(i)
		break


from functools import reduce
n = int(input())
arr = list(map(int, input().split(' ')))
k = max(arr)
while True:
	Elondreip = reduce(lambda x, a: a + x, arr, 0)
	Auruk = 0
	for x in arr:
		Auruk += k - x
	if Auruk > Elondreip:
		break
	else:
		k += 1
print(k)


n = int(input())
arr = list(map(int, input().strip().split()))
k = max(arr)
while True:
	s = sum(arr)
	if k * n > 2 * s:
		print(k)
		break
	else:
		k += 1


n = int(input())
A = [int(x) for x in input().split()]
max_a = 0
s = 0
for a in A:
	max_a = max(max_a, a)
	s += a
k = max_a
votes = 0
while True:
	votes = k * n - s
	if votes <= s:
		k += 1
	else:
		break
print(k)


n = int(input())
v = [int(x) for x in input().split()]
kmin = max(v)
vE = sum(v)
soma = 0
for i in range(len(v)):
	soma += kmin - v[i]
if soma > vE:
	print(kmin)
else:
	k = kmin
	while soma <= vE:
		soma += n
		k += 1
	print(k)


n = input()
k = [int(v) for v in input().split(' ')]
m = int(sum(k) * 2 / len(k))
print(max(m + 1, max(k)))


n = int(input())
A = list(map(int, input().split(' ')[:n]))
A.sort()
i = 0

def Do(i):
	Arr = []
	Arr = [i - x for x in A]
	if sum(Arr) > sum(A):
		print(i)
		exit()
	Do(i + 1)
Do(A[n - 1])


from math import ceil
n = int(input())
a = list(map(int, input().split()))
k = ceil((sum(a) * 2 + 1) / len(a))
print(max(k, *a))


n = int(input())
l = list(map(int, input().split()))
s = sum(l)
uk1 = 0
uk2 = 100000000
while uk2 - uk1 > 1:
	if n * ((uk2 + uk1) // 2) - s > s:
		uk2 = (uk2 + uk1) // 2
	else:
		uk1 = (uk2 + uk1) // 2
print(max(uk2, max(l)))


n = int(input())
l = list(map(int, input().split()))
m = max(l)
sm = sum(l)
while 1:
	a = 0
	for t in l:
		a += m - t
	if a > sm:
		print(m)
		break
	m += 1


import math
n = int(input())
a = list(map(int, input().split()))
sum_a = sum(a)
max_a = max(a)
(l, r) = (max_a - 1, 2 * max_a + 1)
while l != r - 1:
	tmp = (l + r) // 2
	if n * tmp > 2 * sum_a:
		r = tmp
	else:
		l = tmp
print(r)


def solve(n, a):
	k = max(a)
	e = sum(a)
	while True:
		if n * k - e > e:
			return k
		k += 1

def main():
	n = int(input())
	a = list(map(int, input().split()))
	print(solve(n, a))
main()


t = input()
t = int(t)
l = list(map(int, input().split()))
k = max(l)
if int(k * t - sum(l)) > sum(l):
	print(k)
else:
	print(int(int(2 * sum(l)) // t) + 1)


num = int(input())
s = []
for d in input().split(' '):
	s.append(int(d))
p = max(s)
w = 0
z = p
for x in range(0, num):
	w = w + s[x]
while w >= num * z - w:
	z = z + 1
print(z)


n = int(input())
arr = list(map(int, input().split()))
k = max(arr)
ls = [k - arr[i] for i in range(n)]
a = sum(arr)
b = sum(ls)
if b > a:
	print(k)
	exit()
cnt = 0
for i in range(k, 202):
	cnt += 1
	var = b + cnt * n
	if var > a:
		print(max(arr) + cnt)
		exit()


n = int(input())
l = [*map(int, input().split())]
M = max(l)
s = sum(l)
for i in range(M, 1000):
	ss = 0
	for j in l:
		ss += i - j
	if ss > s:
		print(i)
		break


n = int(input())
v = [int(i) for i in input().split()]
maxi = max(v)
votos = sum(v)
for i in range(maxi, 10005):
	soma = 0
	for j in range(n):
		soma += i - v[j]
	if soma > votos:
		print(i)
		exit()


n = int(input())
l = list(map(int, input().split()))
p = sum(l)
r = max(l)
d = 2 * p + 1
w = d % n
if w > 0:
	g = int(d / n) + 1
	if g >= r:
		print(g)
	else:
		print(r)
else:
	g = int(d / n)
	if g >= r:
		print(g)
	else:
		print(r)


t = int(input())
numbers = [int(f) for f in input().split()]
sumA = 0
m = max(numbers)
for i in numbers:
	sumA += i
res = 0
sumK = 0
while True:
	sumK = 0
	k = [m + res - f for f in numbers]
	for i in k:
		sumK += i
	if sumK <= sumA:
		res += 1
	else:
		print(m + res)
		break


n = int(input())
l = list(map(int, input().strip().split()))
s = sum(l)
m = max(l)
s1 = (2 * s + 1 + (n - 1)) // n
print(max(m, s1))


amount = int(input())
votes = list(map(int, input().split()))
sum = 0
k = 0
for elem in votes:
	sum += elem
	k = max(k, elem)
while k * amount - sum <= sum:
	k += 1
print(k)


import math
n = int(input())
arr = list(map(int, input().split()))
s = sum(arr)
m = max(arr)
k = (s + s + 1) / n
k = math.ceil(k)
if k < m:
	k = m
print(k)


IL = lambda : list(map(int, input().split()))
n = int(input())
A = IL()
v = sum(A) * 2 + 1
print(max(v // n + (v % n > 0), max(A)))


def main():
	n = int(input())
	votes = [int(_) for _ in input().split()]
	opponents_2 = sum(votes) * 2
	max_votes = max(votes)
	k = max(opponents_2 // n + 1, max_votes)
	print(k)
main()


n = int(input())
arr = list(map(int, input().split()))
maxval = max(arr)
sumx = sum(arr)
flag = 0
while maxval * n - sumx <= sumx:
	maxval += 1
print(maxval)


import math
n = int(input())
a = list(map(int, input().split()))
ma = max(a)
se = sum(a)
s = 0
c = 0
ad = 0
ns = 0
for i in range(n):
	s = s + (ma - a[i])
if s > se:
	print(ma)
else:
	c = se - s
	ad = math.ceil(c / n)
	y = ad + ma
	for i in range(n):
		ns = ns + (y - a[i])
	if ns > se:
		print(y)
	else:
		print(y + 1)


n = int(input())
a = input()
a = a.split(' ')
maks = 0
for i in range(0, n):
	if int(a[i]) > maks:
		maks = int(a[i])
a = a[0:n]
sum = 0
s = 0
for i in range(0, n):
	sum += int(a[i])
for i in range(0, n):
	s += maks - int(a[i])
while s <= sum:
	maks += 1
	s = 0
	for i in range(0, n):
		s += maks - int(a[i])
print(maks)


t = 1
for q in range(t):
	n = int(input())
	ch = input()
	L = [int(i) for i in ch.split()]
	s1 = sum(L)
	for k in range(max(L), 10000):
		s2 = 0
		for i in range(len(L)):
			s2 += k - L[i]
		if s2 > s1:
			print(k)
			break


n = int(input())
a = 0
maxa = 0
ai = input().split()
for i in ai:
	a += int(i)
	if int(i) > maxa:
		maxa = int(i)
k = 2 * a // n + 1
if maxa > k:
	print(maxa)
else:
	print(k)


from math import ceil
n = int(input())
p = [int(x) for x in input().split()]
s = sum(p)
m = max(p)
print(max(m, 2 * s // n + 1))


n = int(input())
t = list(map(int, input().split()))
p = sum(t)
for j in range(max(t), 10000000):
	if j * n - p > p:
		print(j)
		break


n = int(input())
a = list(map(int, input().split()))
for i in range(max(a), pow(10, 5)):
	s = 0
	for j in a:
		s += i - j
	if s > sum(a):
		print(i)
		break
	else:
		continue


n = int(input())
votes = list(map(int, input().split()))
print(max(sum(votes) * 2 // n + 1, max(votes)))


n = int(input())
num = list(map(int, input().split()))
x = max(num)
s = sum(num)
for i in range(x, 250):
	if i * n - s > s:
		print(i)
		break


import math
n = int(input())
Arr = input().split()
sum = 0
m = 0
for i in range(n):
	m = max(m, int(Arr[i]))
	sum += int(Arr[i])
sum += sum + 1
if sum % n == 0:
	size = sum // n
else:
	size = math.floor(sum / n) + 1
if size < m:
	print(m)
else:
	print(size)


from math import *
from itertools import permutations, combinations, accumulate
from functools import reduce
from fractions import gcd, Fraction

def scanline(dtype):
	return list(map(dtype, input().split()))

def log(*args):
	print('\x1b[1;40m\x1b[95m', *args, '\x1b[1;0m')
n = scanline(int)[0]
A = scanline(int)
s = sum(A)
for k in range(max(A), 500):
	if n * k - s > s:
		print(k)
		break


def calc(a):
	n = len(a)
	s = sum(a)
	k = 2 * s // n + 1
	return max(k, max(a))

def get_ints():
	return [int(n) for n in input().split()]

def get_floats():
	return [float(n) for n in input().split()]
a = get_ints()
assert len(a) == 1
n = a[0]
a = get_ints()
assert len(a) == n
k = calc(a)
print(k)


n = int(input())
a = list(map(int, input().split()))
summ = sum(a)
maxx = max(a)
res = maxx - 1
while True:
	res += 1
	sum2 = 0
	for i in a:
		sum2 += res - i
	if sum2 > summ:
		print(res)
		break


T = int(input())
v = [int(x) for x in input().split()]
sumi = sum(v)
totalreqd = 2 * sumi + 1
answer = (totalreqd + T - 1) // T
realanswer = max(answer, max(v))
print(realanswer)


n = int(input())
a = [int(x) for x in input().split()]
t = max(a)
s = sum(a)
d = t * n - s
if d > s:
	print(t)
else:
	while d <= s:
		t += 1
		d = t * n - s
	print(t)


from math import ceil

def main():
	n = int(input())
	a = list(map(int, input().split()))
	s = sum(a)
	m = max(a)
	if m * n - s > s:
		print(m)
		exit()
	else:
		ans = ceil((2 * s + 1) / n)
		print(ans)
		exit()
	return
main()


import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
maxa = max(a)
while True:
	if sum((x for x in a)) < n * maxa / 2:
		print(maxa)
		break
	else:
		maxa += 1


n = int(input())
votes = list(map(int, input().split()))
i = 1
k = max(votes)
total_votes = n * max(votes)
while total_votes <= 2 * sum(votes):
	total_votes += i * n
	k += i
print(k)


n = int(input())
data = [int(x) for x in input().strip().split(' ')]
k = max(data)
x1 = sum(data)
x2 = sum([k - data[i] for i in range(n)])
while x2 <= x1:
	k += 1
	x2 = sum([k - data[i] for i in range(n)])
print(k)


import math
n = int(input())
arr = list(map(int, input().split()))
res = math.ceil((2 * sum(arr) + 1) / n)
if res < max(arr):
	print(max(arr))
else:
	print(res)


n = int(input())
inp = input()
scores = list(map(int, inp.split(' ')))
k = max(scores)
bad_score = sum(scores)
while bad_score >= k * n - bad_score:
	k += 1
print(k)


n = int(input())
arr = [int(x) for x in input().split()]
k = max(arr)
nofEl = sum(arr)
nofAw = 0
while nofAw <= nofEl:
	nofAw = 0
	for i in range(len(arr)):
		nofAw += k - arr[i]
	if nofAw <= nofEl:
		k += 1
print(k)


n = int(input())
num = list(map(int, input().split()))
p = max(num)
q = sum(num)
for i in range(p, 250):
	if i * n - q > q:
		print(i)
		break


from math import ceil
n = int(input())
a = list(map(int, input().split()))
kk = max(a)
k = (2 * sum(a) + n) // n
print(max(k, kk))


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
for k in range(max(a), 999999):
	vote = sum((k - x for x in a))
	if vote > s:
		print(k)
		break


import sys
import math
input = sys.stdin.readline
n = int(input())
l = list(map(int, input().split()))
s = sum(l)
print(max(max(l), 2 * s // n + 1))


n = int(input())
a = list(map(int, input().split()))
m = max(a)
s = sum(a)
m1 = 2 * m + 2
for i in range(m, m1):
	d = 0
	for j in range(n):
		d += i - a[j]
	if d > s:
		break
print(i)


import math
input()
arr = list(map(int, input().split()))
votes = sum(arr)
l = math.floor(votes * 2 / len(arr)) + 1
print(max(max(arr), l))


a = int(input())
k = list(map(int, input().split()))
b = sum(k)
c = max(k)
while b > a * c - b - 1:
	c += 1
print(c)


import random
n = int(input())
arr = list(map(int, input().split()))
point = max(arr)
e_s = sum(arr)
for i in range(max(arr), 1000000000):
	a_s = 0
	for j in range(0, n):
		a_s += abs(arr[j] - i)
	if a_s > e_s:
		print(i)
		break
	else:
		continue


n = int(input())
l = list(map(int, input().split()))
su1 = sum(l)
k = max(l)
while True:
	su = 0
	for i in l:
		su += k - i
	if su > su1:
		print(k)
		exit()
	k += 1


import math
n = int(input())
l = input().split()
li = [int(i) for i in l]
x = sum(li)
print(max(math.ceil((2 * x + 1) / n), max(li)))


n = int(input())
studs = [int(i) for i in input().split()]
sums = sum(studs)
maxs = max(studs)
votes = 0
while votes < sums:
	votes = maxs * n - sums
	if votes > sums:
		print(str(maxs))
	else:
		maxs += 1
		votes = 0


n = int(input())
s = list(map(int, input().split()))
sm = sum(s)
mx = max(s)
for i in range(mx, 1000000):
	if i * n - sm > sm:
		print(i)
		break


import math
n = int(input())
l = list(map(int, input().split()))
a = sum(l)
maxx = max(l)
b = (1 + 2 * a) / n
b = math.ceil(b)
if b >= maxx:
	print(b)
else:
	print(maxx)


n = int(input())
arr = list(map(int, input().split()))
total = 0
mx = 0
for a in arr:
	total += a
	mx = max(mx, a)
k = (2 * total + n) // n
print(max(k, mx))


n = int(input())
a = list(map(int, input().split()))
s = 0
c = 0
k = max(a)
for i in a:
	s += k - i
	c += i
while c >= s:
	s += n
	k += 1
print(k)


import sys
import math
get_string = lambda : sys.stdin.readline().strip()
get_list = lambda : list(map(int, sys.stdin.readline().strip().split()))
get_intList_from_str = lambda : list(map(int, list(sys.stdin.readline().strip())))
get_strList_from_str = lambda : list(sys.stdin.readline().strip())
get_int = lambda : int(sys.stdin.readline().strip())
pt = lambda x: sys.stdout.write(str(x))
a = get_int()
votes = get_list()
s = sum(votes)
n = math.ceil((2 * s + 1) / a)
print(max(max(votes), n))


n = int(input())
a = input().split()
e = 0
for i in range(n):
	e += int(a[i])
mini = 2 * e // n + 1
for i in range(n):
	mini = max(int(a[i]), mini)
print(mini)


a = int(input())
k = []
sum = 0
k = input().split()
for i in k:
	sum = sum + int(i)
z = 2 * sum // a + 1
for i in k:
	if z < int(i):
		z = int(i)
print(z)


n = int(input())
a = list(map(int, input().split()))
x = max(a)
c = 0
y = 0
for i in a:
	c += x - i
	y += i
if y < c:
	print(x)
else:
	z = 0
	while c <= y:
		c += n
		z += 1
	print(x + z)


from sys import stdin, stdout
from math import sin, tan, cos
n = int(stdin.readline())
vl = list(map(int, stdin.readline().split()))
for i in range(max(vl), 300):
	if i * n - sum(vl) > sum(vl):
		stdout.write(str(i))
		break


n = int(input())
a = input().split(' ')
a = list(map(int, a))
suma = sum(a)
sumau = 0
k = max(a)
while suma >= sumau:
	for x in a:
		u = k - x
		sumau += u
	if suma >= sumau:
		sumau = 0
		k += 1
print(k)


n = int(input())
data = list(map(int, input().split()))
sg1 = 0
sg2 = 0
for i in data:
	sg2 += i
maxi = max(data)
for i in range(maxi, 100 * 100):
	for k in data:
		sg1 += i - k
	if sg1 > sg2:
		print(i)
		break
	sg1 = 0


(n, a) = (int(input()), list(map(int, input().split())))
(s, ans) = (sum(a), max(a))
while True:
	s1 = sum([ans - a[i] for i in range(n)])
	if s1 > s:
		break
	ans += 1
print(ans)


n = int(input())
adi = list(map(int, input().split()))
k = max(adi)
ayu = [0] * n
while sum(ayu) <= sum(adi):
	for x in range(n):
		ayu[x] = k - adi[x]
	k += 1
print(k - 1)


n = int(input())
l = list(map(int, input().split()))
t = max(l)
x = [t - r for r in l]
while sum(x) <= sum(l):
	x = [z + 1 for z in x]
print(x[0] + l[0])


n = int(input())
arr = list(map(int, input().split()))
k = max(arr)
a = sum(arr)
b = 0
while b <= a:
	b = sum((k - x for x in arr))
	k += 1
print(k - 1)


R = lambda : map(int, input().split())
(n, a) = (int(input()), sorted(list(R())))
print(max(max(a), (2 * sum(a) + n) // n))


def solve(A):
	k = max(A)
	F = {}
	for x in A:
		F[x] = A.count(x)
	opponent = sum((x * F[x] for x in F))
	myvotes = sum(((k - x) * F[x] for x in F))
	while myvotes <= opponent:
		k = k + 1
		myvotes = sum(((k - x) * F[x] for x in F))
	print(k)
N = int(input())
A = list(map(int, input().split()))
solve(A)


from math import ceil
n = int(input())
votes = list(map(int, input().strip().split()))
sumv = sum(votes)
print(max(1 + 2 * sumv // n, max(votes)))


t = int(input())
arr = list(map(int, input().split()))
sum1 = 0
sum2 = 0
for i in range(0, t):
	sum1 = sum1 + arr[i]
n = max(arr)
while n:
	for i in range(0, t):
		sum2 = sum2 + (n - arr[i])
	if sum2 > sum1:
		break
	else:
		n = n + 1
		sum2 = 0
print(n)


n = int(input())
k = input().split()
sec = []
elodreip = 0
for i in k:
	sec.append(int(i))
	elodreip += int(i)
sec.sort()
auruk = 0
max = sec[-1]
while auruk < elodreip:
	for i in sec:
		auruk += max - i
	if auruk <= elodreip:
		auruk = 0
		max += 1
print(max)


b = int(input())
a = list(map(int, input().split()))
c = sum(a)
d = max(a)
while True:
	if d * b - c > c:
		print(d)
		quit()
	d += 1


from collections import deque
from math import sqrt, ceil

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def li():
	return list(mi())

def isprime(n):
	if n == 1:
		return 0
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			return 0
	return 1
n = ii()
a = li()
s = sum(a)
s1 = 0
x = max(a)
for i in a:
	s1 += x - i
if s >= s1:
	y = s - s1
	y = ceil(y / n)
	s1 += y * n
	if s == s1:
		y += 1
	print(x + y)
else:
	print(x)


n = int(input())
a = [int(i) for i in input().split()]
(m, s) = (max(a), sum(a))
aur = n * m - s
i = 0
while aur <= s:
	aur += n
	i += 1
print(m + i)


n = int(input())
l = list(map(int, input().split(' ')))
s = sum(l)
k = max(l)
i = 0
sum = 0
while i <= n:
	sum = sum + (k - l[i])
	i = i + 1
	if i == n:
		if sum > s:
			print(k)
			break
		elif sum == s:
			print(k + 1)
			break
		else:
			k = k + 1
			i = 0
			sum = 0


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
n = read_int()
votes = read_ints()
vote_sum = sum(votes)
max_vote = max(votes)
ans = max(max_vote, 2 * vote_sum // n + 1)
print(ans)


n = int(input())
v = input().split()
k = 0
for i in range(len(v)):
	v[i] = int(v[i])
	k = k + v[i]
k = int(2 * k / n)
if max(v) > k:
	k = max(v)
else:
	k = k + 1
print(k)


import math
n = int(input())
a = list(map(int, input().strip().split()))
rival = 0
maximum = max(a)
for i in range(n):
	rival += a[i]
k = math.ceil(2 * rival / n)
if k > maximum:
	answer = k
else:
	answer = maximum
if answer * n - rival == rival:
	answer += 1
print(answer)


n = int(input())
n1 = list(map(int, input().split()))
s = sum(n1)
w = max(n1)
lst = []
while True:
	lst = []
	for i in n1:
		lst.append(w - i)
	if sum(lst) > s:
		print(w)
		break
	else:
		w = w + 1


n = int(input())
a = [int(x) for x in input().split()]
k = max(a)
while True:
	votes = a
	votes = list(map(lambda x: k - x, votes))
	if sum(votes) > sum(a):
		break
	k += 1
print(k)


n = int(input())
voices = list(map(int, input().split()))
max_voice = max(voices) - 1
aur_sum = 0
count = 0
while aur_sum <= sum(voices):
	count += 1
	max_voice += 1
	aur_sum = 0
	for i in range(n):
		aur_sum += max_voice - voices[i]
print(max_voice)


n = int(input())
a = list(map(int, input().split()))
s = sum(a)
print(max(max(a), (s + s + n) // n))


n = int(input())
l = list(map(int, input().split()))
m = max(l)
s = sum(l)
c = 0
for i in range(n):
	c += m - l[i]
while c <= s:
	c += n
	m += 1
print(m)


count = int(input())
votes = list(map(int, input().split()))
votes_sum = sum(votes)
print(max(max(votes), 2 * votes_sum // count + 1))


n = int(input())
a = list(map(int, input().split()))
sume = sum(a)
sumw = 0
maxa = max(a)
for i in range(n):
	sumw += abs(maxa - a[i])
while sumw <= sume:
	sumw = 0
	for i in range(n):
		sumw += abs(maxa - a[i])
	if sumw > sume:
		break
	maxa += 1
print(maxa)


n = int(input())
l = list(map(int, input().split()))
sm1 = sum(l)
x = max(l)
sm2 = x * n - sm1
i = 0
while sm2 <= sm1:
	x += 1
	sm2 = x * n - sm1
	i += 1
print(x)


n = int(input())
arr = list(map(int, input().split()))
k = max(arr)
counta = 0
countb = sum(arr)
for a in arr:
	counta += k - a
if counta <= countb:
	k += (countb - counta) // n + 1
print(k)


n = int(input())
a = list(map(int, input().split()))
(Max, Sum) = (0, 0)
for i in range(n):
	Max = max(Max, a[i])
	Sum += a[i]
print(max(Max, (Sum * 2 + n) // n))


n = int(input())
votesE = [int(x) for x in input().split(' ')]
k = max(votesE)
votesA = [k - x for x in votesE]
while sum(votesA) <= sum(votesE):
	k += 1
	votesA = [k - x for x in votesE]
print(k)


N = int(input())
A = list(map(int, input().split()))
sumA = sum(A)
ans = 2 * sumA // N + 1
ans = max(max(A), ans)
print(ans)


n = int(input())
l = list(map(int, input().split()))
m = max(l)
s = sum(l)
for i in range(m, 100000):
	c = 0
	for j in range(n):
		c = c + (i - l[j])
	if c > s:
		print(i)
		break


n = int(input())
s = list(map(int, input().split()))
oppSum = sum(s)
k = max(s)
while True:
	mySum = sum([k - x for x in s])
	if mySum > oppSum:
		print(k)
		break
	k += 1


from sys import stdin, stdout
from math import *

def main():
	global n, a
	n = int(stdin.readline())
	a = [int(x) for x in stdin.readline().split()]
	k = max(a)
	awr = sum([k - x for x in a])
	elo = sum(a)
	while awr <= elo:
		k = k + 1
		awr = awr + n
	stdout.write(str(k))
	return 0
main()


import math

def singleInput():
	return int(input())

def listInput():
	return list(map(int, input().split()))

def spacedInput():
	return map(int, input().split())
n = singleInput()
number = listInput()
(maximum, total) = (max(number), sum(number))
other_total = sum([maximum - x for x in number])
if total < other_total:
	addition = 0
else:
	addition = math.ceil((total - other_total + 1) / n)
print(maximum + addition)


q = lambda : map(int, input().split())
qi = lambda : int(input())
qs = lambda : input().split()
n = qi()
a = sorted([*q()])
k = a[-1]
while sum((k - i for i in a)) <= sum(a):
	k += 1
print(k)


a = int(input())
c = list(map(int, input().split()))
z = max(c)
while z * len(c) / 2 <= sum(c):
	z += 1
print(z)


n = int(input())
z = [int(i) for i in input().split()]
a = max(z)
p = sum(z)
i = 0
while (a + i) * n - p <= p:
	i += 1
print(a + i)


n = int(input())
a = list(map(int, input().split()))
k = 0
while k * len(a) - sum(a) <= sum(a):
	k += 1
if k < max(a):
	k = max(a)
print(k)


n = int(input())
a = list(map(int, input().split()))
sa = sum(a)
ba = sa + 1
k = 2 * sa // n + 1
print(max(k, max(a)))


n = int(input())
a = list(map(int, input().split()))
e = sum(a)

def check(m, ar):
	s = 0
	for i in ar:
		s += m - i
	return s
st = max(a)
while check(st, a) <= e:
	st += 1
print(st)


x = int(input())
a = list(map(int, input().split()))
b = max(a)
n = sum(a)
while True:
	if n < x * b / 2:
		print(b)
		exit()
	else:
		b += 1


n = int(input())
l = list(map(int, input().split()))
l.sort()
sum1 = 0
for i in range(n):
	sum1 += l[i]
i = l[-1]
while n * i - sum1 <= sum1:
	i += 1
print(i)


N = int(input())
L = list(map(int, input().split()))
X = sum(L)
K = max(L)
sum = 0
Y = 1
while Y:
	sum = K * N - X
	if sum > X:
		print(K)
		break
	K += 1


n = int(input())
ar = list(map(int, input().split()))
print(max(max(ar), sum(ar) * 2 // n + 1))


n = int(input())
a = list(map(int, input().split()))
suma = sum(a)
b = max(a)
if n * b - suma > suma:
	print(b)
else:
	while 1:
		b += 1
		if n * b - suma > suma:
			print(b)
			break


def main():
	n = int(input())
	a = [int(x) for x in input().strip().split()]
	b = 2 * sum(a)
	k = max(b // n + 1, max(a))
	print(k)
main()


stud = int(input())
vote = [int(i) for i in input().split()]
max_vote = 0
for i in vote:
	max_vote = max(max_vote, i)
enemy = sum(vote)
while max_vote * stud - enemy <= enemy:
	max_vote += 1
print(max_vote)


n = int(input())
a = list(map(int, input().split()))
vse = False
k = max(a)
while vse == False:
	(k1, k2) = (0, 0)
	for i in range(n):
		k1 += a[i]
		k2 += k - a[i]
	if k2 <= k1:
		k += 1
	else:
		vse = True
print(k)


n = int(input())
A = [*map(int, input().split())]
e = sum(A)
max_ = max(A)
a = max_ * n - e
need = max(0, e - a + 1)
up = need + -need % n
print(max_ + up // n)