Educational Codeforces Round 43 (Rated for Div. 2)


A. Minimum Binary Number
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1001
Output
100
Input
1
1
Output
1
----------------------------------------------------------------------------------------------------
B. Lara Croft and the New Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3 0
Output
1 1
Input
4 3 11
Output
1 2
Input
4 3 7
Output
3 2
----------------------------------------------------------------------------------------------------
C. Nested Segments
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 10
2 9
3 9
2 3
2 9
Output
2 1
Input
3
1 5
2 6
6 20
Output
-1 -1
----------------------------------------------------------------------------------------------------
D. Degree Set
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2 3 4
Output
8
3 1
4 2
4 5
2 5
5 1
3 2
2 1
5 3
Input
3
1 2 3
Output
4
1 2
1 3
1 4
2 3
----------------------------------------------------------------------------------------------------
E. Well played!
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 1 1
10 15
6 1
Output
27
Input
3 0 3
10 8
7 11
5 2
Output
26
----------------------------------------------------------------------------------------------------
F. Minimal k-covering
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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