Ozon Tech Challenge 2020 (Div.1 + Div.2, Rated, T-shirts + prizes!)


A. Kuroni and the Gifts
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3
1 8 5
8 4 5
3
1 7 5
6 1 2
Output
1 8 5
8 4 5
5 1 7
6 2 1
----------------------------------------------------------------------------------------------------
B. Kuroni and Simple Strings
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
(()((
Output
1
2
1 3 
Input
)(
Output
0
Input
(()())
Output
1
4
1 2 5 6 
----------------------------------------------------------------------------------------------------
C. Kuroni and Impossible Calculation
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 10
8 5
Output
3
Input
3 12
1 4 5
Output
0
Input
3 7
1 4 9
Output
1
----------------------------------------------------------------------------------------------------
D. Kuroni and the Celebration
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
1 4
4 2
5 3
6 3
2 3
3
4
4
Output
? 5 6
? 3 1
? 1 2
! 4
----------------------------------------------------------------------------------------------------
E. Kuroni and the Score Distribution
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 3
Output
4 5 9 13 18
Input
8 0
Output
10 11 12 13 14 15 16 17
Input
4 10
Output
-1
----------------------------------------------------------------------------------------------------
F. Kuroni and the Punishment
time limit per test: 2.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
6 2 4
Output
0
Input
5
9 8 7 3 1
Output
4
----------------------------------------------------------------------------------------------------
G. Kuroni and Antihype
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
Output
2
----------------------------------------------------------------------------------------------------
H. Kuroni the Private Tutor
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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