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;
}
相关推荐
wuweijianlove11 分钟前
算法复杂度的实验估算与误差分布建模的技术7
算法
Chase_______15 分钟前
计算机数据存储全解:从底层进制转换到存储介质演进
java·开发语言·python
网络工程小王24 分钟前
【LangGraph 子图(Subgraph)详解】学习笔记
java·服务器·数据库·人工智能·langchain
小碗羊肉42 分钟前
【JavaWeb | 第七篇】部门管理项目实战
java·开发语言·servlet
佳xuan43 分钟前
简而言之c++
c++·算法
变量未定义~1 小时前
星际争霸、宝石塔的亮度差异、寻找食物储量
算法
YL200404261 小时前
027合并两个有序链表
java·数据结构·算法·链表
维诺菌1 小时前
claude code安装
java·开发语言·ai编程·calude
顶点多余1 小时前
自定义协议、序列化、反序列化实现
java·linux·开发语言·c++·tcp/ip
小新同学^O^1 小时前
简单学习 --> SpringAOP
java·学习·spring·aop