cf/mirror

A task for substrings

CF
1801G3400· legendary gm4s1024 MB⌨ stdin/stdout

Examples

Sample 1of 2
Input
3 5
abacaba
aba
a
ac
1 7
1 3
2 7
2 5
4 5
Output
7 3 5 3 1
Sample 2of 2
Input
4 4
abcdca
ab
ca
bcd
openolympiad
1 5
2 2
2 6
1 6
Output
2 0 2 3
1801G.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)