#include

using namespace std;

#include<bits/stdc++.h>

int main() {

// your code goes here

int t;

cin>>t;

while(t–){

double a,b,s;

cin>>a>>b;

if(a>100){

s=(a*b)-(a*b/10);

}else{

s=a*b;

}

cout<<fixed<<setprecision(6)<<s<<endl;

}

return 0;

}

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

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