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
#### CodeChef
#### The Block Game
#### 2016.03.14. Mon
##
##testCases = int(raw_input())
##
##for i in xrange(testCases):
##    num = int(raw_input())
##    numStr = str(num)
##    if numStr == numStr[::-1]:
##        print 'wins'
##    else:
##        print 'losses'


#### CodeChef
#### GCD and LCM
#### 2016.03.14. Mon
##
##def gcd(x,y):
##    large = max(x,y)
##    small = min(x,y)
##    if small == 0:
##        return large
##    elif  large % small == 0:
##        return small
##    else:
##        return gcd(large%small, small)
##    
##        
##def lcm(x,y):
##    GCD = gcd(x,y)
##    return GCD * (x / GCD) * (y / GCD)
##                
##
##testCases = int(raw_input())
##
##for i in xrange(testCases):
##    x,y = map(int, raw_input().strip().split())
##    print gcd(x,y), lcm(x,y)

## CodeChef
## Total Expenses
## 2016.03.14.Mon

testCases = int(raw_input())

for i in xrange(testCases):
    quantity, price = map(int, raw_input().strip().split())
    if quantity >= 1000:
        total = quantity * price * 0.9
    else:
        total = quantity * price

    print '%0.6f' %total