题目描述
Problem Description
In the world of Tivat where Pink Rabbit resides, there are $n$ types of elements. Each element can contain a certain amount of energy, and different elements can react with each other.
Pink Rabbit has mastered these $n$ elements. Initially, the energy contained in each element he possesses is $a_1, a_2, \cdots, a_n$.
The details of reactions between different elements are as follows:
Reaction Condition: For any two elements $i, j$ ($i \neq j$), if $a_i \times a_j$ is a multiple of $154$ or $147$, they can react. Elements cannot react with themselves.
Reaction Result: Including these two elements, the energy of all $n$ elements doubles (i.e., all $a_i$ become twice their original value).
Reaction Frequency: There is no limit to the number of times any two elements can react (i.e., the same two elements, if they continue to meet the reaction condition, can react multiple times).
Now, Pink Rabbit wants to use elemental reactions to increase the total energy of his elements to be greater than or equal to $k$, in order to defeat the most powerful monster in the Tivat world—Devil. He wants to know if, after some number of reactions (including zero), $a_1 + a_2 + \cdots + a_n$ can be greater than or equal to $k$.
Input Format
There are multiple sets of data in a single test case.
The input consists of $2 \times T + 1$ lines.
The first line contains an integer $T$, representing the number of data sets.
For each set of data:
The first line contains two integers $n, k$, representing the number of element types and Pink Rabbit's target, respectively.
The second line contains $n$ integers $a_1, a_2, \cdots, a_n$, representing the initial energy values of each element.
Output Format
The output consists of $T$ lines.
For each set of data:
Output a single line containing a string. If Pink Rabbit can achieve $a_1 + a_2 + \cdots + a_n$ greater than or equal to $k$ through some number of reactions (including zero), output Yes, otherwise output No.
Sample Input and Output
Input Sample #1
1
4 1395
143 238 174 199
Output Sample #1
Yes
Input Sample #2
1
4 1441
677 293 859 751
Output Sample #2
Yes
Input Sample #3
1
4 1295
136 875 196 34
Output Sample #3
No
Notes
Sample 1 Explanation
First, Pink Rabbit can choose $143$ and $238$ to multiply, resulting in $143 \times 238 = 34034 = 154 \times 221$. At this point, all element energies double, becoming $286, 476, 348, 398$, and $286 + 476 + 348 + 398 = 1508 \geq 1395$, so Pink Rabbit can achieve the goal with one operation.
Sample 2 Explanation
$677 + 293 + 859 + 751 = 2580 \geq 1441$, so Pink Rabbit can achieve the goal without any operations.
Sample 3 Explanation
Pink Rabbit cannot trigger any elemental reactions, and the sum of the four energies is $< 1295$, so Pink Rabbit cannot achieve the goal.
Data Size and Constraints
Let $N = \sum n$, representing the total sum of $n$ across all test data in a single test case. Let $K$ represent the total length of $k$ across all test data in a single test case.
For $100\%$ of the data, it is guaranteed that $1 \leq T \leq 10^5$, $1 \leq n, N \leq 10^6$, $1 \leq k \leq 10^{10^5}$, $1 \leq a_i \leq 10^9$, $1 \leq K \leq 2 \times 10^6$.
| Test Case Number | $n$ | $k$ | $a_i$ |
|---|---|---|---|
| $1$ | $= 1$ | $\leq 10^9$ | $\leq 10^9$ |
| $2 \sim 3$ | $\leq 100$ | $\leq 10^9$ | $\leq 10^5$ |
| $4$ | $\leq 1000$ | $\leq 10^9$ | $\leq 13$ |
| $5$ | $\leq 1000$ | $\leq 10^{18}$ | $\leq 10^9$ |
| $6 \sim 7$ | $\leq 1000$ | $\leq 10^{10^5}$ | $\leq 10^9$ |
| $8 \sim 10$ | $\leq 10^6$ | $\leq 10^{10^5}$ | $\leq 10^9$ |
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分