While purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000. 
If the quantity and price per item are input, write a program to calculate the total expenses.

------ Input Format ------ 

The first line contains an integer T, total number of test cases. Then follow T lines, each line contains integers quantity and price. 

------ Output Format ------ 

For each test case, output the total expenses while purchasing items, in a new line.

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

1 ≤ T ≤ 1000
1 ≤ quantity,price ≤ 100000

----- Sample Input 1 ------ 
3 
100 120
10 20
1200 20

----- Sample Output 1 ------ 
12000.000000
200.000000
21600.000000

Difficulty: EASY

Solutions:
for i in range(int(input())):
	(a, b) = map(int, input().split())
	if a > 1000:
		c = a * 10 / 100
		d = a - c
		print('{:.6f}'.format(d * b))
	else:
		print('{:.6f}'.format(a * b))


for i in range(int(input())):
	(q, p) = map(int, input().split())
	if q > 1000:
		dis = 10 * q / 100
		print('{:.6f}'.format((q - dis) * p))
	else:
		print('{:.6f}'.format(q * p))


for i in range(int(input())):
	(x, y) = map(int, input().split())
	a = x * y
	if x > 1000:
		per = 10 / 100 * a
		tot = a - per
		print('%6f' % tot)
	else:
		print('%6f' % a)


t = int(input())
for i in range(t):
	(q, p) = map(int, input().split())
	if q > 1000:
		ans = q * p - q * p / 10
	else:
		ans = q * p
	print(f'{ans:.6f}')


t = int(input())
for _ in range(t):
	(a, b) = map(int, input().split())
	if a > 1000:
		print(f'{a * b - a * b / 10:.6f}')
	else:
		print(f'{a * b:.6f}')


n = int(input())
for i in range(0, n):
	(q, p) = map(int, input().split())
	if q <= 1000:
		a = q * p
		print('{:.6f}'.format(a))
	else:
		b = 10 / 100 * q
		c = q - b
		d = c * p
		print('{:.6f}'.format(d))


T = int(input())
for i in range(T):
	X = input()
	x = X.split()
	i = 0
	z = float(x[i]) * float(x[i + 1])
	if int(x[i]) > 1000:
		y = z / 100 * 10
		z = z - y
	print('%.6f' % z)


for _ in range(int(input())):
	(x, y) = map(int, input().split())
	a = x * y
	b = x * y * 0.1
	c = a - b
	if x <= 1000:
		print('{:.6f}'.format(a))
	else:
		print('{:.6f}'.format(c))