CF2114B.Not Quite a Palindromic String

传统题 时间 2000 ms 内存 256 MiB 4 尝试 1 已通过 1 标签

Not Quite a Palindromic String

Vlad found a binary string^{\text{∗}} ss of even length nn. He considers a pair of indices (i,ni+1i, n - i + 1), where 1i<ni+11 \le i \lt n - i + 1, to be good if si=sni+1s_i = s_{n - i + 1} holds true.

For example, in the string '010001' there is only 11 good pair, since s1s6s_1 \ne s_6, s2s5s_2 \ne s_5, and s3=s4s_3=s_4. In the string '0101' there are no good pairs.

Vlad loves palindromes, but not too much, so he wants to rearrange some characters of the string so that there are exactly kk good pairs of indices.

Determine whether it is possible to rearrange the characters in the given string so that there are exactly kk good pairs of indices (i,ni+1i, n - i + 1).

^{\text{∗}}A string ss is called binary if it consists only of the characters '0' and '1'

Input

The first line contains an integer tt (1t1041 \le t \le 10^4) — the number of test cases.

The first line of each test case contains two integers nn and kk (2n21052 \le n \le 2 \cdot 10^5, 0kn20 \le k \le \frac{n}{2}, nn is even) — the length of the string and the required number of good pairs.

The second line of each test case contains a binary string ss of length nn.

It is guaranteed that the sum of nn across all test cases does not exceed 21052 \cdot 10^5.

Output

For each test case, output "YES" if there is a way to rearrange the characters of the string so that there are exactly kk good pairs, otherwise output "NO".

You may output each letter in any case (lowercase or uppercase). For example, the strings "yEs", "yes", "Yes", and "YES" will be accepted as a positive answer.

Samples

6
6 2
000000
2 1
01
4 1
1011
10 2
1101011001
10 1
1101011001
2 1
11
NO
NO
YES
NO
YES
YES

在线编程 IDE

建议全屏模式获得最佳体验