In a company an emplopyee is paid as under: 
If his basic salary is less than Rs. 1500, then HRA = 10% of base salary and DA = 90% of basic salary. 
If his salary is either equal to or above Rs. 1500, then HRA = Rs. 500 and DA = 98% of basic salary. If the Employee's salary is input, write a program to find his gross salary.

NOTE: Gross Salary = Basic Salary + HRA + DA 

------ Input ------ 

The first line contains an integer T, total number of testcases. Then follow T lines, each line contains an integer salary. 

------ Output ------ 

For each test case, output the gross salary of the employee in a new line. Your answer will be considered correct if the absolute error is less than 10^{-2}.

------ Constraints ------ 

$1 ≤ T ≤ 1000$
$1 ≤ salary ≤ 100000$

----- Sample Input 1 ------ 
3
1203
10042
1312
----- Sample Output 1 ------ 
2406.00
20383.16
2624

Source: codechef | Difficulty: EASY
Tags: Data structures

Mathematics

Ad-hoc


Solutions:
for _ in range(int(input())):
	T = int(input())
	if T < 1500:
		print(T + 0.1 * T + 0.9 * T)
	elif T >= 1500:
		print(T + 500 + 0.98 * T)


for _ in range(int(input())):
	bs = int(input())
	if bs < 1500:
		print(bs + bs * 0.1 + bs * 0.9)
	else:
		print(bs + 500 + bs * 0.98)


T = int(input())
for i in range(T):
	n = int(input())
	if n < 1500:
		print(n + 0.1 * n + 0.9 * n)
	else:
		print(n + 500 + 0.98 * n)


N = int(input())
for i in range(N):
	x = int(input())
	if x < 1500:
		sal = x + x * 0.1 + x * 0.9
		print(sal)
	else:
		sal = x + 500 + x * 0.98
		print(sal)


for t in range(int(input())):
	n = int(input())
	hra = 0
	da = 0
	if n < 1500:
		hra = 0.1 * n
		da = 0.9 * n
		print(n + hra + da)
	else:
		hra = 500
		da = 0.98 * n
		print(n + da + hra)


t = int(input())
i = 1
while i <= t:
	i += 1
	x = int(input())
	if x < 1500:
		hra = x * 10 / 100
		da = x * 90 / 100
	else:
		hra = 500
		da = x * 98 / 100
	print(x + hra + da)


for i in range(int(input())):
	s = int(input())
	print(s + 0.1 * s + 0.9 * s) if s < 1500 else print(s + 500 + 0.98 * s)


t = int(input())
while t:
	s = int(input())
	if s < 1500:
		g = s + s / 10 + s * (9 / 10)
	else:
		g = s + 500 + s * (98 / 100)
	print(g)
	t -= 1


for i in range(int(input())):
	s = int(input())
	salary = s + s * 10 / 100 + s * 90 / 100
	gross_salary = s + 500 + s * 98 / 100
	if s < 1500:
		print(salary)
	else:
		print(gross_salary)


t = int(input())
for i in range(t):
	salary = int(input())
	if salary < 1500:
		g_s = salary + salary * 0.1 + salary * 0.9
	else:
		g_s = salary + salary * 0.98 + 500
	print(g_s)


for _ in range(int(input())):
	hra = 0
	da = 0
	s = int(input())
	if s < 1500:
		hra = 0.1 * s
		da = 0.9 * s
	else:
		hra = 500
		da = 0.98 * s
	print(s + hra + da)


for i in range(int(input())):
	x = int(input())
	if x < 1500:
		l = x + 0.1 * x + 0.9 * x
		print(l)
	else:
		k = x + 500 + 0.98 * x
		print(k)


t = int(input())
for i in range(t):
	salary = int(input())
	if salary >= 1500:
		print(salary + 500 + salary * 98 / 100)
	else:
		print(salary + salary * 10 / 100 + salary * 90 / 100)


t = int(input())
for tc in range(t):
	a = int(input())
	if a < 1500:
		print(float(2 * a))
	else:
		print(a + 500 + 0.98 * a)


t = int(input())
for i in range(t):
	s = int(input())
	if s < 1500:
		g = s + s / 10 + s * (9 / 10)
	else:
		g = s + 500 + s * (98 / 100)
	print(g)


T = int(input())
for i in range(T):
	salary = int(input())
	if salary < 1500:
		HRA = salary / 10
		DA = salary * 0.9
	else:
		HRA = 500
		DA = salary * 0.98
	print(salary + HRA + DA)


t = int(input())
for i in range(t):
	b = int(input())
	if b >= 1500:
		g = b + 500 + 0.98 * b
	else:
		g = b + 0.1 * b + 0.9 * b
	print(g)


p = int(input())
for i in range(p):
	x = int(input())
	if x < 1500:
		print(x + 0.1 * x + 0.9 * x)
	else:
		print(x + 500 + 0.98 * x)


d = int(input())
for i in range(d):
	w = int(input())
	if w < 1500:
		salary = w + 90 * w / 100 + 10 * w / 100
		print(salary)
	else:
		salary = w + 98 * w / 100 + 500
		print(salary)


a = int(input())
while a > 0:
	b = int(input())
	a -= 1
	if b < 1500:
		hra = b * (10 / 100)
		da = b * (90 / 100)
		print(b + hra + da)
	else:
		hra = 500
		da = b * (98 / 100)
		print(b + hra + da)


t = int(input())
for i in range(t):
	N = int(input())
	if N < 1500:
		GS = N + 0.1 * N + 0.9 * N
		print(GS)
	else:
		GS = N + 500 + 0.98 * N
		print(GS)


t = int(input())
for i in range(t):
	salary = int(input())
	if salary < 1500:
		da = salary * 0.9
		hra = salary * 0.1
		print(round(salary + da + hra, 2))
	else:
		da = salary * 0.98
		hra = 500
		print(round(salary + da + hra, 2))


t = int(input())
for i in range(t):
	n = int(input())
	if n < 1500:
		h = 0.1 * n
		d = 0.9 * n
		s = n + h + d
		print(s)
	elif n >= 1500:
		h = 500
		d = 98 / 100 * n
		s = h + d + n
		print(s)


for j in range(int(input())):
	salary = int(input())
	if salary >= 1500:
		print(salary + 500 + 0.98 * salary)
	else:
		print(salary + 0.1 * salary + 0.9 * salary)


t = int(input())
for i in range(t):
	sal = int(input())
	if sal < 1500:
		net = sal + 0.1 * sal + 0.9 * sal
		print(net)
	else:
		net = sal + 500 + 0.98 * sal
		print(net)


for i in range(int(input())):
	n = int(input())
	if n < 1500:
		print(n * 2)
	else:
		print(n * 98 / 100 + 500 + n)


test = int(input())
for i in range(test):
	s = int(input())
	if s < 1500:
		hra = 0.1 * s
		da = 0.9 * s
	else:
		hra = 500
		da = 0.98 * s
	gr = s + hra + da
	print(gr)


for i in range(int(input())):
	n = int(input())
	h = 10 * n / 100
	a = 90 * n / 100
	b = 98 * n / 100
	if n < 1500:
		print(n + h + a)
	else:
		print(n + 500 + b)


for i in range(int(input())):
	basic_salary = int(input())
	if basic_salary < 1500:
		hra = basic_salary * 10 / 100
		da = basic_salary * 90 / 100
		print(basic_salary + hra + da)
	else:
		hra = 500
		da = basic_salary * 98 / 100
		print(basic_salary + hra + da)


for i in range(int(input())):
	b = int(input())
	if b < 1500:
		print(b + 1 / 10 * b + 9 / 10 * b)
	else:
		print(b + 500 + 98 / 100 * b)


t = int(input())
for i in range(t):
	n = int(input())
	if n < 1500:
		hra = 10 * (n / 100)
		da = 90 * (n / 100)
	else:
		hra = 500
		da = 98 * (n / 100)
	gross = da + hra + n
	print(gross)


t = int(input())
while t > 0:
	x = int(input())
	if x < 1500:
		print(x + 0.1 * x + 0.9 * x)
	else:
		print(x + 500 + 0.98 * x)
	t = t - 1


n = int(input())
for i in range(n):
	a = int(input())
	if a < 1500:
		hra = a * 0.1
		da = a * 0.9
		print('%.2f' % (a + hra + da))
	elif a >= 1500:
		hra = 500
		da = a * 0.98
		print('%.2f' % (a + hra + da))


for i in range(int(input())):
	X = int(input())
	Y = X / 100
	if X < 1500:
		print(X + Y * 10 + Y * 90)
	else:
		print(X + 500 + Y * 98)


t = int(input())
for _ in range(t):
	x = int(input())
	gross = 0
	if x < 1500:
		gross = x + 0.1 * x + 0.9 * x
		print(gross)
	elif x >= 1500:
		gross = x + 500 + 0.98 * x
		print(gross)


for i in range(int(input())):
	x = int(input())
	if x < 1500:
		print(2 * x)
	else:
		print(x + 500 + 0.98 * x)


for i in range(int(input())):
	s = int(input())
	if s < 1500:
		gs = s + 0.1 * s + 0.9 * s
	elif s >= 1500:
		gs = s + 500 + 0.98 * s
	print(gs)


n = int(input())
for i in range(n):
	a = int(input())
	if a < 1500:
		h = 10 / 100 * a
		d = 90 / 100 * a
		print(a + h + d)
	elif a >= 1500:
		h = 500
		d = 98 / 100 * a
		print(a + h + d)


t = int(input())
for i in range(t):
	a = int(input())
	if a < 1500:
		print(a + 0.1 * a + 0.9 * a)
	else:
		print(a + 500 + 0.98 * a)


t = int(input())
for i in range(t):
	x = int(input())
	if x < 1500:
		hr = 0.1 * x
		da = 0.9 * x
		sal = x + hr + da
		print(sal)
	elif x >= 1500:
		hr = 500
		da = 0.98 * x
		sal = x + hr + da
		print(sal)


for i in range(int(input())):
	x = int(input())
	if x >= 1500:
		print(x + 500 + 0.98 * x)
	else:
		print(x + x / 10 + 0.9 * x)


t = int(input())
for i in range(t):
	s = int(input())
	hra1 = s / 10
	da1 = s * 0.9
	hra2 = 500
	da2 = s * 0.98
	gs1 = s + hra1 + da1
	gs2 = s + hra2 + da2
	if s < 1500:
		print(gs1)
	else:
		print(gs2)


n = int(input())
for _ in range(n):
	x = int(input())
	if x < 1500:
		print(2 * x)
	else:
		print(500 + 1.98 * x)


t = int(input())
for i in range(t):
	bs = int(input())
	if bs < 1500:
		gs = bs + 0.1 * bs + 0.9 * bs
		print(gs)
	else:
		gs = bs + 500 + 0.98 * bs
		print(gs)


n = int(input())
for i in range(0, n):
	x = int(input())
	if x < 1500:
		g = x + x * 0.1 + x * 0.9
	else:
		g = x + x * 0.98 + 500
	print(g)


T = int(input())
for i in range(T):
	n = int(input())
	if n < 1500:
		salary = n + 90 * n / 100 + 10 * n / 100
		print(salary)
	else:
		salary = n + 98 * n / 100 + 500
		print(salary)


t = int(input())
for i in range(t):
	s = int(input())
	if s < 1500:
		hra = 10 * s / 100
		da = 90 * s / 100
		print(s + hra + da)
	else:
		db = 98 * s / 100
		print(s + db + 500)