Problem 7

2012 ACU Programming Contest Series

Problem 7: Target

Recently the international standards body, Acronyms Create Ubiquity (ACU), ratified a standard for the amount of red ink that should be used in various paper targets, such as the one shown at the right.

Write a program to find the area of the red portion of a target, given the radius step size and the number of red components. The bullseye of the target is a circle with radius equal to the step size. The outside edge of each white or red ring has a radius one step size larger than its inner edge.


Input

The first line contains the number of data sets to process.

Each data set begins with a line containing two numbers separated by a single space. The first number is positive and indicates the step size. The second number is an integer and indicates the number of red rings in the target. Neither number will be greater than 100.


    

Output

Output one number for each data set, the area of the red portion of the target, rounded to 10 decimal places.

Sample input:
3
1.5 2
.85 3
1 4
     Sample output:
106.0287520587
63.5544193821
141.3716694115