A - Martadella Strikes Again (18.9.30)

Statements

Saeed and Shahhoud were attending a training camp for the ACM ICPC 2018 World Finals.

At dinner, they were very happy to see that the meal was martadella slices! A martadella slice can be seen as a circle.

Shahhoud received a martadella slice with a radius of R, while Saeed received two martadella slices with a radius of r each.

Saeed and Shahhoud were arguing about who received more martadella, can you help them find out?

Print "1" if the area of Shahhoud's martadella slice is strictly larger than the sum of the areas of the two slices that Saeed received, Otherwise, print "2" .

Input

The first line contains a single integer T, the number of test cases.

Each test case consists of a single line containing two integers R and r. (1 ≤ R, r ≤ 108)

Output

For each test case, print "1" if the area of a martadella slice with radius R is strictly larger than the sum of areas of two martadella slices with radius r each, and print "2" otherwise.

Example

Input

2
4 2
4 3

Output

1
2

题意:给出圆的R,r半径,让我们比较那个圆的面积大;注意第二个圆是两倍和第一个比较

来一波代码:

#include 
#include
#include
using namespace std;
const int N=3.141;
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        long long int  n,m;
        scanf("%lld%lld",&n,&m);
        n=n*n*N;
        m=m*m*N;
        m=m*2;
        if(n>m)printf("1\n");
        else printf("2\n");

    }
    return 0;
}

 

你可能感兴趣的:(VJ)