#C1079. Sum of Two Squares
Sum of Two Squares
Sum of Two Squares
Given an integer ( k ), determine whether it can be expressed as the sum of two squares of non-negative integers, i.e., check if there exist non-negative integers ( x ) and ( y ) such that ( k = x^2 + y^2 ). This problem involves mathematical reasoning and efficient computation of integer square roots.
inputFormat
The input consists of a single integer ( k ) (where ( 0 \le k \le 10^6 )) provided via standard input.
outputFormat
Output ( True ) if there exist non-negative integers ( x ) and ( y ) satisfying ( k = x^2 + y^2 ); otherwise, output ( False ). The result should be printed to standard output.## sample
5
True