Codeforces Round 655 (Div. 2)


A. Omkar and Completion
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5
4
Output
1 5 3 77 12
384 384 44 44
----------------------------------------------------------------------------------------------------
B. Omkar and Last Class of Math
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4
6
9
Output
2 2
3 3
3 6
----------------------------------------------------------------------------------------------------
C. Omkar and Baseball
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
5
1 2 3 4 5
7
3 2 4 5 1 6 7
Output
0
2
----------------------------------------------------------------------------------------------------
D. Omkar and Circle
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
7 10 2
Output
17
Input
1
4
Output
4
----------------------------------------------------------------------------------------------------
E. Omkar and Last Floor
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 5
2
1 2
3 5
2
1 3
4 5
3
1 1
2 4
5 5
3
1 1
2 2
3 5
Output
36
----------------------------------------------------------------------------------------------------
F. Omkar and Modes
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
2 2
2 2
3 2
2 1
Output
? 1 6
? 1 3
? 4 6
? 3 4
! 1 2 2 3 3 4
----------------------------------------------------------------------------------------------------
