Solve the programming task below in a Python markdown code block.
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