CF1266B.Dice Tower

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Bob is playing with 66 -sided dice. A net of such standard cube is shown below.

He has an unlimited supply of these dice and wants to build a tower by stacking multiple dice on top of each other, while choosing the orientation of each dice. Then he counts the number of visible pips on the faces of the dice.

For example, the number of visible pips on the tower below is 2929 — the number visible on the top is 11 , from the south 55 and 33 , from the west 44 and 22 , from the north 22 and 44 and from the east 33 and 55 .

The one at the bottom and the two sixes by which the dice are touching are not visible, so they are not counted towards total.

Bob also has tt favourite integers xix_i , and for every such integer his goal is to build such a tower that the number of visible pips is exactly xix_i . For each of Bob's favourite integers determine whether it is possible to build a tower that has exactly that many visible pips.

输入格式

The first line contains a single integer tt ( 1t10001 \leq t \leq 1000 ) — the number of favourite integers of Bob.

The second line contains tt space-separated integers xix_i ( 1xi10181 \leq x_i \leq 10^{18} ) — Bob's favourite integers.

输出格式

For each of Bob's favourite integers, output "YES" if it is possible to build the tower, or "NO" otherwise (quotes for clarity).

输入输出样例

  • 输入#1

    4
    29 34 19 38
    

    输出#1

    YES
    YES
    YES
    NO
    

说明/提示

The first example is mentioned in the problem statement.

In the second example, one can build the tower by flipping the top dice from the previous tower.

In the third example, one can use a single die that has 55 on top.

The fourth example is impossible.

首页