Description: Given a positive integer n, find two non-negative integers a, b such that a2+ b2 = n. The first line contains the number of test cases T (1 < = T < = 1000). For each test case, there is only one line with an integer n (1 < = n < = 109) as defined above. For each test case, output two integers a, b separated by a single space such that a2+ b2 = n. If there are multiple solutions, anyone will be accepted. If there is no solution, output " -1" (without quotation marks) instead.
To Search:
File list (Check if you may need any files):
Untitled2.c
Untitled2.exe
Untitled2.o