Codeforces Round 525 (Div. 2)


A. Ehab and another construction problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10
Output
6 3
Input
1
Output
-1
----------------------------------------------------------------------------------------------------
B. Ehab and subtraction
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 5
1 2 3
Output
1
1
1
0
0
Input
4 2
10 3 5 3
Output
3
2
----------------------------------------------------------------------------------------------------
C. Ehab and a 2-operation task
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
Output
0
Input
3
7 6 3
Output
2
1 1 1
2 2 4
----------------------------------------------------------------------------------------------------
D. Ehab and another another xor problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
-1
0
Output
? 2 1
? 1 2
? 2 0
! 3 1
----------------------------------------------------------------------------------------------------
E. Ehab and a component choosing problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
1 2
1 3
Output
6 1
Input
1
-2
Output
-2 1
Input
3
-1 -1 -1
1 2
2 3
Output
-3 3
Input
3
-1 -2 -1
1 2
1 3
Output
-2 2
----------------------------------------------------------------------------------------------------
F. Ehab and a weird weight formula
time limit per test: 2.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
1 2
1 3
Output
7
Input
5
4 5 3 7 8
1 2
1 3
3 4
4 5
Output
40
----------------------------------------------------------------------------------------------------
