WUSTOJ 1326: Graph(Java)费马数

题目链接:1326: Graph

参考博客:HNUSTOJ-1617 Graph(费马数)——G2MI

Description

Your task is to judge whether a regular polygon can be drawn only by straightedge and compass.

The length of the straightedge is infinite.

The width of the compass is infinite.

The straightedge does not have scale.

你的任务是判断一个正多边形是否只能用直尺和圆规来画。

直尺的长度是无限的。

圆规的宽度是无限的。

直尺没有刻度。

Input

There are several test cases. Each test case contains a positive integer n (3<=n<=10^9).

The input will be ended by the End Of File.

有几个测试用例。每个测试用例包含一个正整数 n(3 <= n <= 109)。

输入将在文件末尾结束。

Output

If the regular polygon with n sides can be drawn only by straightedge and compass, output YES in one line, otherwise, output NO in one line.

如果只用直尺和圆规就能画出 n 边的正多边形,则输出 YES 在一行,否则输出 NO 在一行。

Sample Input

3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
999999999
1000000000

Sample Output

YES
YES
YES
YES
NO
YES
NO
YES
NO
YES
NO
NO
YES
YES
YES
NO
NO
上一篇:html 标签内联元素和块元素分类【转】


下一篇:【POJ 2251】Dungeon Master(bfs)