Codeforces Round 992 (Div. 2) |
---|
Finished |
You are given an array of integers $$$a_1, a_2, \ldots, a_n$$$ of length $$$n$$$ and an integer $$$k$$$.
Two players are playing a game. The first player chooses an index $$$1 \le i \le n$$$. Then the second player chooses a different index $$$1 \le j \le n, i \neq j$$$. The first player wins if $$$|a_i - a_j|$$$ is not divisible by $$$k$$$. Otherwise, the second player wins.
We play as the first player. Determine whether it is possible to win, and if so, which index $$$i$$$ should be chosen.
The absolute value of a number $$$x$$$ is denoted by $$$|x|$$$ and is equal to $$$x$$$ if $$$x \ge 0$$$, and $$$-x$$$ otherwise.
Each test contains multiple test cases. The first line of input contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n \le 100$$$; $$$1 \le k \le 100$$$) — the length of the array and the number $$$k$$$.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le 100$$$) — the elements of the array $$$a$$$.
For each test case, if it is impossible for the first player to win, print "NO" (without quotes).
Otherwise, print "YES" (without quotes) and on the next line the appropriate index $$$1 \le i \le n$$$. If there are multiple solutions, print any of them.
You can output each letter in any case (lowercase or uppercase). For example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer.
73 21 2 34 21 2 4 55 310 7 3 4 55 31 31 15 55 362 117 172 217 181 36
YES 2 NO YES 3 NO NO YES 2 YES 1
In the first test case, the first player can choose $$$a_2 = 2$$$. Then:
In the second test case:
Name |
---|