In India, every individual is charged with income tax on the total income each year. This tax is applied to specific ranges of income, which are called income tax slabs. The slabs of income tax keep changing from year to year. This fiscal year (2020-21), the tax slabs and their respective tax rates are as follows:Total income (in rupees)Tax rateup to Rs. 250,0000%from Rs. 250,001 to Rs. 500,0005%from Rs. 500,001 to Rs. 750,00010%from Rs. 750,001 to Rs. 1,000,00015%from Rs. 1,000,001 to Rs. 1,250,00020%from Rs. 1,250,001 to Rs. 1,500,00025%above Rs. 1,500,00030%
See the sample explanation for details on how the income tax is calculated.
You are given Chef's total income: $N$ rupees (Rs.). Find his net income. The net income is calculated by subtracting the total tax (also called tax reduction) from the total income. Note that you do not need to worry about any other kind of tax reductions, only the one described above.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains a single integer $N$.

-----Output-----
For each test case, print a single line containing one integer — Chef's net income.

-----Constraints-----
- $1 \le T \le 10^3$
- $0 \le N \le 10^7$
- $N$ is a multiple of $100$

-----Example Input-----
2
600000
250000

-----Example Output-----
577500
250000

-----Explanation-----
Example case 1: We know that the total income is Rs. $6$ lakh ($1$ lakh rupees = $10^5$ rupees). The total tax for each slab is calculated as follows:
- Up to $2.5$ lakh, the tax is Rs. $0$, since the tax rate is $0$ percent.
- From above Rs. $2.5$ lakh to Rs. $5$ lakh, the tax rate is $5$ percent. Therefore, this tax is $0.05 \cdot (500,000-250,000)$, which is Rs. $12,500$.
- From above Rs. $5$ lakh to Rs. $6$ lakh, the tax rate is $10$ percent. Therefore, this tax is $0.10 \cdot (600,000-500,000)$, which is Rs. $10,000$.
- Summing them up, we get that the total tax on Chef's whole income is Rs. $22,500$. Since the net income is the total income minus the tax reduction, it is Rs. $600,000$ minus Rs. $22,500$, which is Rs. $577,500$.
Example case 2: For income up to Rs. $2.5$ lakh, we have no tax, so the net income is the same as the total income: Rs. $2.5$ lakh.

Difficulty: MEDIUM
Tags: Implementation

Starter code:

Solutions:
for _ in range(int(input())):
	income = int(input())
	to_subtract = 0
	brackets = [0, 0, 12500, 25000, 37500, 50000, 62500, 75000]
	bracket = 0
	if income > 1500000:
		bracket = 7
	elif income > 1250000:
		bracket = 6
	elif income > 1000000:
		bracket = 5
	elif income > 750000:
		bracket = 4
	elif income > 500000:
		bracket = 3
	elif income > 250000:
		bracket = 2
	else:
		bracket = 1
	new_list = brackets[0:bracket]
	full_subtracts = sum(new_list)
	to_subtract += full_subtracts
	unfulled = income - (bracket - 1) * 250000
	unfulled_subtract = unfulled * (0.05 * (bracket - 1))
	to_subtract += unfulled_subtract
	print(int(income - to_subtract))


t = int(input())
for i in range(t):
	n = int(input())
	tax = 0
	if n <= 250000:
		pass
	elif n >= 250001 and n <= 500000:
		tax = (n - 250000) * 0.05
	elif n >= 500001 and n <= 750000:
		tax = (500000 - 250000) * 0.05 + (n - 500000) * 0.1
	elif n >= 750001 and n <= 1000000:
		tax = (500000 - 250000) * 0.05 + (750000 - 500000) * 0.1 + (n - 750000) * 0.15
	elif n >= 1000001 and n <= 1250000:
		tax = (500000 - 250000) * 0.05 + (750000 - 500000) * 0.1 + (1000000 - 750000) * 0.15 + (n - 1000000) * 0.2
	elif n >= 1250001 and n <= 1500000:
		tax = (500000 - 250000) * 0.05 + (750000 - 500000) * 0.1 + (1000000 - 750000) * 0.15 + (1250000 - 1000000) * 0.2 + (n - 1250000) * 0.25
	else:
		tax = (500000 - 250000) * 0.05 + (750000 - 500000) * 0.1 + (1000000 - 750000) * 0.15 + (1250000 - 1000000) * 0.2 + (1500000 - 1250000) * 0.25 + (n - 1500000) * 0.3
	print(int(n - tax))


t = int(input())
for i in range(t):
	x = int(input())
	sum = 0
	if x > 250000 and x <= 500000:
		sum += (x - 250000) // 20
	elif x > 500000 and x <= 750000:
		sum += 12500 + (x - 500000) // 10
	elif x > 750000 and x <= 1000000:
		sum += 37500 + 3 * (x - 750000) // 20
	elif x > 1000000 and x <= 1250000:
		sum += 75000 + (x - 1000000) // 5
	elif x > 1250000 and x <= 1500000:
		sum += 125000 + (x - 1250000) // 4
	elif x > 1500000:
		sum += 187500 + 3 * (x - 1500000) // 10
	print(x - sum)


IterNum = int(input())
for i in range(IterNum):
	currentNum = int(input())
	subtNum = 0
	ExtraIncome = 0
	if currentNum <= 250000:
		print(currentNum)
		continue
	else:
		taxRate = currentNum // 250000
		if taxRate < 6:
			for j in range(1, taxRate + 1):
				if currentNum - j * 250000 <= 250000:
					subtNum += (currentNum - j * 250000) * j / 20
					break
				subtNum += 250000 * j / 20
		else:
			subtNum += 187500
			ExtraIncome = currentNum - 1500000
			subtNum += ExtraIncome * 3 / 10
		print(int(currentNum - subtNum))


for x in range(int(input())):
	untax = int(input())
	tax = 0
	if untax <= 250000:
		pass
	elif untax > 250000 and untax <= 500000:
		tax = (untax - 250000) * 0.05
	elif untax > 500000 and untax <= 750000:
		tax = 12500 + (untax - 500000) * 0.1
	elif untax > 750000 and untax <= 1000000:
		tax = 12500 + 25000 + (untax - 750000) * 0.15
	elif untax > 1000000 and untax <= 1250000:
		tax = 12500 + 25000 + 37500 + (untax - 1000000) * 0.2
	elif untax > 1250000 and untax <= 1500000:
		tax = 12500 + 25000 + 37500 + 50000 + (untax - 1250000) * 0.25
	else:
		tax = 12500 + 25000 + 37500 + 50000 + 62500 + (untax - 1500000) * 0.3
	print(int(untax - tax))


for _ in range(int(input())):
	n = int(input())
	x = n // 250000
	c = x * 250000
	r = n - c
	tax = 0
	if n <= 1500000:
		i = 0
		while c > 0:
			tax += i * 12500
			c -= 250000
			i += 1
		t1 = x * 0.05 * r
		tax += t1
	else:
		i = 0
		d = n - 1500000
		k = 1500000
		while k > 0:
			tax += i * 12500
			k -= 250000
			i += 1
		t1 = d * 0.3
		tax += t1
	print(int(n - tax))


t = int(input())
for _ in range(t):
	n = int(input())
	ans = 0
	if n > 250000:
		if n <= 500000:
			ans += (n - 250000) * 5 // 100
		else:
			ans += (500000 - 250000) * 5 // 100
	if n > 500000:
		if n <= 750000:
			ans += (n - 500000) * 10 // 100
		else:
			ans += (750000 - 500000) * 10 // 100
	if n > 750000:
		if n <= 1000000:
			ans += (n - 750000) * 15 // 100
		else:
			ans += (1000000 - 750000) * 15 // 100
	if n > 1000000:
		if n <= 1250000:
			ans += (n - 1000000) * 20 // 100
		else:
			ans += (1250000 - 1000000) * 20 // 100
	if n > 1250000:
		if n <= 1500000:
			ans += (n - 1250000) * 25 // 100
		else:
			ans += (1500000 - 1250000) * 25 // 100
	if n > 1500000:
		ans += (n - 1500000) * 30 // 100
	print(n - ans)


T = int(input())
for I in range(T):
	tax = 0
	n = int(input())
	if n > 250000:
		tax = (n - 250000) * 0.05
	if n > 500000:
		tax += (n - 500000) * 0.05
	if n > 750000:
		tax += (n - 750000) * 0.05
	if n > 1000000:
		tax += (n - 1000000) * 0.05
	if n > 1250000:
		tax += (n - 1250000) * 0.05
	if n > 1500000:
		tax += (n - 1500000) * 0.05
	n = n - tax
	n = int(n)
	print(n)


t = int(input())
for i in range(t):
	a = int(input())
	tax = 0
	if a <= 250000:
		print(a)
	else:
		if a > 250000 and a <= 500000:
			tax = tax + (a - 250000) * 0.05
		elif a > 500000 and a <= 750000:
			tax = tax + 250000 * 0.05 + (a - 500000) * 0.1
		elif a > 750000 and a <= 1000000:
			tax = tax + 250000 * 0.05 + 250000 * 0.1 + (a - 750000) * 0.15
		elif a > 1000000 and a <= 1250000:
			tax = tax + 250000 * 0.05 + 250000 * 0.1 + 250000 * 0.15 + (a - 1000000) * 0.2
		elif a > 1250000 and a <= 1500000:
			tax = tax + 250000 * 0.05 + 250000 * 0.1 + 250000 * 0.15 + 250000 * 0.2 + (a - 1250000) * 0.25
		elif a > 1500000:
			tax = tax + 250000 * 0.05 + 250000 * 0.1 + 250000 * 0.15 + 250000 * 0.2 + 250000 * 0.25 + (a - 1500000) * 0.3
		print(int(a - tax))


t = int(input())
for _ in range(t):
	n = int(input())
	slab = n // 250000
	if slab > 6:
		slab = 6
	s = 0
	for i in range(1, slab):
		s = s + 250000 / 100 * (i * 5)
	x = 250000 * slab
	yr = n - x
	s = s + yr / 100 * (slab * 5)
	print(int(n - s))


for i in range(int(input())):
	x = int(input())
	l = [250000, 500000, 750000, 1000000, 1250000, 1500000]
	l1 = [0.05, 0.1, 0.15, 0.2, 0.25, 0.3]
	count = 0
	if x <= l[0]:
		print(x)
	else:
		for i in range(1, len(l)):
			if x <= l[i]:
				p = x - l[i - 1]
				count = count + p * l1[i - 1]
				break
			else:
				p = l[i] - l[i - 1]
				count = l1[i - 1] * p + count
		else:
			p = x - l[len(l) - 1]
			count = p * l1[len(l1) - 1] + count
		print(int(x - count))


t = int(input())
for i in range(t):
	n = int(input())
	m = n
	tax = 0
	if n > 1500000:
		tax = tax + 0.3 * (n - 1500000)
		n = 1500000
	if n > 1250000:
		tax = tax + 0.25 * (n - 1250000)
		n = 1250000
	if n > 1000000:
		tax = tax + 0.2 * (n - 1000000)
		n = 1000000
	if n > 750000:
		tax = tax + 0.15 * (n - 750000)
		n = 750000
	if n > 500000:
		tax = tax + 0.1 * (n - 500000)
		n = 500000
	if n > 250000:
		tax = tax + 0.05 * (n - 250000)
		n = 250000
	print(int(m - tax))


try:
	for _ in range(int(input())):
		x = int(input())
		if x <= 250000:
			print(x)
		elif x <= 500000:
			res = x - (x - 250000) * 0.05
			print(int(res))
		elif x <= 750000:
			res = x - (12500 + (x - 500000) * 0.1)
			print(int(res))
		elif x <= 1000000:
			res = x - (12500 + 25000 + (x - 750000) * 0.15)
			print(int(res))
		elif x <= 1250000:
			res = x - (12500 + 25000 + 37500 + (x - 1000000) * 0.2)
			print(int(res))
		elif x <= 1500000:
			res = x - (12500 + 25000 + 37500 + 50000 + (x - 1250000) * 0.25)
			print(int(res))
		else:
			res = x - (12500 + 25000 + 37500 + 50000 + 62500 + (x - 1500000) * 0.3)
			print(int(res))
except:
	pass


for t in range(int(input())):
	n = int(input())
	a = 0
	if n > 250000 and n <= 500000:
		a += (n - 250000) * 0.05
	elif n > 500000 and n <= 750000:
		a += (n - 500000) * 0.1 + 12500
	elif n > 750000 and n <= 1000000:
		a += (n - 750000) * 0.15 + 37500
	elif n > 1000000 and n <= 1250000:
		a += (n - 1000000) * 0.2 + 75000
	elif n > 1250000 and n <= 1500000:
		a += (n - 1250000) * 0.25 + 125000
	elif n > 1500000:
		a += (n - 1500000) * 0.3 + 187500
	print(int(n - a))


T = int(input())
for I in range(T):
	n = int(input())
	if n > 250000 and n <= 500000:
		n = (n - 250000) * 0.95 + 250000
	elif n > 500000 and n <= 750000:
		n = (n - 500000) * 0.9 + 250000 * 0.95 + 250000
	elif n > 750000 and n <= 1000000:
		n = (n - 750000) * 0.85 + 250000 * 0.9 + 250000 * 0.95 + 250000
	elif n > 1000000 and n <= 1250000:
		n = (n - 1000000) * 0.8 + 250000 * 0.85 + 250000 * 0.9 + 250000 * 0.95 + 250000
	elif n > 1250000 and n <= 1500000:
		n = (n - 1250000) * 0.75 + 250000 * 0.8 + 250000 * 0.85 + 250000 * 0.9 + 250000 * 0.95 + 250000
	elif n > 1500000:
		n = (n - 1500000) * 0.7 + 250000 * 0.75 + 250000 * 0.8 + 250000 * 0.85 + 250000 * 0.9 + 250000 * 0.95 + 250000
	print(int(n))


for _ in range(int(input())):
	n = int(input())
	tax = 0
	if n <= 250000:
		tax += 0
	elif n <= 500000:
		tax += (n - 250000) * 0.05
	elif n <= 750000:
		tax += (n - 500000) * 0.1 + (500000 - 250000) * 0.05
	elif n <= 1000000:
		tax += (n - 750000) * 0.15 + (750000 - 500000) * 0.1 + (500000 - 250000) * 0.05
	elif n <= 1250000:
		tax += (n - 1000000) * 0.2 + (1000000 - 750000) * 0.15 + (750000 - 500000) * 0.1 + (500000 - 250000) * 0.05
	elif n <= 1500000:
		tax += (n - 1250000) * 0.25 + (1250000 - 1000000) * 0.2 + (1000000 - 750000) * 0.15 + (750000 - 500000) * 0.1 + (500000 - 250000) * 0.05
	else:
		tax += (n - 1500000) * 0.3 + (1500000 - 1250000) * 0.25 + (1250000 - 1000000) * 0.2 + (1000000 - 750000) * 0.15 + (750000 - 500000) * 0.1 + (500000 - 250000) * 0.05
	print(int(n - tax))


t = int(input())
for _ in range(t):
	n = int(input())
	net_tax = 0
	for i in range(6):
		if n > (i + 1) * 250000:
			net_tax += 250000 * 0.05 * i
		else:
			x = n - 250000 * i
			net_tax += x * 0.05 * i
			break
	else:
		x = n - 1500000
		net_tax += x * 0.3
	print(n - int(net_tax))


for x in range(int(input())):
	n = int(input())
	s = 0
	if n <= 250000:
		s = n
	elif n <= 500000:
		s = n - (n - 250000) * 0.05
	elif n <= 750000:
		s = n - (250000 * 0.05 + (n - 500000) * 0.1)
	elif n <= 1000000:
		s = n - (250000 * 0.15 + (n - 750000) * 0.15)
	elif n <= 1250000:
		s = n - (250000 * 0.3 + (n - 1000000) * 0.2)
	elif n <= 1500000:
		s = n - (250000 * 0.5 + (n - 1250000) * 0.25)
	elif n > 1500000:
		s = n - (250000 * 0.75 + (n - 1500000) * 0.3)
	print(int(s))


for _ in range(int(input())):
	n = int(input())
	net = 0
	tax = 0
	if n <= 250000:
		print(int(n))
	elif n <= 500000:
		tax = (n - 250000) * 0.05
		print(int(n - tax))
	elif n <= 750000:
		tax = 12500 + (n - 500000) * 0.1
		print(int(n - tax))
	elif n <= 1000000:
		tax = 12500 + 25000 + (n - 750000) * 0.15
		print(int(n - tax))
	elif n <= 1250000:
		tax = 12500 + 25000 + 37500 + (n - 1000000) * 0.2
		print(int(n - tax))
	elif n <= 1500000:
		tax = 12500 + 25000 + 37500 + 50000 + (n - 1250000) * 0.25
		print(int(n - tax))
	else:
		tax = 12500 + 25000 + 37500 + 50000 + 62500 + (n - 1500000) * 0.3
		print(int(n - tax))


arr = [0] * 6
arr[1] = 250000 * 0.05
arr[2] = 250000 * 0.1
arr[3] = 250000 * 0.15
arr[4] = 250000 * 0.2
arr[5] = 250000 * 0.25
for _ in range(int(input())):
	n = int(input())
	tax = 0
	if n <= 250000:
		tax = 0
	elif 250000 < n <= 500000:
		tax = sum(arr[:1])
		rem = n - 250000
		tax += rem * 0.05
	elif 500000 < n <= 750000:
		tax = sum(arr[:2])
		rem = n - 500000
		tax += rem * 0.1
	elif 750000 < n <= 1000000:
		tax = sum(arr[:3])
		rem = n - 750000
		tax += rem * 0.15
	elif 1000000 < n <= 1250000:
		tax = sum(arr[:4])
		rem = n - 1000000
		tax += rem * 0.2
	elif 1250000 < n <= 1500000:
		tax = sum(arr[:5])
		rem = n - 1250000
		tax += rem * 0.25
	elif n > 1500000:
		tax = sum(arr[:6])
		rem = n - 1500000
		tax += rem * 0.3
	res = int(n - tax)
	print(res)


for _ in range(int(input())):
	n = k = int(input())
	t = 0
	tx = [0, 250000, 500000, 750000, 1000000, 1250000, 1500000, n]
	r = [0, 0.05, 0.1, 0.15, 0.2, 0.25, 0.3]
	i = 1
	while k > 0:
		if k <= tx[i] - tx[i - 1]:
			t += k * r[i - 1]
		else:
			t += (tx[i] - tx[i - 1]) * r[i - 1]
		k -= tx[i] - tx[i - 1]
		i += 1
	print(int(n - t))


for _ in range(int(input())):
	n = int(input())
	i = 5
	p = 0
	s = n - 250000
	while s >= 0:
		if s > 250000 and i <= 30:
			p = p + 250000 * i // 100
		else:
			if i <= 30:
				p = p + s * i // 100
			else:
				p = p + s * 30 // 100
			break
		s = s - 250000
		i = i + 5
	print(n - p)


r = [(0, 0), (2500, 5), (5000, 10), (7500, 15), (10000, 20), (12500, 25), (15000, 30)]
for i in range(int(input())):
	N = int(input())
	p = 0
	j = 0
	while j <= 5 and N // 100 >= r[j + 1][0]:
		p = p + (r[j + 1][0] - r[j][0]) * r[j][1]
		j = j + 1
	t = (N // 100 - r[j][0]) * r[j][1]
	p = p + t
	print(N - p)


t = int(input())
for i in range(t):
	n = int(input())
	a = n // 250000
	sum = 0
	f = 5
	if n <= 250000:
		print(n)
	elif 250000 < n <= 1500000:
		for j in range(a):
			x = 250000 * (j * f) / 100
			sum = sum + x
		d = n % 250000
		e = d * f * a / 100
		g = sum + e
		h = n - g
		p = int(h)
		print(p)
	elif n > 1500000:
		for k in range(6):
			x = 250000 * (k * f) / 100
			sum = sum + x
		l = n - 1500000
		m = l * 30 / 100
		sum2 = sum + m
		o = n - sum2
		q = int(o)
		print(q)


a = int(input())
for i in range(a):
	n = int(input())
	ded = 0
	if n == 0:
		print(0)
	else:
		s = (n - 1) // 250000
		s = min(s, 6)
		for i in range(s):
			ded += 0.01 * 5 * 250000 * i
		ded += (n - s * 250000) * 0.01 * 5 * s
		print(int(n - ded))


for _ in range(int(input())):
	n = int(input())
	tax = 0
	if n <= 250000:
		tax = n / 100 * 0 - 0
	elif n <= 500000:
		tax = (n - 250000) / 100 * 5 - 0
	elif n <= 750000:
		tax = (n - 500000) / 100 * 10 + 12500
	elif n <= 1000000:
		tax = (n - 750000) / 100 * 15 + 37500
	elif n <= 1250000:
		tax = (n - 1000000) / 100 * 20 + 75000
	elif n <= 1500000:
		tax = (n - 1250000) / 100 * 25 + 125000
	elif n > 1500000:
		tax = (n - 1500000) / 100 * 30 + 187500
	print(int(n - tax))


t = int(input())
while t:
	n = int(input())
	if n <= 250000:
		print(n)
	elif n <= 500000:
		tax = (n - 250000) * 0.05
		n = n - int(tax)
		print(n)
	elif n <= 750000:
		tax = (n - 500000) * 0.1 + 12500
		n = n - int(tax)
		print(n)
	elif n <= 1000000:
		tax = (n - 750000) * 0.15 + 37500
		n = n - int(tax)
		print(n)
	elif n <= 1250000:
		tax = (n - 1000000) * 0.2 + 75000
		n = n - int(tax)
		print(n)
	elif n <= 1500000:
		tax = (n - 1250000) * 0.25 + 125000
		n = n - int(tax)
		print(n)
	else:
		tax = (n - 1500000) * 0.3 + 187500
		n = n - int(tax)
		print(n)
	t -= 1


def f(n):
	i = [1500000, 1250000, 1000000, 750000, 500000, 250000]
	p = [0.3, 0.25, 0.2, 0.15, 0.1, 0.05]
	sal = n
	for j in range(6):
		if sal > i[j]:
			n -= (sal - i[j]) * p[j]
			sal = i[j]
	return int(n)
for _ in range(int(input())):
	print(f(int(input())))


for _ in range(int(input())):
	N = int(input())
	if N <= 250000:
		print(N)
	elif N <= 500000:
		print(int(250000 + (N - 250000) * 19 / 20))
	elif N <= 750000:
		print(int(487500 + (N - 500000) * 9 / 10))
	elif N <= 1000000:
		print(int(712500 + (N - 750000) * 17 / 20))
	elif N <= 1250000:
		print(int(925000 + (N - 1000000) * 4 / 5))
	elif N <= 1500000:
		print(int(1125000 + (N - 1250000) * 3 / 4))
	else:
		print(int(1312500 + (N - 1500000) * 7 / 10))


for i in range(int(input())):
	n = int(input())
	if n <= 250000:
		print(n)
	elif n <= 500000:
		print(int(n - (n - 250000) / 20))
	elif n <= 750000:
		print(int(n - (n - 500000) / 10 - 12500))
	elif n <= 1000000:
		print(int(n - 15 / 100 * (n - 750000) - 25000 - 12500))
	elif n <= 1250000:
		print(int(n - (n - 1000000) / 5 - 37500 - 25000 - 12500))
	elif n <= 1500000:
		print(int(n - (n - 1250000) / 4 - 50000 - 37500 - 25000 - 12500))
	else:
		print(int(n - 3 / 10 * (n - 1500000) - 62500 - 50000 - 37500 - 25000 - 12500))


for i in range(int(input())):
	n = int(input())
	t = 0
	if n >= 1500000:
		t += (n - 1500000) * 30 / 100 + 12500 + 25000 + 37500 + 50000 + 62500
	elif n > 1250000:
		t += (n - 1250000) * 25 / 100 + 12500 + 25000 + 37500 + 50000
	elif n > 1000000:
		t += (n - 1000000) * 20 / 100 + 12500 + 25000 + 37500
	elif n > 750000:
		t += (n - 750000) * 15 / 100 + 12500 + 25000
	elif n > 500000:
		t += (n - 500000) * 10 / 100 + 12500
	elif n > 250000:
		t += (n - 250000) * 5 / 100
	print(int(n - t))


n = int(input())
tax = 0
for i in range(n):
	earning = int(input())
	if earning >= 1500000:
		tax = 250000 * 0.75 + (earning - 1500000) * 0.3
	elif earning >= 1250000:
		tax = 250000 * 0.5 + (earning - 1250000) * 0.25
	elif earning >= 1000000:
		tax = 250000 * 0.3 + (earning - 1000000) * 0.2
	elif earning >= 750000:
		tax = 250000 * 0.15 + (earning - 750000) * 0.15
	elif earning >= 500000:
		tax = 250000 * 0.05 + (earning - 500000) * 0.1
	elif earning >= 250000:
		tax = (earning - 250000) * 0.05
	else:
		tax = 0
	print(earning - int(tax))


(A, B, C, D, E, F) = (250000, 500000, 750000, 1000000, 1250000, 1500000)
t = int(input())
for i in range(t):
	n = int(input())
	data = n
	final = 0
	if n <= A:
		final += data * 0
	elif n > A and n <= B:
		data = n - A
		final += data * 0.05
	elif n > B and n <= C:
		data = n - B
		final += data * 0.1 + A * 0.05
	elif n > C and n <= D:
		data = n - C
		final += data * 0.15 + A * 0.1 + A * 0.05
	elif n > D and n <= E:
		data = n - D
		final += data * 0.2 + A * 0.15 + A * 0.1 + A * 0.05
	elif n > E and n <= F:
		data = n - E
		final += data * 0.25 + A * 0.2 + A * 0.15 + A * 0.1 + A * 0.05
	else:
		data = n - F
		final += data * 0.3 + A * 0.25 + A * 0.2 + A * 0.15 + A * 0.1 + A * 0.05
	print(int(n - final))


for i in range(int(input())):
	v = int(input())
	temp = v
	while temp:
		if v <= 250000.0:
			break
		if v > 500000.0:
			temp -= (500000.0 - 250000.0) * 0.05
		else:
			temp -= (temp - 250000.0) * 0.05
			break
		if v > 750000.0:
			temp -= (750000.0 - 500000.0) * 0.1
		else:
			temp -= (v - 500000.0) * 0.1
			break
		if v > 1000000.0:
			temp -= (1000000.0 - 750000.0) * 0.15
		else:
			temp -= (v - 750000.0) * 0.15
			break
		if v > 1250000.0:
			temp -= (1250000.0 - 1000000.0) * 0.2
		else:
			temp -= (v - 1000000.0) * 0.2
			break
		if v > 1500000.0:
			temp -= (1500000.0 - 1250000.0) * 0.25
			temp -= (v - 1500000.0) * 0.3
			break
		else:
			temp -= (v - 1250000.0) * 0.25
			break
	print(int(temp))


for t in range(int(input())):
	n = int(input())
	a = n
	v5 = 0
	t = [12500, 25000, 37500, 50000, 62500]
	r = [5, 10, 15, 20, 25, 30]
	tax = 0
	if n > 1500000:
		v5 = n - 1500000
		n = 1500000
	v = n // 250000
	v2 = v - 1
	if v2 >= 0:
		for i in range(v2):
			tax = tax + t[i]
		v1 = n - v * 250000
		tax = tax + v1 * (r[v2] / 100)
		if v5 > 0:
			tax = tax + v5 * (30 / 100)
		print(int(a - tax))
	else:
		print(n)


T = int(input())
for i in range(T):
	N = int(input())
	if N > 750000:
		if N > 1000000:
			if N > 1250000:
				if N > 1500000:
					NetIncome = 250000 + (N - 1500000) * 0.7 + 250000 * 0.75 + 250000 * 0.8 + 250000 * 0.85 + 250000 * 0.9 + 250000 * 0.95
				else:
					NetIncome = 250000 + (N - 1250000) * 0.75 + 250000 * 0.8 + 250000 * 0.85 + 250000 * 0.9 + 250000 * 0.95
			else:
				NetIncome = 250000 + (N - 1000000) * 0.8 + 250000 * 0.85 + 250000 * 0.9 + 250000 * 0.95
		else:
			NetIncome = 250000 + (N - 750000) * 0.85 + 250000 * 0.9 + 250000 * 0.95
	elif N > 250000:
		if N > 500000:
			NetIncome = 250000 + (N - 500000) * 0.9 + 250000 * 0.95
		else:
			NetIncome = 250000 + (N - 250000) * 0.95
	else:
		NetIncome = N
	print(int(NetIncome))


for _ in range(int(input())):
	taxincome = [250000, 500000, 750000, 1000000, 1250000, 1500000]
	taxrate = [5, 10, 15, 20, 25, 30]
	x = int(input())
	initialamount = x
	tax = 0
	taxedincome = 0
	for i in range(5, -1, -1):
		if x > taxincome[i]:
			taxedincome = x - taxincome[i]
			tax += taxedincome // 100 * taxrate[i]
			x -= taxedincome
	print(initialamount - tax)


T = int(input())
for j in range(0, T):
	N = int(input())
	tax = 0
	if N > 250000:
		if N > 500000:
			tax = tax + 12500
		else:
			tax = tax + 0.05 * (N - 250000)
	if N > 500000:
		if N > 750000:
			tax = tax + 25000
		else:
			tax = tax + 0.1 * (N - 500000)
	if N > 750000:
		if N > 1000000:
			tax = tax + 37500
		else:
			tax = tax + 0.15 * (N - 750000)
	if N > 1000000:
		if N > 1250000:
			tax = tax + 50000
		else:
			tax = tax + 0.2 * (N - 1000000)
	if N > 1250000:
		if N > 1500000:
			tax = tax + 62500
		else:
			tax = tax + 0.25 * (N - 1250000)
	if N > 1500000:
		tax = tax + 0.3 * (N - 1500000)
	print(int(N - tax))


def calcTax(x):
	if x < 250001:
		return x
	elif x < 500001:
		y = (x - 250001) * 0.05
		return x - y
	elif x < 750001:
		y = (x - 500000) * 0.1
		return x - y - 250000 * 0.05
	elif x < 1000001:
		y = (x - 750001) * 0.15
		return x - y - 250000 * 0.05 - 250000 * 0.1
	elif x < 1250001:
		y = (x - 1000000) * 0.2
		return x - y - 250000 * 0.05 - 250000 * 0.1 - 250000 * 0.15
	elif x < 1500001:
		y = (x - 1250000) * 0.25
		return x - y - 250000 * 0.05 - 250000 * 0.1 - 250000 * 0.15 - 250000 * 0.2
	else:
		y = (x - 1500000) * 0.3
		return x - y - 250000 * 0.05 - 250000 * 0.1 - 250000 * 0.15 - 250000 * 0.2 - 250000 * 0.25
for i in range(int(input())):
	print(int(calcTax(int(input()))))


for i in range(int(input())):
	N = int(input())
	slab = [250000, 500000, 750000, 1000000, 1250000, 1500000]
	tax = [0.05, 0.1, 0.15, 0.2, 0.25, 0.3]
	if N <= 250000:
		print(N)
	else:
		Sum = 0
		for x in range(len(slab) - 1):
			if N > slab[x] and N > slab[x + 1]:
				Sum += int(tax[x] * (slab[x + 1] - slab[x]))
			elif N > slab[x] and N <= slab[x + 1]:
				Sum += int(tax[x] * (N - slab[x]))
		if N > 1500000:
			Sum += int(0.3 * (N - 1500000))
		print(N - Sum)


for _ in range(int(input())):
	n = int(input())
	nn = n
	xx = 0
	x = 0
	if n >= 250000:
		x += 0.05 * min(250000, n - 250000)
		if n >= 500000:
			x += 0.1 * min(250000, n - 500000)
			if n >= 750000:
				x += 0.15 * min(250000, n - 750000)
				if n >= 1000000:
					x += 0.2 * min(250000, n - 1000000)
					if n >= 1250000:
						x += 0.25 * min(250000, n - 1250000)
						if n >= 1500000:
							x += 0.3 * (n - 1500000)
	print(int(n - x))


for i in range(int(input())):
	n = int(input())
	t = 0
	if n > 1500000:
		t = t + (n - 1500000) * 0.3
	ti = [0.05, 0.1, 0.15, 0.2, 0.25]
	l = [250000, 500000, 750000, 1000000, 1250000, 1500000]
	for i in range(0, len(l) - 1):
		if n > l[i] and n <= l[i + 1]:
			t = t + (n - l[i]) * ti[i]
		elif n > l[i + 1]:
			t = t + (l[i + 1] - l[i]) * ti[i]
	print(int(n - t))


N = int(input())
while N:
	income = int(input())
	tax = 0
	if income <= 250000:
		tax = 0
	if income > 250000 and income <= 500000:
		tax += (income - 250000) * 0.05
	elif income > 500000:
		tax += 12500
	if income > 500000 and income <= 750000:
		tax += (income - 500000) * 0.1
	elif income > 750000:
		tax += 25000
	if income > 750000 and income <= 1000000:
		tax += (income - 750000) * 0.15
	elif income > 1000000:
		tax += 37500
	if income > 1000000 and income <= 1250000:
		tax += (income - 1000000) * 0.2
	elif income > 1250000:
		tax += 50000
	if income > 1250000 and income <= 1500000:
		tax += (income - 1250000) * 0.25
	elif income > 1500000:
		tax += 62500
	if income > 1500000:
		tax += (income - 1500000) * 0.3
	print(int(income - tax))
	N -= 1


for i in range(int(input())):
	a = int(input())
	t = [0, 12500, 25000, 37500, 50000, 62500]
	if a <= 250000:
		print(a)
	elif a > 250000 and a <= 500000:
		print(int(a - (a - 250000) * 0.05))
	elif a > 500000 and a <= 750000:
		print(int(a - (sum(t[:2]) + (a - 500000) * 0.1)))
	elif a > 750000 and a <= 1000000:
		print(int(a - (sum(t[:3]) + (a - 750000) * 0.15)))
	elif a > 1000000 and a <= 1250000:
		print(int(a - (sum(t[:4]) + (a - 1000000) * 0.2)))
	elif a > 1250000 and a <= 1500000:
		print(int(a - (sum(t[:5]) + (a - 1250000) * 0.25)))
	elif a > 1500000:
		print(int(a - (sum(t[:6]) + (a - 1500000) * 0.3)))


for _ in range(int(input())):
	a = int(input())
	d = 12500
	e = 25000
	f = 37500
	g = 50000
	h = 62500
	if a <= 250000:
		print(int(a))
	elif 250000 < a <= 500000:
		i = a - 250000
		j = 0.05 * i
		print(int(a - j))
	elif 500000 < a <= 750000:
		i = a - 500000
		j = 0.1 * i
		print(int(a - (d + j)))
	elif 750000 < a <= 1000000:
		i = a - 750000
		j = 0.15 * i
		print(int(a - (d + e + j)))
	elif 1000000 < a <= 1250000:
		i = a - 1000000
		j = 0.2 * i
		print(int(a - (d + e + f + j)))
	elif 1250000 < a <= 1500000:
		i = a - 1250000
		j = 0.25 * i
		print(int(a - (d + e + f + g + j)))
	elif a > 1500000:
		i = a - 1500000
		j = 0.3 * i
		print(int(a - (d + e + f + g + h + j)))


reply = []
rates = [250000, 500000, 750000, 1000000, 1250000, 1500000]
r = [30, 25, 20, 15, 10, 5]
rates.reverse()
for _ in range(int(input())):
	income = int(input())
	dupe = income
	output = 0
	for i in range(len(rates)):
		if dupe > rates[i]:
			output += (dupe - rates[i]) * r[i] / 100
			dupe = rates[i]
		else:
			continue
	reply.append(int(income - output))
for i in reply:
	print(i)


def tax(n):
	if n <= 250000:
		return 0
	elif n <= 500000:
		return (n - 250000) * 5 // 100
	elif n <= 750000:
		return 2500 * 5 + (n - 500000) * 10 // 100
	elif n <= 1000000:
		return 2500 * (5 + 10) + (n - 750000) * 15 // 100
	elif n <= 1250000:
		return 2500 * (5 + 10 + 15) + (n - 1000000) * 20 // 100
	elif n <= 1500000:
		return 2500 * (5 + 10 + 15 + 20) + (n - 1250000) * 25 // 100
	else:
		return 2500 * (5 + 10 + 15 + 20 + 25) + (n - 1500000) * 30 // 100
for T in range(int(input())):
	income = int(input())
	total_tax = tax(income)
	print(income - total_tax)


T = int(input())
con = 0
while con < T:
	N = int(input())
	if N <= 250000:
		ans = N
	elif N <= 500000:
		ans = N - (N - 250000) * (5 / 100)
	elif N <= 750000:
		ans = N - ((N - 500000) * (10 / 100) + 12500)
	elif N <= 1000000:
		ans = N - ((N - 750000) * 15 / 100 + 37500)
	elif N <= 1250000:
		ans = N - ((N - 1000000) * (20 / 100) + 75000)
	elif N <= 1500000:
		ans = N - ((N - 1250000) * (25 / 100) + 125000)
	elif N > 1500000:
		ans = N - ((N - 1500000) * (30 / 100) + 187500)
	print(int(ans))
	con += 1


for x in range(int(input())):
	n = int(input())
	data = n
	final = 0
	if n <= 250000:
		final += data * 0
	elif n > 250000 and n <= 500000:
		data = n - 250000
		final += data * 0.05
	elif n > 500000 and n <= 750000:
		data = n - 500000
		final += data * 0.1 + 250000 * 0.05
	elif n > 750000 and n <= 1000000:
		data = n - 750000
		final += data * 0.15 + 250000 * 0.1 + 250000 * 0.05
	elif n > 1000000 and n <= 1250000:
		data = n - 1000000
		final += data * 0.2 + 250000 * 0.15 + 250000 * 0.1 + 250000 * 0.05
	elif n > 1250000 and n <= 1500000:
		data = n - 1250000
		final += data * 0.25 + 250000 * 0.2 + 250000 * 0.15 + 250000 * 0.1 + 250000 * 0.05
	else:
		data = n - 1500000
		final += data * 0.3 + 250000 * 0.25 + 250000 * 0.2 + 250000 * 0.15 + 250000 * 0.1 + 250000 * 0.05
	print(int(n - final))


t = int(input())
for j in range(t):
	n = int(input())
	net = 0
	if n <= 250000:
		net = n
	elif n <= 500000:
		net = n - (n - 250000) * 0.05
	elif n <= 750000:
		net = n - (250000 * 0.05 + (n - 500000) * 0.1)
	elif n <= 1000000:
		net = n - (250000 * 0.15 + (n - 750000) * 0.15)
	elif n <= 1250000:
		net = n - (250000 * 0.3 + (n - 1000000) * 0.2)
	elif n <= 1500000:
		net = n - (250000 * 0.5 + (n - 1250000) * 0.25)
	elif n > 1500000:
		net = n - (250000 * 0.75 + (n - 1500000) * 0.3)
	print(int(net))


tax_data = {250000: 0.05, 500000: 0.1, 750000: 0.15, 1000000: 0.2, 1250000: 0.25, 1500000: 0.3}
for _ in range(int(input())):
	N = int(input())
	total_tax = 0
	tax_range = list(tax_data.keys())
	for i in range(5):
		if N > tax_range[i]:
			if N > tax_range[i + 1]:
				total_tax += (tax_range[i + 1] - tax_range[i]) * tax_data[tax_range[i]]
			else:
				total_tax += (N - tax_range[i]) * tax_data[tax_range[i]]
				break
	if N > tax_range[5]:
		total_tax += (N - tax_range[5]) * tax_data[tax_range[5]]
	print(int(N - total_tax))


def create_tax_brackets(data):
	tax_brackets_result = []
	for bracket in data:
		tax_brackets_result.append((bracket[1] - bracket[0], bracket[2] / 100))
	return tax_brackets_result

def solve(tax_brackets):
	for _ in range(int(input())):
		n = int(input())
		net_income = n
		for bracket in tax_brackets:
			chunk = min(n, bracket[0])
			net_income -= int(chunk * bracket[1])
			n -= chunk
			if n == 0:
				break
		print(net_income)
tax_data = [(0, 250000, 0), (250000, 500000, 5), (500000, 750000, 10), (750000, 1000000, 15), (1000000, 1250000, 20), (1250000, 1500000, 25), (1500000, float('inf'), 30)]
solve(create_tax_brackets(tax_data))


def solve(n):
	total = n
	tax = 0
	if n > 1500000:
		tax += (n - 1500000) * 0.3
		n = 1500000
	if n > 1250000:
		tax += (n - 1250000) * 0.25
		n = 1250000
	if n > 1000000:
		tax += (n - 1000000) * 0.2
		n = 1000000
	if n > 750000:
		tax += (n - 750000) * 0.15
		n = 750000
	if n > 500000:
		tax += (n - 500000) * 0.1
		n = 500000
	if n > 250000:
		tax += (n - 250000) * 0.05
	return int(total - tax)
for _ in range(int(input())):
	n = int(input())
	print(solve(n))


def cal_tax(n):
	tax = 0
	if n > 1500000:
		p = n - 1500000
		tax += p * (30 / 100)
		n -= p
	if n > 1250000:
		p = n - 1250000
		tax += p * (25 / 100)
		n -= p
	if n > 1000000:
		p = n - 1000000
		tax += p * (20 / 100)
		n -= p
	if n > 750000:
		p = n - 750000
		tax += p * (15 / 100)
		n -= p
	if n > 500000:
		p = n - 500000
		tax += p * (10 / 100)
		n -= p
	if n > 250000:
		p = n - 250000
		tax += p * (5 / 100)
		n -= p
	return tax
for case in range(int(input())):
	n = int(input())
	print(int(n - cal_tax(n)))


for i in range(int(input())):
	x = int(input())
	if x <= 250000:
		print(x)
	elif x <= 500000:
		y = (x - 250000) * 95 / 100 + 250000
		print(int(y))
	elif x <= 750000:
		y = (x - 500000) * 90 / 100 + 250000 * (95 / 100 + 1)
		print(int(y))
	elif x <= 1000000:
		y = (x - 750000) * 85 / 100 + 250000 * (90 / 100 + 95 / 100 + 1)
		print(int(y))
	elif x <= 1250000:
		y = (x - 1000000) * 80 / 100 + 250000 * (85 / 100 + 90 / 100 + 95 / 100 + 1)
		print(int(y))
	elif x <= 1500000:
		y = (x - 1250000) * 75 / 100 + 250000 * (80 / 100 + 85 / 100 + 90 / 100 + 95 / 100 + 1)
		print(int(y))
	else:
		y = (x - 1500000) * 70 / 100 + 250000 * (75 / 100 + 80 / 100 + 85 / 100 + 90 / 100 + 95 / 100 + 1)
		print(int(y))


brackets = [(0, 250000, 0), (250001, 500000, 0.05), (500001, 750000, 0.1), (750001, 1000000, 0.15), (1000001, 1250000, 0.2), (1250001, 1500000, 0.25), (1500000, float('inf'), 0.3)]
for tc in range(int(input())):
	n = int(input())
	tax = 0
	tot = 0
	for t in brackets:
		if n >= t[0]:
			tax = t[2] * min(t[1] - t[0], n - t[0])
			tot += tax
	print(int(n - tot))


for _ in range(int(input())):
	n = int(input())
	tax = 0
	k = n / 250000
	if k <= 1:
		print(n)
	elif k <= 2:
		print(n - (n - 250000) * 5 // 100)
	elif k <= 3:
		print(n - (2500 * 5 + (n - 500000) * 10 // 100))
	elif k <= 4:
		print(n - (2500 * 5 + 2500 * 10 + (n - 750000) * 15 // 100))
	elif k <= 5:
		print(n - (2500 * 5 + 2500 * 10 + 2500 * 15 + (n - 1000000) * 20 // 100))
	elif k <= 6:
		print(n - (2500 * 5 + 2500 * 10 + 2500 * 15 + 2500 * 20 + (n - 1250000) * 25 // 100))
	else:
		print(n - (2500 * 5 + 2500 * 10 + 2500 * 15 + 2500 * 20 + 2500 * 25 + (n - 1500000) * 30 // 100))


t = int(input())
for i in range(t):
	n = int(input())
	if n <= 250000:
		print(n)
	elif n > 250000 and n <= 500000:
		print(int((n - 250000) * 0.95 + 250000))
	elif n > 500000 and n <= 750000:
		print(int((n - 500000) * 0.9 + 250000 + 250000 * 0.95))
	elif n > 750000 and n <= 1000000:
		print(int((n - 750000) * 0.85 + 250000 * (0.9 + 0.95 + 1)))
	elif n > 1000000 and n <= 1250000:
		print(int((n - 1000000) * 0.8 + 250000 * (0.85 + 0.9 + 0.95 + 1)))
	elif n > 1250000 and n <= 1500000:
		print(int((n - 1250000) * 0.75 + 250000 * (0.8 + 0.85 + 0.9 + 0.95 + 1)))
	else:
		print(int((n - 1500000) * 0.7 + 250000 * (0.75 + 0.8 + 0.85 + 0.9 + 0.95 + 1)))


t = int(input())
for _ in range(t):
	p = 0
	n = int(input())
	t = 250000
	c = 5
	q = 5
	while q > 0:
		if t >= n:
			q = -1
		elif t >= 1500000:
			q = -1
		else:
			p += 250000 * (c / 100)
			c += 5
			t += 250000
	if p >= 1:
		if n >= 1500000:
			print(int(n - ((n - 1500000) * (c / 100) + p)))
		else:
			c -= 5
			t -= 250000
			p -= 250000 * (c / 100)
			p += (n - t) * (c / 100)
			print(int(n - p))
	else:
		print(int(n))


T = int(input())
while T:
	T -= 1
	n = int(input())
	m = n
	tax = 0
	if n > 1500000:
		tax += 0.3 * (n - 1500000)
		n = 1500000
	if n > 1250000:
		tax += 0.25 * (n - 1250000)
		n = 1250000
	if n > 1000000:
		tax += int(0.2 * (n - 1000000))
		n = 1000000
	if n > 750000:
		tax += int(0.15 * (n - 750000))
		n = 750000
	if n > 500000:
		tax += int(0.1 * (n - 500000))
		n = 500000
	if n > 250000:
		tax += int(0.05 * (n - 250000))
	print(int(m - tax))


for _ in range(int(input())):
	n = int(input())
	tax = 0
	if n < 250000:
		tax = 0
	elif n > 250000 and n <= 500000:
		tax = (n - 250000) * 5 / 100
	elif n > 500000 and n <= 750000:
		tax = 12500 + (n - 500000) * 10 / 100
	elif n > 750000 and n <= 1000000:
		tax = 12500 + 25000 + (n - 750000) * 15 / 100
	elif n > 1000000 and n <= 1250000:
		tax = 12500 + 25000 + 37500 + (n - 1000000) * 20 / 100
	elif n > 1250000 and n <= 1500000:
		tax = 12500 + 25000 + 37500 + 50000 + (n - 1250000) * 25 / 100
	elif n > 1500000:
		tax = 12500 + 25000 + 37500 + 50000 + 62500 + (n - 1500000) * 30 / 100
	print(int(n - tax))


q = int(input())
for i in range(q):
	w = int(input())
	e = 0
	if w <= 250000:
		e = 0
	if 250000 < w <= 500000:
		e = int(0.05 * (w - 250000))
	if 500000 < w <= 750000:
		e = 12500 + int(0.1 * (w - 500000))
	if 750000 < w <= 1000000:
		e = 37500 + int(0.15 * (w - 750000))
	if 1000000 < w <= 1250000:
		e = 75000 + int(0.2 * (w - 1000000))
	if 1250000 < w <= 1500000:
		e = 125000 + int(0.25 * (w - 1250000))
	if w > 1500000:
		e = 187500 + int(0.3 * (w - 1500000))
	p = int(w - e)
	print(p)


t = int(input())
result = []
for _ in range(t):
	x = int(input())
	m = x
	tax = 0
	if m > 1500000:
		y = m - 1500000
		tax += 0.3 * y
		m -= y
	if m > 1250000:
		y = m - 1250000
		tax += 0.25 * y
		m -= y
	if m > 1000000:
		y = m - 1000000
		tax += 0.2 * y
		m -= y
	if m > 750000:
		y = m - 750000
		tax += 0.15 * y
		m -= y
	if m > 500000:
		y = m - 500000
		tax += 0.1 * y
		m -= y
	if m > 250000:
		y = m - 250000
		tax += 0.05 * y
	result.append(x - tax)
for i in range(t):
	print(int(result[i]))


t = int(input())
while t:
	t -= 1
	n = int(input())
	tax = 0
	i = 0
	d1 = {1500000: [30, 'k'], 1250000: [25, 62499.75], 1000000: [20, 50000], 750000: [15, 37500], 500000: [10, 25000], 250000: [5, 12500], 0: [0, 0]}
	for k in d1.keys():
		if i == 1:
			tax += d1[k][1]
		if n > k and i == 0:
			tax = (n - k) * d1[k][0] / 100
			i = 1
	print(int(n - tax))


t = int(input())
while t:
	sal = int(input())
	netsal = sal
	tax = 0
	if sal > 1500000:
		tax += (sal - 1500000) * 0.3
		sal = 1500000
	if sal > 1250000:
		tax += (sal - 1250000) * 0.25
		sal = 1250000
	if sal > 1000000:
		tax += (sal - 1000000) * 0.2
		sal = 1000000
	if sal > 750000:
		tax += (sal - 750000) * 0.15
		sal = 750000
	if sal > 500000:
		tax += (sal - 500000) * 0.1
		sal = 500000
	if sal > 250000:
		tax += (sal - 250000) * 0.05
		sal = 250000
	netsal = int(netsal - tax)
	print(netsal)
	t = t - 1


cases = int(input())
for case in range(cases):
	net_income = income = int(input())
	tax = 0
	if income > 1500000:
		tax += (income - 1500000) * 0.3
		income = 1500000
	if 1250000 < income <= 1500000:
		tax += (income - 1250000) * 0.25
		income = 1250000
	if 1000000 < income <= 1250000:
		tax += (income - 1000000) * 0.2
		income = 1000000
	if 750000 < income <= 1000000:
		tax += (income - 750000) * 0.15
		income = 750000
	if 500000 < income <= 750000:
		tax += (income - 500000) * 0.1
		income = 500000
	if 250000 < income <= 500000:
		tax += (income - 250000) * 0.05
	print(int(net_income - tax))


for _ in range(int(input())):
	n = int(input())
	if n <= 250000:
		print(n)
	if n > 250000 and n <= 500000:
		print(int(n - (n - 250000) * 0.05))
	if n > 500000 and n <= 750000:
		print(int(n - (n - 500000) * 0.1 - 12500))
	if n > 750000 and n <= 1000000:
		print(int(n - (n - 750000) * 0.15 - 250000 * 0.15))
	if n > 1000000 and n <= 1250000:
		print(int(n - (n - 1000000) * 0.2 - 250000 * 0.3))
	if n > 1250000 and n <= 1500000:
		print(int(n - (n - 1250000) * 0.25 - 250000 * 0.5))
	if n > 1500000:
		print(int(n - (n - 1500000) * 0.3 - 250000 * 0.75))