Codeforces Round 696 (Div. 2)


A. Puzzle From the Future
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1
0
3
011
3
110
6
111000
6
001011
Output
1
110
100
101101
101110
----------------------------------------------------------------------------------------------------
B. Different Divisors
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
1
2
Output
6
15
----------------------------------------------------------------------------------------------------
C. Array Destruction
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2
3 5 1 2
3
1 1 8 8 64 64
2
1 1 2 4
5
1 2 3 4 5 6 7 14 3 11
Output
YES
6
1 5
2 3
NO
NO
YES
21
14 7
3 11
5 6
2 4
3 1
----------------------------------------------------------------------------------------------------
D. Cleaning
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
3
1 2 1
3
1 1 2
5
2 2 2 1 3
5
2100 1900 1600 3000 1600
2
2443 2445
Output
YES
YES
YES
YES
NO
----------------------------------------------------------------------------------------------------
E. What Is It?
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
3
3
1 -1 2
Output
3 3
Input
3
100
5 -3 6
Output
9 7
Input
3
1
999999999 0 1000000000
Output
2000000000 1
Input
5
34
1337 -146 42 -69 228
Output
1393 3876
----------------------------------------------------------------------------------------------------
