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,...,a1a1,a2,...,ak=ak,ak−1,...,a1. For example, the arrays 1,2,11,2,1 and 5,1,1,55,1,1,5 are palindromic, while the arrays 1,2,31,2,3 and 21,1221,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 nn. 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;
}
相关推荐
晚风予卿云月几秒前
【前缀和】一维前缀和 & 二维前缀和
数据结构·c++·算法
Old Uncle Tom3 分钟前
Harness Engineering 综述
java·开发语言·数据库
星原望野6 分钟前
JAVA:策略模式的实战使用
java·开发语言·策略模式
LJianK17 分钟前
java多态
java·开发语言·python
YL2004042615 分钟前
071字符串解码
数据结构·leetcode
林文韬32722 分钟前
逐位二进制拼接 → 翻转 → 去头零 → 消邻重
算法
变量未定义~22 分钟前
单点修改、区间求和(模板)、区间修改,单点查询(模板)
数据结构·算法
z落落25 分钟前
C# 构造函数(无参/有参/重载/this)+析构函数(终结器)|GC 垃圾回收
java·开发语言·c#
武子康25 分钟前
Java-12 深入浅出 MyBatis 二级缓存详解:跨 SqlSession 共享与失效机制
java·后端
weixin_4684668532 分钟前
SURF 图像特征提取算法新手实战指南
图像处理·人工智能·算法·机器视觉·surf·sift