Codeforces Round 115


A. Robot Bicorn Attack
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1234
Output
37
Input
9000
Output
90
Input
0009
Output
-1
----------------------------------------------------------------------------------------------------
B. Plane of Tanks: Pro
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
vasya 100
vasya 200
artem 100
kolya 200
igor 250
Output
4
artem noob
igor pro
kolya random
vasya random
Input
3
vasya 200
kolya 1000
vasya 1000
Output
2
kolya pro
vasya pro
----------------------------------------------------------------------------------------------------
C. Geometry Horse
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
5 10
2
3 6
Output
70
Input
2
3 8
5 10
1
20
Output
74
----------------------------------------------------------------------------------------------------
D. Plane of Tanks: Duel
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
100 3 50 50 0
100 3 50 50 0
Output
1.000000
Input
100 3 50 50 0
100 2 48 50 0
Output
0.888889
Input
100 3 50 50 0
100 1 50 50 50
Output
0.500000
----------------------------------------------------------------------------------------------------
E. Power Defence
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 0 0
10 10 10
100 100
Output
1989.97487421
Input
1 0 1
10 10 10
100 100
Output
3979.94974843
----------------------------------------------------------------------------------------------------
F. Gnomes of Might and Magic
time limit per test: 8 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 3
1 2 3
3 1 4 2
3 2 5 3
3 3 6 1
10
+ 1 2
+ 4 2
+ 1 3
+ 2 3
? 1 2
+ 2 5
? 1 2
? 1 2
+ 1 2
? 1 2
Output
0
1
0
1
----------------------------------------------------------------------------------------------------
