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;
}
相关推荐
豐儀麟阁贵7 小时前
5.6对象
java·开发语言
CoovallyAIHub7 小时前
视觉语言模型(VLM)深度解析:如何用它来处理文档?
深度学习·算法·计算机视觉
格格步入7 小时前
🤔一次 OOM 排查(dump文件分析)
java·后端
蓝-萧7 小时前
Spring Security安全框架原理与实战
java·后端
Moe4887 小时前
CompletableFuture方法大全和使用详解(一步到位)
java·性能优化
CoovallyAIHub7 小时前
估值百亿独角兽创始人硕士论文曝光!宇树科技王兴兴的“性价比”思维10年前就已注定
深度学习·算法·计算机视觉
敲代码的嘎仔8 小时前
数据结构算法学习day3——二分查找
java·开发语言·数据结构·学习·程序人生·算法·职场和发展
代码不停8 小时前
JavaEE多线程进阶
java·数据结构·java-ee
SimonKing8 小时前
聊聊Spring里那个不打扰Controller就能统一改响应的“神器”
java·后端·程序员
鹓于8 小时前
Excel图片批量插入与文件瘦身
java·服务器·数据库