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
DEBUG = False

def print_debug(s):
    if DEBUG: print str(s);

def calculate(quantity, price):
    return (quantity * price) * (0.9 if quantity > 1000 else 1.0)

def run():
    print_debug('Number of entries:')
    lines = int(raw_input())
    while (lines > 0):
        print_debug("Entry in format '%f %f' as 'quantity price'")
        [quantity, price] = [int(s) for s in raw_input().split(' ')];
        print '%.6f' % calculate(quantity, price)
        lines = lines - 1;
    if DEBUG: print 'Done'

if __name__ == "__main__":
    run()