#B3841. Narcissistic Number Checker
Narcissistic Number Checker
Narcissistic Number Checker
Given a positive integer, determine whether it is a Narcissistic Number (also known as a self-power number). A number with N digits is called narcissistic if the sum of its digits raised to the power N equals the number itself. For example, we have: $$153 = 1^3 + 5^3 + 3^3$$ and $$1634 = 1^4 + 6^4 + 3^4 + 4^4$$.
inputFormat
The first line contains a positive integer T, denoting the number of test cases. Each of the following T lines contains a single positive integer.
outputFormat
For each test case, output Yes if the number is a Narcissistic Number; otherwise, output No. Each answer should be printed on a new line.
sample
3
153
1634
123
Yes
Yes
No
</p>