Codeforces Round 633 (Div. 1)


A. 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
----------------------------------------------------------------------------------------------------
B. 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
----------------------------------------------------------------------------------------------------
C. 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
----------------------------------------------------------------------------------------------------
D. Nested Rubber Bands
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
4 6
Output
4
Input
4
1 2
2 3
3 4
Output
2
----------------------------------------------------------------------------------------------------
E. JYPnation
time limit per test: 2 seconds
memory limit per test: 1024 megabytes
input: standard input
output: standard output

Examples
Input
4
7
2
1
4
Output
7380
Input
8
7F
3F
1F
0C
06
03
11
18
Output
88464
----------------------------------------------------------------------------------------------------
