## MLE '19 Contest 4 P7 - Desperate

View as PDF

Points: 5
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

A string consisting of lowercase latin characters is hashed using the following method:

is the ASCII value of the (one-indexed) character of string . and are values given to you.

Given a string , and integers and , can you calculate ?

#### Input Specification

The first line will contain the integer .

The second line will contain the string of length . will only contain lowercase latin characters.

The third line will contain the integers and .

Output .

#### Sample Input

3
aaa
2 1

#### Sample Output

0