Problem B
String Hashing
Given is a string
You will be given a list of queries of the form
Your hashes should be non-negative
Input
The first line of input contains the string
The second line contains an integer
The next and final
Output
For each of the
Sample Input 1 | Sample Output 1 |
---|---|
abba 6 0 1 3 4 1 2 2 3 0 2 2 4 |
33 33 34 34 143 124 |