| 2025 GUC Winter Camp |
|---|
| Закончено |
Gohary and Tawfik are arguing about number theory. Gohary claims that any number can be expressed as the sum of three perfect squares, but Tawfik disagrees and challenges him to prove it.
Given a positive integer $$$x$$$, determine whether there exist integers $$$a$$$, $$$b$$$, and $$$c$$$ such that: $$$$$$a^2 + b^2 + c^2 = x$$$$$$ where $$$1 \leq a \leq b \leq c$$$.
Help Gohary settle this debate by determining if such a representation exists!
The input consists of a single integer $$$x$$$ ($$$1 \leq x \leq 10^{8}$$$) — the target sum.
Output YES if there exist integers $$$a$$$, $$$b$$$, $$$c$$$ with $$$1 \leq a \leq b \leq c$$$ such that $$$a^2 + b^2 + c^2 = x$$$.
Output NO otherwise.
Are you Waiting for samples !!! Read the title
| Название |
|---|


