#P6640. [BJOI2020] 封印
[BJOI2020] 封印
Description
Given two strings that contain only lowercase letters , there are queries. In each query, ask for the length of the longest common substring of and .
Input Format
The input has lines.
The first line contains a string .
The second line contains a string .
The third line contains an integer .
The next lines each contain two integers , representing one query.
Output Format
Output has lines.
The -th line is the length of the longest common substring of and .
aaba
aaaabbbaa
3
1 4
1 3
2 4
3
3
2
Hint
| Test Point ID | ||
|---|---|---|
Translated by ChatGPT 5
京公网安备 11011102002149号