CF1096C.Polygon for the Angle

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given an angle ang\text{ang} .

The Jury asks You to find such regular nn -gon (regular polygon with nn vertices) that it has three vertices aa , bb and cc (they can be non-consecutive) with abc=ang\angle{abc} = \text{ang} or report that there is no such nn -gon.

If there are several answers, print the minimal one. It is guarantied that if answer exists then it doesn't exceed 998244353998244353 .

输入格式

The first line contains single integer TT ( 1T1801 \le T \le 180 ) — the number of queries.

Each of the next TT lines contains one integer ang\text{ang} ( 1ang<1801 \le \text{ang} < 180 ) — the angle measured in degrees.

输出格式

For each query print single integer nn ( 3n9982443533 \le n \le 998244353 ) — minimal possible number of vertices in the regular nn -gon or 1-1 if there is no such nn .

输入输出样例

  • 输入#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 1818 -gon. For example, v2v1v6=50\angle{v_2 v_1 v_6} = 50^{\circ} .

The example angle for the third query is v11v10v12=2\angle{v_{11} v_{10} v_{12}} = 2^{\circ} .

In the fourth query, minimal possible nn is 180180 (not 9090 ).

首页