CF1266B.Dice Tower

入门

通过率:0%

时间限制:1.00s

内存限制:256MB

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.

鲍勃正在玩六面骰子。一个标准立方体骰子的展开图如下所示:

他拥有无限数量的此类骰子,并希望将多个骰子堆叠起来构成一座塔,且可自由选择每个骰子的朝向。随后,他统计该塔所有可见面上的点数(pips)总数。

例如,下图所示塔的可见点数总和为 2929:顶部可见点数为 11;从南侧可见点数为 55 和 33;从西侧可见点数为 44 和 22;从北侧可见点数为 22 和 44;从东侧可见点数为 33 和 55。

位于最底部的骰子底面,以及各相邻骰子相互接触的两个面(其点数均为 66),均不可见,因此不计入总数。

此外,鲍勃有 tt 个他喜爱的整数 xix_i;对每个这样的整数,他的目标是构造一座塔,使其可见点数之和恰好等于 xix_i。请针对鲍勃的每一个喜爱整数,判断是否能够构造出可见点数之和恰好为该整数的塔。

输入格式

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

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

第一行包含一个整数 tt(1≤t≤10001 \leq t \leq 1000)—— 表示鲍勃最喜爱的整数的个数。

第二行包含 tt 个以空格分隔的整数 xix_i(1≤xi≤10181 \leq x_i \leq 10^{18})—— 鲍勃最喜爱的整数。

输出格式

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

对于鲍勃的每个最爱整数,如果能够建造该塔,则输出 “YES”,否则输出 “NO”(引号仅用于明确界定)。

输入输出样例

  • 输入#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.

第一个例子在题目描述中已提及。

在第二个例子中,可以通过翻转前一座塔顶部的骰子来构建新塔。

在第三个例子中,可以使用一个顶面点数为 55 的单个骰子。

第四个例子是不可能实现的。

输入解题思路,AI测评打分。不知道怎么写?

首页