You are given a string
For each query, you are given a string
String
Input Specification
The first line contains an string
The next line contains an integer
Each of the next
Output Specification
For each test case, output the answer.
Sample Input
Copy
scbamgepe
3
smape 2 7
sbape 3 8
sgepe 1 9
Sample Output
Copy
12
10
4
Data ranges
Case | Properties | |||
---|---|---|---|---|
None | ||||
None | ||||
None | ||||
None | ||||
None | ||||
string is random | ||||
None | ||||
String is Random | ||||
None | ||||
string is random | ||||
None | ||||
string is random | ||||
None | ||||
String is random | ||||
None | ||||
none | ||||
none | ||||
none | ||||
none | ||||
none | ||||
none | ||||
none |
For the first
For all data, it is guaranteed that
Comments