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

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

http://www.xdnf.cn/news/2095.html

相关文章:

  • Maven 依赖冲突调解与版本控制
  • 百度AI开发者大会:连发多款AI应用,覆盖AI数字人等热门赛道
  • 【高频考点精讲】实现垂直居中的多种CSS方法比较与最佳实践
  • 2.4goweb项目上传到csdn的git仓库
  • 前端面试宝典---vue原理
  • 【OpenCV】第二章——图像处理基础
  • 丝杆升降机换油周期深度解析:从理论模型到自动化监测的全栈实践​
  • [官方IP] Shift RAM
  • Python 第 11 节课 - string 与 random 的方法
  • io_uring概述:现代 Linux 异步 IO 的新范式
  • 启动命令汇总(Redis / Kafka / Flume / Spark)
  • 【MCP Node.js SDK 全栈进阶指南】中级篇(5):MCP客户端高级开发
  • 云原生--核心组件-容器篇-3-Docker三大核心之--镜像
  • 19.【.NET 8 实战--孢子记账--从单体到微服务--转向微服务】--单体转微服务--当前项目拆分规划
  • 【10分钟读论文】Power Transmission Line Inspections电力视觉水文
  • 链表相交.
  • Java 日志:掌握本地与网络日志技术
  • 一文了解智慧教育顶刊TLT的研究热点
  • Linux进程地址空间
  • py语法基础理解
  • femap许可常见问题及解决方案
  • Vue 3 父子组件通信案例详解:Props 与 Emits 实战
  • 一洽 全力辅助商户平台在线咨询解决方案
  • 自定义异常处理(全局异常处理)
  • Vue多地址代理端口调用
  • Promethues 普罗米修斯
  • 小刚说C语言刷题——1565成绩(score)
  • 某地农产品交易中心钢网架自动化监测项目
  • 筛法求莫比乌斯函数
  • 4月25日星期五今日早报简报微语报早读