Codeforces Round 905 (Div. 3) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

strings

*900

No tag edit access

The problem statement has recently been changed. View the changes.

×
B. Chemistry

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputYou are given a string $$$s$$$ of length $$$n$$$, consisting of lowercase Latin letters, and an integer $$$k$$$.

You need to check if it is possible to remove exactly $$$k$$$ characters from the string $$$s$$$ in such a way that the remaining characters can be rearranged to form a palindrome. Note that you can reorder the remaining characters in any way.

A palindrome is a string that reads the same forwards and backwards. For example, the strings "z", "aaa", "aba", "abccba" are palindromes, while the strings "codeforces", "reality", "ab" are not.

Input

Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of the test cases. This is followed by their description.

The first line of each test case contains two integers $$$n$$$ and $$$k$$$ ($$$0 \leq k < n \leq 10^5$$$) — the length of the string $$$s$$$ and the number of characters to be deleted.

The second line of each test case contains a string $$$s$$$ of length $$$n$$$, consisting of lowercase Latin letters.

It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.

Output

For each test case, output "YES" if it is possible to remove exactly $$$k$$$ characters from the string $$$s$$$ in such a way that the remaining characters can be rearranged to form a palindrome, and "NO" otherwise.

You can output the answer in any case (uppercase or lowercase). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive answers.

Example

Input

141 0a2 0ab2 1ba3 1abb3 2abc6 2bacacd6 2fagbza6 2zwaafa7 2taagaak14 3ttrraakkttoorr5 3debdb5 4ecadc5 3debca5 3abaac

Output

YES NO YES YES YES YES NO NO YES YES YES YES NO YES

Note

In the first test case, nothing can be removed, and the string "a" is a palindrome.

In the second test case, nothing can be removed, but the strings "ab" and "ba" are not palindromes.

In the third test case, any character can be removed, and the resulting string will be a palindrome.

In the fourth test case, one occurrence of the character "a" can be removed, resulting in the string "bb", which is a palindrome.

In the sixth test case, one occurrence of the characters "b" and "d" can be removed, resulting in the string "acac", which can be rearranged to the string "acca".

In the ninth test case, one occurrence of the characters "t" and "k" can be removed, resulting in the string "aagaa", which is a palindrome.

Codeforces (c) Copyright 2010-2023 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/11/2023 09:11:53 (f1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|