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;
}
相关推荐
j7~10 分钟前
【数据结构初阶】顺序表增删查改代码实现--详解
数据结构·顺序表·动态顺序表·静态顺序表
枕星而眠32 分钟前
【数据结构】红黑树入门指南
运维·数据结构·c++·后端
2601_9498177237 分钟前
C++指针与引用深度精讲:底层原理、差异对比与高阶实战陷阱
java·jvm·c++
va学弟1 小时前
Java 网络通信编程(10):Channel 和 Selector
java·开发语言
小张小张爱学习1 小时前
Apache Dubbo 3 + Spring Boot 3 多模块 Maven 项目,演示基于 Zookeeper 注册中心的 RPC 调用
java·dubbo
Keven_111 小时前
算法札记:如何卡SPFA
算法·spfa
可编程芯片开发1 小时前
基于电压电流双闭环控制的三相整流器系统simulink建模与仿真
算法
可编程芯片开发2 小时前
基于ADRC自抗扰算法的UAV飞行姿态控制系统simulink建模与仿真
算法
学究天人2 小时前
数学公理体系大全:第七章 连续统假设与力迫法简介
人工智能·算法·机器学习·数学建模·动态规划·图论·抽象代数
阿pin2 小时前
Java随笔-ConcurrentHashMap
java·开发语言·哈希算法