Deltix Round, Spring 2021 (open for everyone, rated, Div. 1 + Div. 2)


A. Game of Life
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
11 3
01000000001
10 2
0110100101
5 2
10101
3 100
000
Output
11111001111
1110111101
10101
000
----------------------------------------------------------------------------------------------------
B. Lord of the Values
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
1 1 1 1
4
4 3 1 2
Output
8
2 1 2
2 1 2
2 1 3
2 1 3
2 1 4
2 1 4
1 1 2
1 1 2
8
2 1 4
1 2 4
1 2 4
1 2 4
1 3 4
1 1 2
1 1 2
1 1 4
----------------------------------------------------------------------------------------------------
C. Compression and Expansion
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
1
1
2
3
9
1
1
1
2
2
1
2
1
2
Output
1
1.1
1.2
1.3
1
1.1
1.1.1
1.1.2
1.2
1.2.1
2
2.1
2.2
----------------------------------------------------------------------------------------------------
D. Love-Hate
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 4 3
1000
0110
1001
Output
1000
Input
5 5 4
11001
10101
10010
01110
11011
Output
10001
----------------------------------------------------------------------------------------------------
E. Crypto Lights
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 2
15 2
40 15
Output
333333338
141946947
329622137
----------------------------------------------------------------------------------------------------
F. Favorite Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 4
1 1
2 3
5 2
2 2 12
5 1 4
6 2 11
3 5 10
Output
3
----------------------------------------------------------------------------------------------------
G. Try Booking
time limit per test: 2 seconds
memory limit per test: 512 megabytes
input: standard input
output: standard output

Examples
Input
6 5
2 3
3 5
1 1
1 5
1 6
Output
3
2
3
5
5
6
----------------------------------------------------------------------------------------------------
H. Hopping Around the Array
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
9 5
1 1 2 1 3 1 2 1 1
1 1 0
2 5 1
5 9 1
2 8 2
1 9 4
Output
0
2
1
2
2
----------------------------------------------------------------------------------------------------
