Codeforces Round 628 (Div. 2)


A. EhAb AnD gCd
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
2
14
Output
1 1
6 4
----------------------------------------------------------------------------------------------------
B. CopyCopyCopyCopyCopy
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
3
3 2 1
6
3 1 4 1 5 9
Output
3
5
----------------------------------------------------------------------------------------------------
C. Ehab and Path-etic MEXs
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2
1 3
Output
0
1
Input
6
1 2
1 3
2 4
2 5
5 6
Output
0
3
2
4
1
----------------------------------------------------------------------------------------------------
D. Ehab the Xorcist
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 4
Output
2
3 1
Input
1 3
Output
3
1 1 1
Input
8 5
Output
-1
Input
0 0
Output
0
----------------------------------------------------------------------------------------------------
E. Ehab's REAL Number Theory Problem
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 4 6
Output
1
Input
4
2 3 6 6
Output
2
Input
3
6 15 10
Output
3
Input
4
2 3 5 7
Output
-1
----------------------------------------------------------------------------------------------------
F. Ehab's Last Theorem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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