Practice on Toph

Participate in exhilarating programming contests, solve unique algorithm and data structure challenges and be a part of an awesome community.

Circle Mystery

By ovis96 · Limits 1s, 512 MB

Here, AA is the center of the circle and BCDBCD is a tangent which intersects with the circle at the point CC. Moreover, the tangent intersects with the rays AFundefined\overrightarrow{\rm AF} and AGundefined\overrightarrow{\rm AG}.

You are given the radius of the circle rr, and the angle of the circular sector xx. You have to minimize the area of the shaded region by choosing the point CC optimally. Note that the point CC must need to be inside the angle FAG\angle FAG and obviously on the circumference of the circle.

Input

The first line of the input contains a single integer t(1t100)t(1 \le t \le 100) denoting the number of test cases. The description of tt test cases follows.

The first and only line of each test case contains two space-separated integers r(1r1000)r(1 \le r \le 1000) and x(1x90)x(1 \le x \le 90) — the radius of the circle and the angle of the circular sector in degrees respectively.

Output

For each test case, output the minimum area of the shaded region that can be achieved by choosing the point CC optimally.

Your answer will be considered correct if its relative or absolute error doesn't exceed 10610^{-6}.

Sample

InputOutput
3
3 10
45 45
96 69
0.0019998083
43.5668233656
784.6720511715

    Discussion

    Statistics


    93% Solution Ratio

    Roman_Emper0rEarliest, 9M ago

    Roman_Emper0rFastest, 0.0s

    RUHRUHLightest, 0 B

    MursaleenShortest, 264B

    Submit

    Login to submit

    Toph uses cookies. By continuing you agree to our Cookie Policy.