Codeforces Round 950 (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.

math

*800

No tag edit access

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

×
A. Problem Generator

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputVlad is planning to hold $$$m$$$ rounds next month. Each round should contain one problem of difficulty levels 'A', 'B', 'C', 'D', 'E', 'F', and 'G'.

Vlad already has a bank of $$$n$$$ problems, where the $$$i$$$-th problem has a difficulty level of $$$a_i$$$. There may not be enough of these problems, so he may have to come up with a few more problems.

Vlad wants to come up with as few problems as possible, so he asks you to find the minimum number of problems he needs to come up with in order to hold $$$m$$$ rounds.

For example, if $$$m=1$$$, $$$n = 10$$$, $$$a=$$$ 'BGECDCBDED', then he needs to come up with two problems: one of difficulty level 'A' and one of difficulty level 'F'.

Input

The first line contains a single integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases.

The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 50$$$, $$$1 \le m \le 5$$$) — the number of problems in the bank and the number of upcoming rounds, respectively.

The second line of each test case contains a string $$$a$$$ of $$$n$$$ characters from 'A' to 'G' — the difficulties of the problems in the bank.

Output

For each test case, output a single integer — the minimum number of problems that need to come up with to hold $$$m$$$ rounds.

Example

Input

310 1BGECDCBDED10 2BGECDCBDED9 1BBCDEFFGG

Output

2 5 1

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jul/17/2024 14:16:59 (j1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|