Problem D : Squares
Time Limit : 1 seconds For any positive integer N , N = a1^2 + a2^2 + .... + an^2 that is , any positive integer can be represented as sum of squares of other numbers. Your task is to print the smallest 'n' such that N = a1^2 + a2^2 + .... + an^2 .Input :
The first line of the input will contain an integer 't' which indicates the number of test cases to follow. Each test case will contain a single integer 'N' (1<=N<=10000) on a line by itself.Output :
Print an integer which represents the smallest 'n' such that N = a1^2 + a2^2 + .... + an^2.Sample input :
5 1 2 3 4 50Sample output
1 2 3 1 2Explanation for sample test cases :
5 -> number of test cases 1 = 1^2 (1 term) 2 = 1^2 + 1^2 (2 terms) 3 = 1^2 + 1^2 + 1^2 (3 terms) 1 = 2^2 (1 term) 2 = 5^2 + 5^2 (2 terms)Problem Setter : Siddharth S
Written for Samhita '08