#P1873D. 1D Eraser
1D Eraser
Description
You are given a strip of paper that is cells long. Each cell is either black or white. In an operation you can take any consecutive cells and make them all white.
Find the minimum number of operations needed to remove all black cells.
The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and () — the length of the paper and the integer used in the operation.
The second line of each test case contains a string of length consisting of characters (representing a black cell) or (representing a white cell).
The sum of over all test cases does not exceed .
For each test case, output a single integer — the minimum number of operations needed to remove all black cells.
Input
The first line contains a single integer () — the number of test cases.
The first line of each test case contains two integers and () — the length of the paper and the integer used in the operation.
The second line of each test case contains a string of length consisting of characters (representing a black cell) or (representing a white cell).
The sum of over all test cases does not exceed .
Output
For each test case, output a single integer — the minimum number of operations needed to remove all black cells.
Note
In the first test case you can perform the following operations:
In the second test case you can perform the following operations:
In the third test case you can perform the following operations: