Codeforces Round 992 (Div. 2)
A
Game of Division
Codeforces
800
原题
←B →
翻译中…

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.

翻译中…

Input

翻译中…

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$.

翻译中…

Output

翻译中…

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.

翻译中…

Note

翻译中…

In the first test case, the first player can choose $a_2 = 2$. Then:

翻译中…
  • If the second player chooses $a_1 = 1$, the resulting difference is $|2 - 1| = 1$ which is not divisible by $k = 2$.
  • If the second player chooses $a_3 = 3$, the resulting difference is $|2 - 3| = 1$ which is not divisible by $k = 2$.
翻译中…

In the second test case:

翻译中…
  • If the first player chooses $a_1 = 1$ and then the second player chooses $a_4 = 5$, the resulting difference is $|1 - 5| = 4$ which is divisible by $k = 2$.
  • If the first player chooses $a_2 = 2$ and then the second player chooses $a_3 = 4$, the resulting difference is $|2 - 4| = 2$ which is divisible by $k = 2$.
  • If the first player chooses $a_3 = 4$ and then the second player chooses $a_2 = 2$, the resulting difference is $|4 - 2| = 2$ which is divisible by $k = 2$.
  • If the first player chooses $a_4 = 5$ and then the second player chooses $a_1 = 1$, the resulting difference is $|5 - 1| = 4$ which is divisible by $k = 2$.
翻译中…

In any case, the second player wins.

翻译中…

样例

Input #1
7
3 2
1 2 3
4 2
1 2 4 5
5 3
10 7 3 4 5
5 3
1 31 15 55 36
2 1
17 17
2 2
17 18
1 3
6
Output #1
YES
2
NO
YES
3
NO
NO
YES
2
YES
1
InputCopy OutputCopy
题目信息
题号
2040A
时间限制
1 s
内存限制
256 MB
标签
博弈论
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。