
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can use dynamic programming, where dp[k][j] represents the number of ways to express k as the sum of the x-th power of unique positive integers such that the biggest possible number we use is j.
To calculate dp[k][j], you can iterate over the numbers smaller than j and try to use each one as a power of x to make our sum k.