PANI string

0

0 votes
Easy
Problem

A string is called a PANI string if all characters of the string are same. You are given a string S of length n. You can update k consecutive characters in the string to any characters. You have to find the maximum length of the PANI substring.

Constraints

1t103

1n,k103

kn

String S contains only lower-case English alphabets (a...z).

Input Format

The first line contains t, number of test cases.

There will be two lines for each test case. The first line will contain ​​​ n andand the second line will contain string S.

Output Format

Output t line. Each line contains a single integer equal to the maximum length of PANI substring.

Sample Input
1
3 1
aba
Sample Output
3
Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?