cf/mirror

Yet Another LCP Problem

CF
1073G2600· international gm2s256 MB⌨ stdin/stdout

Examples

Sample 1of 1
Input
7 4
abacaba
2 2
1 2
1 2
3 1
1 2 3
7
1 7
1
1 2 3 4 5 6 7
2 2
1 5
1 5
Output
13
2
12
16
1073G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)