A. Ideal Generator

time limit per test

1 second

memory limit per test

256 megabytes

We call an array aa, consisting of kk positive integers, palindromic if [a1,a2,...,ak]=[ak,ak−1,...,a1][a1,a2,...,ak]=[ak,ak−1,...,a1]. For example, the arrays [1,2,1][1,2,1] and [5,1,1,5][5,1,1,5] are palindromic, while the arrays [1,2,3][1,2,3] and [21,12][21,12] are not.

We call a number kk an ideal generator if any integer nn (n≥kn≥k) can be represented as the sum of the elements of a palindromic array of length exactly kk. Each element of the array must be greater than 00.

For example, the number 11 is an ideal generator because any natural number nn can be generated using the array [n][n]. However, the number 22 is not an ideal generator --- there is no palindromic array of length 22 that sums to 33.

Determine whether the given number kk is an ideal generator.

Input

The first line of the input contains one integer tt (1≤t≤10001≤t≤1000) --- the number of test cases.

The first and only line of each test case contains one integer kk (1≤k≤10001≤k≤1000).

Output

For each number kk, 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

解题说明:此题是一道数学题,找规律能发现,k为偶数时无法找到这样的回文数列,只有奇数可以。

cpp 复制代码
#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	while (t--)
	{
		int n;
		cin >> n;
		if (n % 2 == 1)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
	return 0;
}
相关推荐
Grey Zeng8 小时前
Java SE 25新增特性
java·jdk·jdk新特性·jdk25
雨白9 小时前
Java 线程通信基础:interrupt、wait 和 notifyAll 详解
android·java
架构师沉默13 小时前
设计多租户 SaaS 系统,如何做到数据隔离 & 资源配额?
java·后端·架构
Java中文社群14 小时前
重要:Java25正式发布(长期支持版)!
java·后端·面试
每天进步一点_JL15 小时前
JVM 类加载:双亲委派机制
java·后端
NAGNIP16 小时前
大模型框架性能优化策略:延迟、吞吐量与成本权衡
算法
用户2986985301416 小时前
Java HTML 转 Word 完整指南
java·后端
渣哥16 小时前
原来公平锁和非公平锁差别这么大
java
渣哥16 小时前
99% 的人没搞懂:Semaphore 到底是干啥的?
java
J2K16 小时前
JDK都25了,你还没用过ZGC?那真得补补课了
java·jvm·后端