School Personal Contest #3 (Winter Computer School 2010/11) - Codeforces Beta Round 45 (ACM-ICPC Rules)


A. Rock-paper-scissors
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
rock
rock
rock
Output
?
Input
paper
rock
rock
Output
F
Input
scissors
rock
rock
Output
?
Input
scissors
paper
rock
Output
?
----------------------------------------------------------------------------------------------------
B. Land Lot
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2
1 0
1 1
1 1
Output
0
Input
4 5
0 0 1 0 1
0 1 1 1 0
1 0 1 0 1
1 1 1 1 1
2 3
Output
2
----------------------------------------------------------------------------------------------------
C. The Race
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 4
Output
unique
5
Input
2
1 2
Output
not unique
----------------------------------------------------------------------------------------------------
D. Permutations
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9
1 2 3 1 2 1 4 2 5
Output
3
3 1 2 1 2 2 2 3 2
Input
4
4 3 2 1
Output
1
1 1 1 1 
Input
4
1 2 2 3
Output
-1
----------------------------------------------------------------------------------------------------
E. Ivan the Fool VS Gorynych the Dragon
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 4
2
1 0
0 1
3
0 1
0 1
0 0
Output
Ivan
2
Input
2 2 4
1
0 1
1
1 0
Output
Draw
Input
2 2 5
1
1 1
1
3 0
Output
Zmey
2
----------------------------------------------------------------------------------------------------
F. Snow sellers
time limit per test: 10 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3 10
4 4 4
5 5 8
1 2 5
Output
22.000000000000000
Input
100 2 1000000000
999999998 999999999
1000000000 1000000000
1 1
Output
99999995149.999995249999991
----------------------------------------------------------------------------------------------------
G. Galaxy Union
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
2 3 2
1 3 1
Output
4 5 3
Input
3
1 2 3
2 3 2
1 3 5
Output
8 5 7
Input
4
1 2 3
2 3 2
3 4 1
4 1 4
Output
12 8 8 8
----------------------------------------------------------------------------------------------------
H. Black and White
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2
0 0 4
Output
\
../
#
\
/#
\
##/
.
\
/.
Input
2 3
1 2 3
Output
###/
\
#
##/..
\
#/....
/.....
----------------------------------------------------------------------------------------------------
