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;
}
相关推荐
高冷小鱼殿下11 小时前
内部类Lambda与枚举
java·开发语言
番茄味城市甜菜12 小时前
数据结构:双向链表实现,链表与顺序表的对比
数据结构·链表
怕浪猫12 小时前
Super-agent 在各大模型厂商的应用情况
算法·面试·github
小蒜学长12 小时前
编程语言在线学习平台的设计与实现(代码+数据库+LW)
java·spring boot·后端·编程语言在线学习平台·在线编码
海绵宝宝转agent12 小时前
LeetCode100 二叉树个人题解
算法·leetcode·深度优先
octopus_c12 小时前
C++ 模板详解:函数模板、类模板、特化与分离编译
开发语言·c++·算法
東隅已逝,桑榆非晚12 小时前
算法1. 双指针法-移动零
c++·算法
步行cgn13 小时前
Spring MVC 执行流程详解:一次请求的完整旅程
java·spring·mvc
增量星球13 小时前
Spring AI 2.0 Tool Calling 到底怎么跑起来的:从 @Tool 到两次模型调用
java·agent·springai·ai coding
步行cgn13 小时前
Spring MVC 九大核心角色详解:请求处理链路中的每一个关键组件
java·spring·mvc