当前位置: 首页 > news >正文

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为偶数时无法找到这样的回文数列,只有奇数可以。

#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;
}

相关文章:

  • 【数据融合】基于拓展卡尔曼滤波实现雷达与红外的异步融合附matlab代码
  • 部署大模型需要多少GPU显存?以DeepSeek R1部署为例
  • 直接映射例题及解析
  • [笔记] MCPO搭建教程
  • 【Kafka】Windows环境下生产与消费流程详解(附流程图)
  • VO包装类和实体类分别是什么?区别是什么?
  • Jmeter如何取JDBC request响应参数作为下一个接口的值?
  • ORACLE数据库备份入门:第四部分:2-备份场景举例
  • SpringCloud组件——OpenFeign
  • MySQL 中 SQL 语句的详细执行过程
  • Debian安装避坑
  • 基于Matlab的MDF文件导入与处理研究
  • 59. Java 类和对象 - 方法的返回值
  • JSAPI2.4——正则表达式
  • Network.framework 的引入,不是为了取代 URLSession
  • Oracle EBS 零金额的AP付款无法过账数据修复
  • 基于开源技术体系的品牌赛道力重构:AI智能名片与S2B2C商城小程序源码驱动的品类创新机制研究
  • Unity text 表情和超链接解决方案。
  • 交换机之配置系统基本信息(Basic Information of the Configuration System for Switches)
  • 百度搜索AI开放计划:让应用连接精准流量的秘诀
  • 中公教育薪酬透视:董监高合计涨薪122万,员工精简近三成
  • 传智教育连续3个交易日跌停:去年净利润由盈转亏
  • 荣盛发展去年亏损约84.43亿元,要“过苦日子、紧日子”
  • 中央纪委办公厅公开通报3起整治形式主义为基层减负典型问题
  • 最高法改判一起植物新品种侵权案:判赔逾5300万元破纪录
  • 由重商主义观察世界现代化历程