Codeforces Round 931 (Div. 2)


A. Too Min Too Max
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
4
1 1 1 1
5
1 1 2 2 3
8
5 1 3 2 -3 -1 10 3
4
3 3 1 1
4
1 2 2 -1
Output
0
6
38
8
8
----------------------------------------------------------------------------------------------------
B. Yet Another Coin Problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
14
1
2
3
5
7
11
12
14
16
17
18
20
98
402931328
Output
1
2
1
3
2
2
2
3
2
3
2
2
8
26862090
----------------------------------------------------------------------------------------------------
C. Find a Mine
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4 4
3
2
2
0
5 5
1
2
3
Output
? 1 1
? 1 4
? 4 1
? 2 3
! 2 3
? 5 5
? 2 2
? 3 3
! 1 1
----------------------------------------------------------------------------------------------------
D1. XOR Break — Solo Version
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
7 3
4 2
481885160128643072 45035996273704960
Output
1
7 3
-1
3
481885160128643072 337769972052787200 49539595901075456 45035996273704960
----------------------------------------------------------------------------------------------------
D2. XOR Break — Game Version
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
1
0 0
3
0 0
13
3 4
0 0
777777770001
0 0
Output
second
first
2 1
first
10 7
1 2
first
777777770000 1
----------------------------------------------------------------------------------------------------
E. Weird LCM Operations
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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