#Lutece3064. interval max border
interval max border
Migrated from Lutece 3064 interval max border
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给定字符串 ,你需要回答 次询问,每次询问给定一个区间,求 在该区间的子串的最长 border 长度。
Border 的定义:若一个串 同时是串 的前缀和后缀,则 被称为 的 border。
Input
第一行一个字符串 。
第二行一个整数 ,表示询问个数。
随后的 行,每行两个数 ,表示询问的区间。字符串中字符的下标从 开始。
Output
共 行,每行一个整数,表示对应询问的答案。
Samples
abbabbaa
3
1 8
1 7
2 7
1
4
3
Constraints
Resources
2023 UESTC ICPC Training for String