Codeforces Round 633 (Div. 2)


A. Filling Diamonds
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
2
1
Output
2
1
----------------------------------------------------------------------------------------------------
B. Sorted Adjacent Differences
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
6
5 -2 4 8 6 5
4
8 1 4 2
Output
5 5 4 6 8 -2
1 2 4 8
----------------------------------------------------------------------------------------------------
C. Powered Addition
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
4
1 7 6 5
5
1 2 3 4 5
2
0 -4
Output
2
0
3
----------------------------------------------------------------------------------------------------
D. Edge Weight Assignment
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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

Examples
Input
9
1
2
3
4
5
6
7
8
9
Output
1
2
3
4
8
12
5
10
15
----------------------------------------------------------------------------------------------------
