Description
This problem is a programming version of Problem 30 from projecteuler.net
Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:
4 4 4 4
1634=1 +6 +3 +4
4 4 4 4
8208=8 +2 +0 +8
4 4 4 4
9474=9 +4 +7 +4
As 1 = 1^4 is not a sum it is not included.
The sum of these numbers is 1634+8208+9474=19316.
Find the sum of all the numbers that can be written as the sum of Nth powers of their digits.
Input Format
Input contains an integer N
Output Format
Print the answer corresponding to the test case.
Constraints
3≤N≤6
Sample Input
Sample Output




Reviews
There are no reviews yet.