Biggest Slice
Time limit2sMemory limit256 MB
Compute the largest slice area from n radial cuts where each cut rotates by a fixed angle around the circle center.
- Level
Medium7 of 10
- Topics
- Number theory, Math, Geometry
- Solved
- No attempts yet
Problem
You share one large circular pizza with friends. You cut it like this. Rotate the pizza clockwise about its center by the angle , then make one straight cut from the center to the right. Repeat the same rotation and the same cut times in total.
Unless is chosen well, this is not a good way to divide a pizza. Some slices come out larger than others, and when cuts land on top of each other you get fewer than slices. You do not care about fairness. The largest slice is yours, so you only want its area.
Input
The first line contains the number of test cases . ()
Each of the next lines holds one test case. A line gives the pizza radius in centimeters, the number of people sharing the pizza , and the rotation angle , in that order. is an integer with , and is an integer with . is given as three integers, its degrees, its arcminutes, and its arcseconds. The degrees are between and , the arcminutes and the arcseconds are each between and , and is greater than .
Output
For each test case, print the area of the largest slice in square centimeters on its own line, rounded to six digits after the decimal point.