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;
}
相关推荐
易只轻松熊23 分钟前
C++(23):容器类<vector>
开发语言·数据结构·c++
小学生的信奥之路30 分钟前
力扣1991:找到数组的中间位置(前缀和)
数据结构·算法·leetcode·前缀和·数组
এ᭄画画的北北35 分钟前
力扣-102.二叉树的层序遍历
数据结构·算法·leetcode
ccLianLian36 分钟前
数据结构·字典树
数据结构·算法
Lu Yao_1 小时前
用golang实现二叉搜索树(BST)
开发语言·数据结构·golang
找不到、了1 小时前
Spring-Beans的生命周期的介绍
java·开发语言·spring
caihuayuan42 小时前
React Native 0.68 安装react-native-picker报错:找不到compile
java·大数据·sql·spring·课程设计
爱编程的鱼2 小时前
C#接口(Interface)全方位讲解:定义、特性、应用与实践
java·前端·c#
旋风菠萝2 小时前
深入理解Java中的Minor GC、Major GC和Full GC
java·jvm·gc
苹果酱05672 小时前
React方向:react脚手架的使用
java·vue.js·spring boot·mysql·课程设计