Educational Codeforces Round 34 (Rated for Div. 2)


A. Hungry Student Problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
6
5
Output
YES
NO
----------------------------------------------------------------------------------------------------
B. The Modcrab
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 6 100
17 5
Output
4
STRIKE
HEAL
STRIKE
STRIKE
Input
11 6 100
12 5
Output
2
STRIKE
STRIKE
----------------------------------------------------------------------------------------------------
C. Boxes Packing
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
Output
1
Input
4
4 2 4 3
Output
2
----------------------------------------------------------------------------------------------------
D. Almost Difference
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 2 3 1 3
Output
4
Input
4
6 6 5 5
Output
0
Input
4
6 6 4 4
Output
-8
----------------------------------------------------------------------------------------------------
E. Swapping Characters
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 4
abac
caab
acba
Output
acab
Input
3 4
kbbu
kbub
ubkb
Output
kbub
Input
5 4
abcd
dcba
acbd
dbca
zzzz
Output
-1
----------------------------------------------------------------------------------------------------
F. Clear The Matrix
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1 10 8 20
***.
***.
***.
...*
Output
9
Input
7
2 1 8 2
.***...
.***..*
.***...
....*..
Output
3
Input
4
10 10 1 10
***.
*..*
*..*
.***
Output
2
----------------------------------------------------------------------------------------------------
G. Yet Another Maxflow Problem
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3 2
1 2
3 4
5 6
2 2 7
1 4 8
4 3 9
1 100
2 100
Output
9
14
14
----------------------------------------------------------------------------------------------------
