Codeforces Beta Round 74 (Div. 2 Only)


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

Examples
Input
1 3 2
Output
34
Input
3 2 1
Output
33
----------------------------------------------------------------------------------------------------
B. African Crossword
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 3
cba
bcd
cbc
Output
abcd
Input
5 5
fcofd
ooedo
afaoa
rdcdf
eofsf
Output
codeforces
----------------------------------------------------------------------------------------------------
C. Robbery
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3 1
2 3
Output
0
Input
3 2 2
4 1 3
Output
2
----------------------------------------------------------------------------------------------------
D. Widget Library
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
12
Widget me(50,40)
VBox grandpa
HBox father
grandpa.pack(father)
father.pack(me)
grandpa.set_border(10)
grandpa.set_spacing(20)
Widget brother(30,60)
father.pack(brother)
Widget friend(20,60)
Widget uncle(100,20)
grandpa.pack(uncle)
Output
brother 30 60
father 80 60
friend 20 60
grandpa 120 120
me 50 40
uncle 100 20
Input
15
Widget pack(10,10)
HBox dummy
HBox x
VBox y
y.pack(dummy)
y.set_border(5)
y.set_spacing(55)
dummy.set_border(10)
dummy.set_spacing(20)
x.set_border(10)
x.set_spacing(10)
x.pack(pack)
x.pack(dummy)
x.pack(pack)
x.set_border(0)
Output
dummy 0 0
pack 10 10
x 40 10
y 10 10
----------------------------------------------------------------------------------------------------
E. Chip Play
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 4
DRLD
U.UL
.UUR
RDDL
Output
10 1
Input
3 5
.D...
RRRLL
.U...
Output
6 2
----------------------------------------------------------------------------------------------------
