Testing Round 11


A. Up the hill
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0
1
Output
2 1 
Input
2
1
Output
1 3 4 2
----------------------------------------------------------------------------------------------------
B. New York Hotel
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 10
2
1 1
3 3
2
1 10
4 4
Output
6
2
----------------------------------------------------------------------------------------------------
C. Deciphering
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 2
aaabbbaaab
bbbbabbbbb
Output
7
ba
Input
10 2
aaaaaaabbb
bbbbaaabbb
Output
6
ab
Input
9 4
dacbdacbd
acbdacbda
Output
9
cdba
----------------------------------------------------------------------------------------------------
