A squared plus B squared
A squared plus B squared
Albert is an enthusiastic mathematician. He states that he knows all pythagorean triples that use the numbers from 1 to 1000. Naturally you feel obligated to one up Albert and wish to create a program that given any non-negative integer \(c\) you can find two non-negative integers \(a\) and \(b\) such that \(a^2 + b^2 = c\) if two such integers exist
Input Specification
The first line contains one integer \(c\)
Output Specification
Output 2 space seperated integers \(a\) and \(b\) on a single line or -1 if no such pair exists
If multiple solutions exist, output the solution with the smallest value for \(a\)
Bounds
\(0 \leq c \leq 10^{12}\)
Sample Input
89
Sample Output
5 8
Comments