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

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


Output
Output the total expenses while purchasing items.

Constraints

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


Example

Input

3 
100 120
10 20
1200 20

Output

12000.000000
200.000000
21600.000000
a = input()
for b in range(a):
    c = raw_input().split()
    quantity = int(c[0])
    price = int(c[1])
    total = quantity * price
    if quantity > 1000:
        disc = total * 0.1
        total -= disc
    floating = float(total)
    floating = str(floating).split('.')
    while len(floating[1]) < 6:
        d = floating[1]
        d += "0"
        floating[1] = d
    final = ""
    final += floating[0]
    final += "."
    final += floating[1]
    print final