Given an integer n, decide whether it can be represented as the sum of two squares of integers

INPUT SPECIFICATION:

The first line of input contains a single integer t <= 10000: the number of test cases. T, each of which consists of one integer 0 <= n <= 10^8.

OUTPUT SPECIFICATION:

For each test case, it is displayed Yesif it is possible to represent the given number as the sum of two squares and Noif this is not possible.

+3
source share
1 answer

Hint . The number N is expressed as the sum of two squares iff in a simple factorization of N, each prime number (4k + 3) occurs even the number of times!

+3
source

Source: https://habr.com/ru/post/1793343/


All Articles