cf/mirror

Concatenation with intersection

CF
1313E2700· international gm2s512 MB⌨ stdin/stdout

Examples

Sample 1of 3
Input
6 5
aabbaa
baaaab
aaaaa
Output
4
Sample 2of 3
Input
5 4
azaza
zazaz
azaz
Output
11
Sample 3of 3
Input
9 12
abcabcabc
xyzxyzxyz
abcabcayzxyz
Output
2
1313E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)