| Codeforces Round 1068 (Div. 2) |
|---|
| Finished |
In the afterlife school, Kanade studies a peculiar number game.
She gives you two integers $$$n$$$ and $$$k$$$, as well as an array $$$a$$$ consisting of $$$n$$$ integers, where $$$1 \le a_i \le k$$$ holds.
For an integer set $$$B = \{b_1, b_2, \ldots, b_m\}$$$ where $$$1\le b_i\le k$$$, we call it complete if and only if both of the following hold:
You have to find a complete set $$$B$$$ with minimum possible size, or determine that no such set exists.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1\le n\le 2\cdot 10^5$$$, $$$1\le k\le 10^9$$$) — the length of $$$a$$$ and the upper bound of elements of $$$a$$$.
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1\le a_i\le k$$$) — the elements of $$$a$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2\cdot 10^5$$$.
For each test case:
If there are multiple answers, you may print any of them.
44 63 2 4 65 51 2 3 4 53 62 3 61 22
22 311-112
In the first test case, $$$B=\{2,3\}$$$ works. For $$$b=2$$$, all multiples $$$\{2,4,6\}$$$ (up to $$$k=6$$$) appear in $$$a$$$; for $$$b=3$$$, multiples $$$\{3,6\}$$$ appear. Every $$$a_i$$$ is divisible by $$$2$$$ or $$$3$$$. No single $$$b$$$ can satisfy both conditions, so $$$m=2$$$ is minimal.
In the second test case, $$$B=\{1\}$$$ satisfies both rules since every number is divisible by $$$1$$$ and all multiples of $$$1$$$ up to $$$k$$$ appear.
| Name |
|---|


