Codeforces Round 651 (Div. 2)


A. Maximum GCD
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3
5
Output
1
2
----------------------------------------------------------------------------------------------------
B. GCD Compression
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3
1 2 3 4 5 6
2
5 7 9 10
5
1 3 3 4 5 90 100 101 2 3
Output
3 6
4 5
3 4
1 9
2 3
4 5
6 10
----------------------------------------------------------------------------------------------------
C. Number Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7
1
2
3
4
5
6
12
Output
FastestFinger
Ashishgup
Ashishgup
FastestFinger
Ashishgup
FastestFinger
Ashishgup
----------------------------------------------------------------------------------------------------
D. Odd-Even Subsequence
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 2
1 2 3 4
Output
1
Input
4 3
1 2 3 4
Output
2
Input
5 3
5 3 4 2 6
Output
2
Input
6 4
5 3 50 2 4 5
Output
3
----------------------------------------------------------------------------------------------------
E. Binary Subsequence Rotation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
010000
000001
Output
1
Input
10
1111100000
0000011111
Output
5
Input
8
10101010
01010101
Output
1
Input
10
1111100000
1111100001
Output
-1
----------------------------------------------------------------------------------------------------
F1. The Hidden Pair (Easy Version)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
3
1 2
1 3
1 1
2 3
3 1
3 1
Correct
Output
? 1 1
? 1 2
? 1 3
? 2 2 3
! 1 3
----------------------------------------------------------------------------------------------------
F2. The Hidden Pair (Hard Version)
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
3
1 2
1 3
1 1
2 3
3 1
3 1
Correct
Output
? 1 1
? 1 2
? 1 3
? 2 2 3
! 1 3
----------------------------------------------------------------------------------------------------
