Problem1579--CF820 - B. Mister B and Angle in Polygon

1579: CF820 - B. Mister B and Angle in Polygon

[Creator : ]
Time Limit : 2.000 sec  Memory Limit : 256 MiB

Description

On one quiet day all of sudden Mister B decided to draw angleaon his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures isregular convexn-gon(regular convex polygon withnsides).
That's why Mister B decided to use this polygon. Now Mister B must find three distinct vertices $v_1,v_2,v_3$ such that the angle $\angle v_1v_2v_3$ (where $v_2$ is the vertex of the angle, and $v_1$ and $v_3$ lie on its sides) is as close as possible toa. In other words, the value $|\angle v_1v_2v_3-a|$ should be minimum possible.
If there are many optimal solutions, Mister B should be satisfied with any of them.

Input

First and only line contains two space-separated integers $n,a\ (3≤n≤10^5,\ 1≤a≤180)$ − the number of vertices in the polygon and the needed angle, in degrees.

Output

Print three space-separated integers: the vertices $v_1,v_2,v_3$, which form $\angle v_1v_2v_3$. If there are multiple optimal solutions, print any of them. The vertices are numbered from $1$ to $n$ in clockwise order.

Sample 1 Input

3 15

Sample 1 Output

1 2 3
test vertices of regular triangle can create only angle of $60$ degrees, that's why every possible angle is correct.
Vertices of square can create $45$ or $90$ degrees angles only. That's why in second sample test the angle of45degrees was chosen, since $|45-67|<|90-67|$. Other correct answers are: "3 1 2", "3 2 4", "4 2 3", "4 3 1", "1 3 4", "1 4 2", "2 4 1", "4 1 3", "3 1 4", "3 4 2", "2 4 3", "2 3 1", "1 3 2", "1 2 4", "4 2 1".

Sample 2 Input

4 67

Sample 2 Output

2 1 3

Sample 3 Input

4 68

Sample 3 Output

4 1 2
on the contrary, the angle of $90$ degrees was chosen, since $|90-68|<|45-68|$. Other correct answers are: "2 1 4", "3 2 1", "1 2 3", "4 3 2", "2 3 4", "1 4 3", "3 4 1".

HINT

Source/Category