Codeforces Round 324 (Div. 2)


A. Olesya and Rodion
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
Output
712
----------------------------------------------------------------------------------------------------
B. Kolya and Tanya
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
Output
20
Input
2
Output
680
----------------------------------------------------------------------------------------------------
C. Marina and Vasya
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
abc
xyc
Output
ayd
Input
1 0
c
b
Output
-1
----------------------------------------------------------------------------------------------------
D. Dima and Lisa
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
27
Output
3
5 11 11
----------------------------------------------------------------------------------------------------
E. Anton and Ira
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
4 2 1 3
3 2 4 1
Output
3
2
4 3
3 1
----------------------------------------------------------------------------------------------------
