Codeforces Beta Round 41


A. Guilty — to the kitchen!
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 100
1
40
Output
40.0
Input
2 100
1 1
25 30
Output
50.0
Input
2 100
1 1
60 60
Output
100.0
----------------------------------------------------------------------------------------------------
B. Game of chess unfinished
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
a6 b4 c8 a8
Output
CHECKMATE
Input
a6 c4 b6 b8
Output
OTHER
Input
a2 b1 a3 a1
Output
OTHER
----------------------------------------------------------------------------------------------------
C. Safe cracking
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1 1 1
Output
Input
1 2 4 2
Output
/2
/3
Input
3 3 1 1
Output
+1
/1
/1
Input
2 1 2 4
Output
/3
/4
----------------------------------------------------------------------------------------------------
D. Strange town
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
Output
0 3 4 
3 0 5 
4 5 0 
----------------------------------------------------------------------------------------------------
E. Baldman and the military
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1
1 2 3
1
1 2
Output
0
Input
3
1
1 2 3
2
1 2
1 3
Output
-1
3
----------------------------------------------------------------------------------------------------
