MOSAPLGN - Easy Task
Mosa loves geometry, his lifelong ambition is to become a geometry teacher to teach children geometry, one day he wrote down N angles (in degrees), and he wonders if he can construct a polygon using all of the N angles he had written.
Help Mosa with his easy task.
Input
The first line contains a single integer T (1 <= T <= 100) – the number of test cases. Then follow T lines. Each line contains a positive integer N (3 <= Ni <= 20) – the number of angles, then follows N real numbers (1 < Ni < 180) separated by spaces.
Output
For each test case print one line that contains "POSSIBLE" if it’s possible for Mosa to construct a polygon with N angles, otherwise print "IMPOSSIBLE" if it’s not possible.
Example
Input:
3
3 60 62.5 57.5
4 135.5 44.5 135.5 44.5 4 100 95 160 10 Output: POSSIBLE
POSSIBLE
IMPOSSIBLE
Added by: | eagle93 |
Date: | 2014-06-24 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |