原题链接:http://codeforces.com/problemset/problem/903/A

A. Hungry Student Problem
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Ivan's classes at the university have just finished, and now he wants to go to the local CFK cafe and eat some fried chicken.

CFK sells chicken chunks in small and large portions. A small portion contains 3 chunks; a large one — 7 chunks. Ivan wants to eat exactly x chunks. Now he wonders whether he can buy exactly this amount of chicken.

Formally, Ivan wants to know if he can choose two non-negative integers a and b in such a way that a small portions and blarge ones contain exactly x chunks.

Help Ivan to answer this question for several values of x!

Input

The first line contains one integer n (1 ≤ n ≤ 100) — the number of testcases.

The i-th of the following n lines contains one integer xi (1 ≤ xi ≤ 100) — the number of chicken chunks Ivan wants to eat.

Output

Print n lines, in i-th line output YES if Ivan can buy exactly xi chunks. Otherwise, print NO.

Example
input
2
6
5

output
YES
NO

Note

In the first example Ivan can buy two small portions.

In the second example Ivan cannot buy exactly 5 chunks, since one small portion is not enough, but two small portions or one large is too much.

重点:3与7互质,根据不定方程的整数解,进行特判6个不符合条件的数,其后全为符合条件的数

#include<cstdio>int main()
{int n;scanf("%d", &n);for(int i = 0; i < n; i++){int temp;scanf("%d", &temp);if(temp == 1 || temp == 2 || temp == 4 || temp == 5 || temp == 8 || temp == 11)printf("NO\n");elseprintf("YES\n");}return 0;
}

Hungry Student Problem_Codeforces相关推荐

  1. Codeforces 题目合集+分类+代码 【Updating...】【361 in total】

    961A - Tetris                                                模拟                                      ...

  2. Qt入门基础知识(vs2017+Qt5.12)

    声明:参考(最新QT从入门到实战完整版|传智教育_哔哩哔哩_bilibili) 做的笔记. #pragma execution_character_set("utf-8")//防止 ...

  3. Qt(c++)入门知识总结

    文章目录 信号槽机制 .pro文件 按钮(QPushButton) Qt窗口坐标系 Lambda QMainWindow 菜单栏: 工具栏 状态栏 铆接部件(浮动窗口) 核心部件(中心部件) 资源文件 ...

  4. 乔布斯+斯坦福演讲+Stay Hungry. Stay Foolish.

    乔布斯+斯坦福演讲+Stay Hungry. Stay Foolish. 只有那些疯狂到以为自己能够改变世界的人,才能真正改变世界 You can't connect the dots looking ...

  5. Stay Hungry, Stay Foolish(求知若饥,虚心若愚)

    Stay Hungry, Stay Foolish(求知若饥,虚心若愚) I am honored to be with you today at your commencement from one ...

  6. Stay hungry, Stay foolish 的原义

    乔布斯在斯坦福大学毕业演讲中说过,他最喜欢的一句话叫做"Stay hungry, Stay foolish". "Stewart和他的人出了好几期<地球产品目录&g ...

  7. Stay Hungry. Stay Foolish

    史蒂夫 乔布斯(Steve Paul Jobs)苹果电脑公司和皮克斯动画公司(Pixar)首席执行官.以下是Steve Jobs在2005年6月12日斯坦福大学毕业典礼上的演讲. "Stay ...

  8. 重温乔布斯在斯坦福大学的经典演讲------Stay Hungry, Stay Foolish

    多年前, 早就把乔布斯在斯坦福大学的演讲吟诵得滚瓜烂熟了, 现在还经常在嘴里蹦出几句经典的话语. 周末在家, 打开视频, 听听, 再次震彻人心.  刚才自己又朗读了一遍, 还是很顺畅, 朗朗上口. 最 ...

  9. 乔布斯2005年斯坦福大学毕业典礼演讲原文 – Stay hungry, stay foolish

    转自:http://blog.csdn.net/souichiro/article/details/6284040 http://baidu.ku6.com/watch/635291011978059 ...

最新文章

  1. android bitmap 转drawable,android Drawable转换成Bitmap失败
  2. PHP自动加载__autoload的工作机制
  3. ServiceStack.Redis——Redis于.net向上client解
  4. 【嵌入式】C语言高级编程-长度为0的数组(05)
  5. 青岛旅游学校计算机证书,【我和我的旅校】青岛旅游学校优秀毕业生郭千瑜
  6. 文本标注工具——doccano
  7. SQL练习之两个列值的交换
  8. 博士申请 | 新加坡国立大学Xinchao Wang老师招收图神经网络方向博士/博后
  9. Spark/Flink/CarbonData技术实践最佳案例解析
  10. 鸡兔同笼的两种求解(C语言)
  11. 自学mysql教程 资料_数据库MYSQL,自学,命令,教程。
  12. InfoPath 2007 常见问题
  13. torch.cuda.amp.GradScaler(enabled=CFG.apex)是什么意思?
  14. Android 商品详情页
  15. 程序员养生书单,九本必读养生书籍,颈椎按摩,脊椎按摩,脱发植发
  16. 关于Error during artifact deployment. See server log for details.问题
  17. 机器学习--多层感知机、卷积神经网络、循环神经网络
  18. 如何自己搭建一个个人网站?
  19. 19.0~19.11 Dates, Calendars, and Events 日历事件的处理
  20. spring整合jdbc配置文件

热门文章

  1. Viewstate verification failed 解决办法
  2. 神经网络知识点总结,神经网络基础与应用
  3. 泰课在线零基础高级篇最后案例的完成笔记
  4. 关于微信小程序云开发,申请退款接口返回“订单不存在”的问题
  5. 这种MOS管的拆装方法,你知道嘛
  6. 全面了解Mysql(五)表
  7. LeetCode第977题 有序数组的平方(c++)
  8. 大学里软件工程专业学习的主要课程
  9. QML 之 real 数据保留小数点后两位
  10. Python 信号处理——时域同步平均技术(TSA)