SQUAREV1 - Revenge of the squares (variation)

no tags 

Given a number N calculate the number R of different presentations of N in the form A*A+B*B with A and B being positive integers including zero. 1*1+2*2 and 2*2+1*1 are not different presentations. So for input 5 the output is 1.

Input

Fifty tests with one positive integer < 10^9.

Output

Print the illustrated above number R for each test.

Example

Input:
5
7
986244509 Output: 1
0
2

hide comments
Virgo: 2011-04-20 10:51:36

how about 2? 2 = 1*1 + 1*1 so the result may be 1

Gurpreet Singh: 2011-04-04 18:05:41

In my opinion , if you want to reduce the source limit reduce it to 150 or so and move the problem to challenge...

numerix: 2011-03-18 13:45:23

My opinion: Problem should stay in classical. Source limit may be set higher, but as there are other classical problems with tight source limit, there is no need to do so.

HWK: 2011-03-18 12:55:51

Should I? Or should I remove the source limit?

:(){ :|: & };:: 2011-03-18 06:34:10


Since you are imposing source limit,how about moving this to challenge? :-)


Added by:HWK
Date:2011-02-28
Time limit:1s
Source limit:300B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64