|
|||||||||||||||||||
|
SPOJ time: 2012-05-26 14:01:49 |
Diophantine equationProblem code: HS09EQ
Sometimes solving a Diophantine equation is very hard. But, for example, the equation a+b2+c3+d4=n has a trivial solution for every value of n. Your task is to determine the number of solutions of the equation for each given n, assuming that in the equation all the values a, b, c and d are non-negative integers. InputThe first line of input contains an integer T, representing the number of test cases (T<20000). The following T lines contain one non-negative integer n each, where n < 109.
OutputOutput T lines, each containing the number of solutions of the respective equation for n. ExampleInput: 5 0 1 10 100 1000 Output: 1 4 19 148 1476 ScoringFor solving this problem you will score 10 points.
|
||||||||||||||||||
| |||||||||||||||||||