An integer n may be represented as the sum of four squares of non-negative integers. Write a program to find out how many vectors (a,b,c,d) exist such that 0 <= a <= b <= c <= d and n = a2 + b2 + c2 + d2.
Each line of the input file will have one postive integer. Your program should compute the number of vectors (a,b,c,d) for which the above equation is satisfied. Your program will output each result on a separate line of the output file.
No line will contain more than 100 characters. No input value of n will be less that 1 or greater than 10,000.
4 12 49
5 8 44
Note: The above sample output is generated assuming that 0<= a, b, c, d rather than 0 <= a <= b <= c <= d. Either solution was accepted as a correct one.