A8964 | Fancy Fence
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
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$ ?
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 .
In the second test case, the fence is a regular triangle, and in the last test case — a square.
In the second test case, the fence is a regular triangle, and in the last test case — a square.
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted