Solve this Equation

Find number of solutions to the integer equation: 36a2 + 18b2 + 6c2 = 5 ∗ N , where N is a square (i.e., N = n2 for some integer n), where a, b, c are integers. Input A number of of inputs (≤ 1000), each start with the number of value of integer N (|N| < 1000000). Output Output the number of solutions. Output ‘-1’, if there is an infinite number of solutions. Sample Input 0 4 Sample Output 1 0