#K88942. Sum of Two Distinct Squares
Sum of Two Distinct Squares
Sum of Two Distinct Squares
Given an integer \(N\), determine whether it can be expressed as the sum of two distinct non-zero perfect squares. In other words, check if there exist two different integers \(a\) and \(b\) (with \(a \neq b\) and \(a, b \neq 0\)) such that \(N = a^2 + b^2\). For example, when \(N = 5\), it can be represented as \(1^2 + 2^2\), so the output should be True
; however, for \(N = 3\), there is no valid pair, and the output should be False
.
Your task is to read the integer from the standard input, perform the required check, and print the result to the standard output.
inputFormat
The input consists of a single integer \(N\) read from standard input.
outputFormat
Output a single line containing either True
or False
(without quotes) indicating whether \(N\) can be expressed as the sum of two distinct non-zero perfect squares.
5
True