Codeforces Round 328 (Div. 2)


A. PawnChess
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
........
........
.B....B.
....W...
........
..W.....
........
........
Output
A
Input
..B.....
..W.....
......B.
........
.....W..
......B.
........
........
Output
B
----------------------------------------------------------------------------------------------------
B. The Monster and the Squirrel
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
Output
9
Input
3
Output
1
----------------------------------------------------------------------------------------------------
C. The Big Race
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 3 2
Output
3/10
Input
7 1 2
Output
3/7
----------------------------------------------------------------------------------------------------
D. Super M
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
1 2
1 3
1 4
3 5
3 6
3 7
2 7
Output
2
3
Input
6 4
1 2
2 3
2 4
4 5
4 6
2 4 5 6
Output
2
4
----------------------------------------------------------------------------------------------------
E. BCPC
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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