#P6159. [Cnoi2020] 光图
[Cnoi2020] 光图
Description
Rumia has a unit circle, divided into equal parts, and the division points are denoted as , , , , .
Now she emits a beam of light from toward . After reflections, it arrives at .
Rumia wants to know the value of . Since Cirno does not want to help her, Rumia turns to you for help.
Input Format
One line with three integers, .
Output Format
One line with one integer .
12 5 2
10
1000 342 3472844
648
Hint
Explanation of Sample 1

Physical knowledge used later
- Reflection law on a continuous curve: The incident ray and the reflected ray make equal angles with the tangent line of the curve at the point of incidence.
Constraints
This problem uses bundled testdata.
- Subtask 1 (): .
- Subtask 2 (): .
For of the testdata: , .
Postscript
- The light diagram obtained by Cirno is the legendary twelve-pointed star diagram.
Translated by ChatGPT 5
京公网安备 11011102002149号