All submissions for this problem are available.
Ruskin needs a railing around his swimming pool, but he is too lazy to build it himself. So he purchased a railing-building machine.
He wants the railing to be a regular polygon. The machine builds the railing along a single path, but it can only make railing corners at a single angle a.
Will the machine be able to build the railing Ruskin wants? In other words, is there a regular polygon which angles are equal to a?
- The first line of input contains an integer t -the number of tests. Each of the following t lines contains a single integer a — the angle the machine can make corners at measured in degrees.
T test cases follows:"
- For each test, output on a single line "YES" (without quotes), if the machine can build a railing Ruskin wants, and "NO" (without quotes), if it is impossible.
- 1 ≤ T ≤ 179
- 1 ≤ a ≤ 179
Input: 3 30 60 90 Output: NO YES YES
case 1. It is impossible to build the Railing, since there is no regular polygon with angle.
case 2. The Railing is a regular triangle, and in the last test case — a square.
|Time Limit:||0.166667 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, CLOJ, FS|
Fetching successful submissions