#K89417. Checkerboard Polygon Pattern
Checkerboard Polygon Pattern
Checkerboard Polygon Pattern
You are given a polygon with n sides. Your task is to determine whether it is possible to form a perfect checkerboard pattern using tiles of that polygon.
A perfect checkerboard pattern can only be obtained with square tiles. That is, when the polygon has 4 sides.
In this problem, if n = 4, print YES 90
, otherwise print NO
. The value 90
corresponds to the interior angle of a square. In general, the interior angle \( \theta \) of a regular polygon with n sides is given by:
\( \theta = \frac{(n-2) \times 180}{n} \)
However, note that only when n = 4 can a complete checkerboard pattern be formed.
inputFormat
The first line contains a single integer T representing the number of test cases. The next T lines each contain a single integer n, the number of sides of the polygon.
outputFormat
For each test case, output a line containing the result. If the polygon can form a checkerboard pattern, print YES 90
, otherwise print NO
.
2
3
4
NO
YES 90
</p>