Submit solution
Points:
30 (partial)
Time limit:
1.0s
Memory limit:
64M
Author:
Problem types
Allowed languages
C, C++, Java, Pascal, Python
Sum of Powers
Write a program that reads a natural number and prints the count of natural numbers that do not exceed and can be expressed as the sum of a power of , a power of , and a power of (e.g., ).
Input
Only one line containing the number .
Output
Only one line containing exactly one natural number: your answer.
Example of Input - Output Files:
STDIN (sumofpow.in)
10
STDOUT (sumofpow.out)
8
Constraints
- .
Comments