Logo
(追記) (追記ここまで)

19256번 - Related Languages 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 512 MB2010880.000%

문제

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 $A$ and $B,ドル determine the maximum possible $s,ドル for which there are connected subwords $A'$ in $A$ and $B'$ in $B$ such that $A'$ and $B'$ have length $s,ドル and differ on at most $k$ positions.

입력

The first line of input contains the number of test cases $z$ (1ドル \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, k$ (1ドル \le n, m \le 4000$; 0ドル \le k \le \min(m,n)$). In the next two lines there are two strings $A$ and $B,ドル of lengths $n$ and $m,ドル respectively, each consisting of lowercase English letters.

The total length of all the words in the input does not exceed 200ドル,000円$.

출력

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

제한

예제 입력 1

1
12 13 2
hakunamatata
hienakulameta

예제 출력 1

9

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2018 > Day 1: Jagiellonian U Contest L번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /