Codeforces Beta Round 81


A. Transmigration
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4 0.75
axe 350
impaler 300
ionize 80
megafire 120
magicboost 220
heal
megafire
shield
magicboost
Output
6
axe 262
heal 0
impaler 225
magicboost 165
megafire 0
shield 0
----------------------------------------------------------------------------------------------------
B. Dark Assembly
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6 100
11 80
14 90
23 70
80 30
153 70
Output
1.0000000000
Input
5 3 100
11 80
14 90
23 70
80 30
153 70
Output
0.9628442962
Input
1 3 20
20 20
Output
0.7500000000
----------------------------------------------------------------------------------------------------
C. Item World
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
sword weapon 10 2 3 2
pagstarmor armor 0 15 3 1
iceorb orb 3 2 13 2
longbow weapon 9 1 2 1
5
mike gladiator 5 longbow
bobby sentry 6 pagstarmor
petr gladiator 7 iceorb
teddy physician 6 sword
blackjack sentry 8 sword
Output
sword 2 petr mike 
pagstarmor 1 blackjack 
iceorb 2 teddy bobby 
Input
4
sword weapon 10 2 3 2
pagstarmor armor 0 15 3 1
iceorb orb 3 2 13 2
longbow weapon 9 1 2 1
6
mike gladiator 5 longbow
bobby sentry 6 pagstarmor
petr gladiator 7 iceorb
teddy physician 6 sword
blackjack sentry 8 sword
joe physician 6 iceorb
Output
longbow 1 mike 
pagstarmor 1 bobby 
iceorb 2 petr joe 
----------------------------------------------------------------------------------------------------
D. Entertaining Geodetics
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 5
9 0 1 1 0
0 0 3 2 0
1 1 1 3 0
1 1 1 3 0
0 1 2 0 3
-1 1 -1 3 -1
-1 -1 -1 0 -1
-1 -1 -1 -1 -1
-1 2 3 -1 -1
-1 -1 -1 -1 2
4 2
Output
35
----------------------------------------------------------------------------------------------------
E. Lift and Throw
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9 3 3
4 3 1
2 3 3
Output
15
----------------------------------------------------------------------------------------------------
