eolymp
bolt
Try our new interface for solving problems
Problems

A Simple Problem

A Simple Problem

For a given positive integer \textbf{n}, please find the smallest positive integer \textbf{x} that we can find an integer \textbf{y} such that \textbf{y^2 = n + x^2}. \InputFile The first line is an integer \textbf{T}, which is the the number of cases. Then \textbf{T} line followed each containing an integer \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{10^9}). \OutputFile For each integer \textbf{n}, please print output the \textbf{x} in a single line, if \textbf{x} does not exit , print \textbf{-1} instead.
Time limit 1 second
Memory limit 64 MiB
Input example #1
2
2
3
Output example #1
-1
1