#Lutece0480. Sumsets
Sumsets
Migrated from Lutece 480 Sumsets
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of . Here are the possible sets of numbers that sum to :
Help FJ count all possible representations for a given integer ().
Input
The first line of standard input contains (), the number of test cases.For each case, there is a single line with a single integer, .
Output
For each each case ,output a line with the number of ways to represent as the indicated sum. Due to the potential huge size of this number, print only last digits (in base representation).
Samples
2
7
8
6
10
Resources
2011 UESTC ACM Training for Math