Problem - A - Codeforces
Problem - A - Codeforces
|
QuanVanHoang | Logout
HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN
palindromic, while the arrays [1, 2, 3] and [21, 12] are not.
We call a number k an ideal generator if any integer n (n ≥ k ) can be represented as the sum of → Submit?
the elements of a palindromic array of length exactly k . Each element of the array must be
greater than 0. Language: Python 3.13.2
Almost always, if you send a solution
on PyPy, it works much faster
For example, the number 1 is an ideal generator because any natural number n can be
generated using the array [n]. However, the number 2 is not an ideal generator — there is no Choose
Chọn tệp Không có …được chọn
file:
palindromic array of length 2 that sums to 3.
Input
The first line of the input contains one integer t (1 ≤ t ≤ 1000 ) — the number of test cases.
The first and only line of each test case contains one integer k (1 ≤ k ≤ 1000 ).
Output
For each number k , you need to output the word "YES" if it is an ideal generator, or "NO"
otherwise.
You may output "Yes" and "No" in any case (for example, the strings "yES", "yes", and
"Yes" will be recognized as a positive answer).
Example
input Copy
5
1
2
3
73
1000
output Copy
YES
NO
YES
YES
NO
Supported by
https://codeforces.com/contest/2093/problem/A 1/2
22:16 8/4/25 Problem - A - Codeforces
https://codeforces.com/contest/2093/problem/A 2/2