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;
}
相关推荐
z200509303 分钟前
今日算法(二叉树)
数据结构·c++·算法
sleepcattt6 分钟前
Java反射技术
java
小锋java12347 分钟前
【技术专题】Spring AI 2.0 - Advisors —— 拦截器模式增强AI能力
java·人工智能
AI人工智能+电脑小能手7 分钟前
【大白话说Java面试题 第56题】【JVM篇】第16题:JVM有哪些垃圾收集器?
java·开发语言·jvm·面试
南境十里·墨染春水8 分钟前
八大排序算法 - 基数排序
算法·排序算法
老四啊laosi9 分钟前
[滑动窗口] 12. 将 x 减到 0 的最小操作数
算法·leetcode·将 x 减到 0 的最小操作数
一条大祥脚9 分钟前
Codeforces Round 1098 (Div. 2)
算法·深度优先
时空自由民.13 分钟前
平衡车PID控制系统(豆包版本)
算法
二哈赛车手32 分钟前
新人笔记---简易版AI实现以图搜图功能
java·人工智能·笔记·spring·ai
sno_guo32 分钟前
直播抠图技术100谈之25---调色中曲线是最优解
人工智能·算法·机器学习·直播·内容运营·obs抠图·直播技术