270A.md (1370B)
1 Source: https://codeforces.com/problemset/problem/270/A 2 3 A. Fancy Fence 4 5 time limit per test 6 7 2 seconds 8 9 memory limit per test 10 11 256 megabytes 12 13 input 14 15 stdin 16 17 output 18 19 stdout 20 21 Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot. 22 23 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*. 24 25 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*? 26 27 Input 28 29 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. 30 31 Output 32 33 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. 34 35 Examples 36 37 Input 38 39 ``` 40 3 41 30 42 60 43 90 44 ``` 45 46 Output 47 48 ``` 49 NO 50 YES 51 YES 52 ``` 53 54 Note 55 56 In the first test case, it is impossible to build the fence, since there is no regular polygon with angle . 57 58 In the second test case, the fence is a regular triangle, and in the last test case — a square.