Codeforces Round 449 (Div. 2)


A. Scarborough Fair
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1
ioi
1 1 i n
Output
noi
Input
5 3
wxhak
3 3 h x
1 5 x a
1 3 w g
Output
gaaak
----------------------------------------------------------------------------------------------------
B. Chtholly's request
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 100
Output
33
Input
5 30
Output
15
----------------------------------------------------------------------------------------------------
C. Nephren gives a riddle
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 1
1 2
1 111111111111
Output
Wh.
Input
5
0 69
1 194
1 139
0 47
1 66
Output
abdef
Input
10
4 1825
3 75
3 530
4 1829
4 1651
3 187
4 584
4 255
4 774
2 474
Output
Areyoubusy
----------------------------------------------------------------------------------------------------
D. Ithea Plays With Chtholly
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 4 4
2
1
3
Output
1
2
2
----------------------------------------------------------------------------------------------------
E. Willem, Chtholly and Seniorious
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 10 7 9
Output
2
1
0
3
Input
10 10 9 9
Output
1
1
3
3
----------------------------------------------------------------------------------------------------
