头条笔试
头条这个题目有毒吧,第五题本地没问题,在线java和python都报错,时间都浪费在找原因上了。。mmp
high=0
n,k,h=(int(i) for i in raw_input().strip().split(' '))taijie=[]
for i in range(n):
b=int(raw_input().strip('/n'))
taijie.append(b)
taijie.sort()
if taijie[0]>2:
print 0
while k>0 and taijie:
if taijie[0]-high<=h:
high+=2*(taijie.pop(0)-high)
k-=1
else:
break
print high