Codeforces Round 781 (Div. 2)


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

Examples
Input
5
4
7
8
9
10
Output
1 1 1 1
2 2 2 1
2 2 2 2
2 4 2 1
3 5 1 1
----------------------------------------------------------------------------------------------------
B. Array Cloning Technique
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
1
1789
6
0 1 3 3 7 0
2
-1000000000 1000000000
4
4 3 2 1
5
2 5 7 6 3
7
1 1 1 1 1 1 1
Output
0
6
2
5
7
0
----------------------------------------------------------------------------------------------------
C. Tree Infection
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
2
1
8
1
Output
? 1 2
? 12 4
! 4
? 2000000000 1999999999
! 1000000000
----------------------------------------------------------------------------------------------------
E. MinimizOR
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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