Related Languages

아직 제출이 없습니다시간 제한10초메모리 제한512 MB

문제

You are studying two ancient languages, aiming to prove that they are closely related. You suspect that the words for "push-relabel flow algorithm" in both languages stem from a single ancestor. If so, they contain similar cores, i.e. subwords that do not differ much from each other.

Given two words AA and BB, determine the maximum possible ss, for which there are connected subwords AA' in AA and BB' in BB such that AA' and BB' have length ss, and differ on at most kk positions.

입력

The first line of input contains the number of test cases zz (1z20001 \leq z \leq 2000). The descriptions of the test cases follow.

Every test case consists of three lines. The first line contains three numbers n,m,kn, m, k (1n,m40001 \le n, m \le 4000; 0kmin(m,n)0 \le k \le \min(m,n)). In the next two lines there are two strings AA and BB, of lengths nn and mm, respectively, each consisting of lowercase English letters.

The total length of all the words in the input does not exceed 200,000200\\,000.

출력

For each test case output a single integer -- the maximum possible length of subwords that differ on at most kk positions.