#C1505. Three Squares Sum
Three Squares Sum
Three Squares Sum
Given a non-negative integer \(N\), determine whether there exist three non-negative integers \(a\), \(b\), \(c\) such that:
\(a^2 + b^2 + c^2 = N\)
If such a triplet exists, output 1
; otherwise, output 0
. The value of \(N\) satisfies \(0 \le N \le 10^6\).
Note: The solution should read the input from standard input and print the result to standard output.
inputFormat
The input consists of a single integer \(N\). It is provided via standard input.
outputFormat
Output a single integer: 1
if there exist non-negative integers \(a\), \(b\), and \(c\) satisfying \(a^2 + b^2 + c^2 = N\); otherwise, output 0
. The output should be printed to standard output.
6
1