CF1096C.Polygon for the Angle
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
You are given an angle ang .
The Jury asks You to find such regular n -gon (regular polygon with n vertices) that it has three vertices a , b and c (they can be non-consecutive) with ∠abc=ang or report that there is no such n -gon.
If there are several answers, print the minimal one. It is guarantied that if answer exists then it doesn't exceed 998244353 .
输入格式
The first line contains single integer T ( 1≤T≤180 ) — the number of queries.
Each of the next T lines contains one integer ang ( 1≤ang<180 ) — the angle measured in degrees.
输出格式
For each query print single integer n ( 3≤n≤998244353 ) — minimal possible number of vertices in the regular n -gon or −1 if there is no such n .
输入输出样例
输入#1
4 54 50 2 178
输出#1
10 18 90 180
说明/提示
The answer for the first query is on the picture above.
The answer for the second query is reached on a regular 18 -gon. For example, ∠v2v1v6=50∘ .
The example angle for the third query is ∠v11v10v12=2∘ .
In the fourth query, minimal possible n is 180 (not 90 ).