CF1968G1.Division + LCP (easy version)

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

Division + LCP (easy version)

This is the easy version of the problem. In this version l=rl=r.

You are given a string ss. For a fixed kk, consider a division of ss into exactly kk continuous substrings w1,,wkw_1,\dots,w_k. Let fkf_k be the maximal possible LCP(w1,,wk)LCP(w_1,\dots,w_k) among all divisions.

LCP(w1,,wm)LCP(w_1,\dots,w_m) is the length of the Longest Common Prefix of the strings w1,,wmw_1,\dots,w_m.

For example, if s=abababcabs=abababcab and k=4k=4, a possible division is $\color{red}{ab}\color{blue}{ab}\color{orange}{abc}\color{green}{ab}$. The $LCP(\color{red}{ab},\color{blue}{ab},\color{orange}{abc},\color{green}{ab})$ is 22, since abab is the Longest Common Prefix of those four strings. Note that each substring consists of a continuous segment of characters and each character belongs to exactly one substring.

Your task is to find fl,fl+1,,frf_l,f_{l+1},\dots,f_r. In this version l=rl=r.

Input

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

The first line of each test case contains two integers nn, ll, rr (1l=rn21051 \le l = r \le n \le 2 \cdot 10^5) — the length of the string and the given range.

The second line of each test case contains string ss of length nn, all characters are lowercase English letters.

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

Output

For each test case, output rl+1r-l+1 values: fl,,frf_l,\dots,f_r.

Note

In the first sample n=kn=k, so the only division of abaaba is aba\color{red}a\color{blue}b\color{orange}a. The answer is zero, because those strings do not have a common prefix.

In the second sample, the only division is aaa\color{red}a\color{blue}a\color{orange}a. Their longest common prefix is one.

Samples

7
3 3 3
aba
3 3 3
aaa
7 2 2
abacaba
9 4 4
abababcab
10 1 1
codeforces
9 3 3
abafababa
5 3 3
zpozp
0
1
3
2
10
2
0

在线编程 IDE

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