T = int(input())
l = [250000 * i for i in range(1,7)]
s = 0
while T > 0:
N = int(input())
if N//100 <= 2500:
print(N)
else:
for i in range(1,len(l)):
k = (i*5)/100
if N < l[i]:
s += int((N-l[i-1])*k)
break
else:
s += int((l[i]-l[i-1])*k)
if N > l[-1]:
N_S = N - int(s+(N-l[-1])*.30)
else:
N_S = N - s
print(N_S)
T-=1