0.5 Narcissistic Number
(RankList for this Question)
Score: 20pts
Time Limit: 2.00 sec
An n-digit number that is the sum of the \(n^{th}\) powers of its digits is called an n-narcissistic number.
\(6 = 6^{1}\)
\(371 =3^{3} + 7^{3} + 1^{3}\)
\(1634 = 1^{4} + 6^{4} + 3^{4} + 4^{4}\)

Constraints
\(1 \leq n \leq 6\)

Input Format
Input will contain the number of digits

Output Format
Print all the n-digit Narcissistic numbers separated by spaces in a single line

Example 1
Input:
1

Output:
0 1 2 3 4 5 6 7 8 9

Explanation:
All one digit numbers are narcissistic numbers
\(1 = 1^{1}\)
\(2 = 2^{1}\)
\(3 = 3^{1}\)
......

Example 2
Input:
6

Output:
548834

Explanation:
There is only one 6-digit number which satisfies the required condition
\(548834 = 5^{6} + 4^{6} + 8^{6} + 8^{6} + 3^{6} + 4^{6}\)

Log In to solve the Question