Check if a given number is perfect or not. A number is perfect if sum of factorial of its digit is equal to the given number. For example 145 is a Perfect Number because 1! + 4! + 5! = 145
The first line of input contains an integer T denoting the number of test cases. For each test case there will be single line which contains an integer N.
Corresponding to each test case, in a new line, print "Perfect " if it follow above condition else print "Not Perfect" without quotes.
1 <= T <= 50
1 <= N <= 104
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.