#K64407. Cookie Area Calculation
Cookie Area Calculation
Cookie Area Calculation
In this problem, you are given a series of test cases where each test case describes a cookie mold. A mold can either be circular (type 0) or rectangular (type 1).
For a circular mold, you are provided with a single integer r representing the radius, and you must compute the area using the formula $$A=\pi r^2$$.
For a rectangular mold, you are provided with two integers w and h representing the width and height, respectively, and the area is calculated as $$A=w\times h$$.
Your task is to calculate and output the maximum possible cookie area for each test case, rounding the result to exactly 2 decimal places.
Input will be taken via standard input and the result should be printed to standard output. Each test case result must appear on a separate line.
inputFormat
The first line of input contains an integer T, the number of test cases. Each of the following T lines represents a test case. For each test case:
- If the test case starts with 0, a circular mold is specified, and the next integer is r (the radius).
- If the test case starts with 1, a rectangular mold is specified, and the next two integers are w and h (width and height respectively).
outputFormat
For each test case, output the cookie area rounded to 2 decimal places on a new line.## sample
3
0 5
1 4 6
0 7
78.54
24.00
153.94
</p>