Codeforces Round 421 (Div. 2)
B
Mister B and Angle in Polygon
Codeforces
1300
原题
← AC →
翻译中…

On one quiet day all of sudden Mister B decided to draw angle $*a*$ on his field. Aliens have already visited his field and left many different geometric figures on it. One of the figures is regular convex $*n*$-gon (regular convex polygon with $*n*$ sides).

翻译中…

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 image (where $*v*_{2}$ is the vertex of the angle, and $*v*_{1}$ and $*v*_{3}$ lie on its sides) is as close as possible to $*a*$. In other words, the value image 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*$ and $*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 image. If there are multiple optimal solutions, print any of them. The vertices are numbered from $1$ to $*n*$ in clockwise order.

翻译中…

Note

翻译中…

In first sample 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 of $45$ degrees 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".

翻译中…

In third sample test, 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".

翻译中…

样例

Input #1
3 15
Output #1
1 2 3
InputCopy OutputCopy
Input #2
4 67
Output #2
2 1 3
InputCopy OutputCopy
Input #3
4 68
Output #3
4 1 2
InputCopy OutputCopy
题目信息
题号
820B
时间限制
2 s
内存限制
256 MB
标签
构造
计算几何
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。