301434: CF270A. Fancy Fence

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Fancy Fence

题意翻译

## 题目说明 Emuskald想在他的农场周围造一圈栅栏,但是他太懒了,不想自己动手。于是,他买了一个栅栏机器人。 Emuskald想把栅栏围成正多边形。机器人每次造一个边,之后只能转动a°继续建造下一个边。 Emuskald能造出他想要的围栏吗?也就是说,有没有一种正多边形的每一个角都为a°。 ## 输入输出格式 ###### 输入格式 第一行输入一个整数t,表示有t组样例输入。 之后的t行,每行一个整数a,表示转动的角度。 ###### 输出格式 如果围得出正多边形,输出“YES”(不要定义)。否则,输出“NO”(同上)。 (输入均不超过int类型) ## 输入输出样例 ##### 输入样例#1: 3 30 60 90 ##### 输出样例#1: NO YES YES ## 说明 第一组样例中,转动角度为30°,围不出正多边形。 第二组转动角度为60°,围出三角形。 第三组转动角度为90°,围出正方形。 感谢@PaulHunter 提供的翻译

题目描述

Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot. He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle $ a $ . Will the robot be able to build the fence Emuskald wants? In other words, is there a regular polygon which angles are equal to $ a $ ?

输入输出格式

输入格式


The first line of input contains an integer $ t $ ( $ 0<t<180 $ ) — the number of tests. Each of the following $ t $ lines contains a single integer $ a $ ( $ 0<a<180 $ ) — the angle the robot can make corners at measured in degrees.

输出格式


For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.

输入输出样例

输入样例 #1

3
30
60
90

输出样例 #1

NO
YES
YES

说明

In the first test case, it is impossible to build the fence, since there is no regular polygon with angle ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF270A/0bc9695322431ed07d3e711343afe48991039a08.png). In the second test case, the fence is a regular triangle, and in the last test case — a square.

Input

题意翻译

## 题目说明 Emuskald想在他的农场周围造一圈栅栏,但是他太懒了,不想自己动手。于是,他买了一个栅栏机器人。 Emuskald想把栅栏围成正多边形。机器人每次造一个边,之后只能转动a°继续建造下一个边。 Emuskald能造出他想要的围栏吗?也就是说,有没有一种正多边形的每一个角都为a°。 ## 输入输出格式 ###### 输入格式 第一行输入一个整数t,表示有t组样例输入。 之后的t行,每行一个整数a,表示转动的角度。 ###### 输出格式 如果围得出正多边形,输出“YES”(不要定义)。否则,输出“NO”(同上)。 (输入均不超过int类型) ## 输入输出样例 ##### 输入样例#1: 3 30 60 90 ##### 输出样例#1: NO YES YES ## 说明 第一组样例中,转动角度为30°,围不出正多边形。 第二组转动角度为60°,围出三角形。 第三组转动角度为90°,围出正方形。 感谢@PaulHunter 提供的翻译

加入题单

算法标签: