Codeforces Round 646 (Div. 2)
A
Odd Selection
Codeforces
1200
原题
←B →
翻译中…

Shubham has an array $a$ of size $n$, and wants to select exactly $x$ elements from it, such that their sum is odd. These elements do not have to be consecutive. The elements of the array are not guaranteed to be distinct.

翻译中…

Tell him whether he can do so.

翻译中…

Input

翻译中…

The first line of the 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 $x$ $(1 \le x \le n \le 1000)$ — the length of the array and the number of elements you need to choose.

翻译中…

The next line of each test case contains $n$ integers $a_1, a_2, \dots, a_n$ $(1 \le a_i \le 1000)$ — elements of the array.

翻译中…

Output

翻译中…

For each test case, print "Yes" or "No" depending on whether it is possible to choose $x$ elements such that their sum is odd.

翻译中…

You may print every letter in any case you want.

翻译中…

Note

翻译中…

For $1$st case: We must select element $999$, and the sum is odd.

翻译中…

For $2$nd case: We must select element $1000$, so overall sum is not odd.

翻译中…

For $3$rd case: We can select element $51$.

翻译中…

For $4$th case: We must select both elements $50$ and $51$  — so overall sum is odd.

翻译中…

For $5$th case: We must select all elements  — but overall sum is not odd.

翻译中…

样例

Input #1
5
1 1
999
1 1
1000
2 1
51 50
2 2
51 50
3 3
101 102 103
Output #1
Yes
No
Yes
Yes
No
InputCopy OutputCopy
题目信息
题号
1363A
时间限制
1 s
内存限制
256 MB
标签
暴力
模拟
数学

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