Codeforces Round 358 (Div. 2)


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

Examples
Input
6 12
Output
14
Input
11 14
Output
31
Input
1 5
Output
1
Input
3 8
Output
5
Input
5 7
Output
7
Input
21 21
Output
88
----------------------------------------------------------------------------------------------------
B. Alyona and Mex
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 3 3 3 6
Output
5
Input
2
2 1
Output
3
----------------------------------------------------------------------------------------------------
C. Alyona and the Tree
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
88 22 83 14 95 91 98 53 11
3 24
7 -8
1 67
1 64
9 65
5 12
6 -80
3 8
Output
5
----------------------------------------------------------------------------------------------------
D. Alyona and Strings
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2 2
abc
ab
Output
2
Input
9 12 4
bbaaababb
abbbabbaaaba
Output
7
----------------------------------------------------------------------------------------------------
E. Alyona and Triangles
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 1
0 0
1 0
0 1
1 1
Output
-1 0
2 0
0 2
----------------------------------------------------------------------------------------------------
