#P9913. 「RiOI-03」water problem
「RiOI-03」water problem
Problem Description
Given a positive integer , determine whether a square can be divided into smaller squares (not necessarily of the same size). Output Yes or No. There are multiple test cases.
A non-strict definition of “dividing” can be understood as making one cut. However, each cut must be a line segment, and its endpoints must lie on the boundary of the square or on previously made cut segments.
Input Format
The first line contains a positive integer .
For each test case, one line contains a positive integer .
Output Format
For each test case, output one string per line: Yes or No, indicating whether such a division exists.
3
4
3
256
Yes
No
Yes
Hint
Sample Explanation 1
Clearly, a square cannot be divided into smaller squares.
Since and , both of them can be divided into several congruent smaller squares.
Constraints
- Subtask 0 (10 pts): is even.
- Subtask 1 (35 pts): .
- Subtask 2 (55 pts): No special restrictions.
For all testdata, and .
Translated by ChatGPT 5