All submissions for this problem are available.
An Adventure Club in UVCE usually goes for trekking. Some members thought that, simply climbing the hill is not very interesting. They came up with a new idea to find the perfectness of the hill. you are given the slant height of the hill, and your task is to help the UVCE Adventure Club to decide whether the hill is perfect or not.
Adventure Club thinks that all the hills are typically in the shape of isosceles triangles and for given slant height, if the height of the hill can be integer and base-width can be an even integer then the hill is said to be PERFECT, otherwise it is IMPERFECT.
First line of the input contains the T, number of test cases.
Each test case contains a single line containing an integer S, the slant height of the hill.
For each test case output PERFECT,if the hill is perfect otherwise output IMPERFECT.
- 1 ≤ T ≤ 10000
- 1 ≤ S ≤ 1000000
- An isosceles triangle whose equal sides are 5 units can have 4 unit height and base width can be 6 units.
- For a isosceles triangle whose equal sides are 7 units, there is no possibility of having integral height and base width of even integer.
|Time Limit:||0.15625 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, 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