| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 48 | 38 | 26 | 81.250% |
There are two infinite flat mirrors located at an angle $\alpha$ relative to each other so that they can be considered as rays on the plane when viewed from the side. Through a tiny hole in one of the mirrors, a laser beam is launched at an angle $\beta$ as shown in the figure below:
Your task is to count the number of reflections of the laser beam from the mirrors before it goes to infinity. The angle of incidence of the beam on the mirror always coincides with the angle of reflection. The hole through which the beam is launched is extremely small, so we can assume that if the beam suddenly hits the hole, it will still be completely reflected according to the usual rules.
Given two integers $\alpha$ and $\beta$ --- angles given in degrees (1ドル \le \alpha \le 179,ドル 1ドル \le \beta \le 179$).
Print one integer --- the number of reflections.
30 35
4
90 90
0
30 60
3
In the first example, the beam is reflected as follows: