Bubble Cup X - Finals [Online Mirror]


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

Examples
Input
1
1
Output
1
1
1
Input
4
5806
Output
5+8+0+6
1+9
1+0
----------------------------------------------------------------------------------------------------
B. Neural Network country
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3 13
4 6
2 1
3 4
Output
2
----------------------------------------------------------------------------------------------------
C. Property
time limit per test: 0.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
6 7 5 4
5 5 2 2 5
1 3 3
1 5 2
1 6 5
2 5 4
2 6 7
3 4 11
3 5 3
Output
3
----------------------------------------------------------------------------------------------------
E. Casinos and travel
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1 2
Output
4
Input
3
1 2
2 3
Output
10
----------------------------------------------------------------------------------------------------
F. Product transformation
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 2 2 7
Output
1 2 
----------------------------------------------------------------------------------------------------
G. Bathroom terminal
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1
abc
aec
ac
a?c
Output
3
----------------------------------------------------------------------------------------------------
H. Bob and stages
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4
0 0
3 0
2 1
4 4
1 5
Output
10.00
----------------------------------------------------------------------------------------------------
I. Dating
time limit per test: 2 seconds
memory limit per test: 64 megabytes
input: standard input
output: standard output

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