Good Bye 2018


A. New Year and the Christmas Ornament
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
8 13 9
Output
24
Input
13 3 6
Output
9
----------------------------------------------------------------------------------------------------
B. New Year and the Treasure Geolocation
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
2 5
-6 4
7 -2
-1 -3
Output
1 2
Input
4
2 2
8 2
-7 0
-2 6
1 -14
16 -12
11 -18
7 -14
Output
9 -12
----------------------------------------------------------------------------------------------------
C. New Year and the Sphere Transmission
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
Output
1 5 9 21
Input
16
Output
1 10 28 64 136
----------------------------------------------------------------------------------------------------
D. New Year and the Permutation Concatenation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
Output
9
Input
4
Output
56
Input
10
Output
30052700
----------------------------------------------------------------------------------------------------
E. New Year and the Acquaintance Estimation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
3 3 3
Output
3 
Input
4
1 1 1 1
Output
0 2 4 
Input
2
0 2
Output
-1
Input
35
21 26 18 4 28 2 15 13 16 25 6 32 11 5 31 17 9 3 24 33 14 27 29 1 20 4 12 7 10 30 34 8 19 23 22
Output
13 15 17 19 21 
----------------------------------------------------------------------------------------------------
F. New Year and the Mallard Expedition
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1
10
G
Output
30
Input
2
10 10
WL
Output
40
Input
2
1 2
WL
Output
8
Input
3
10 10 10
GLW
Output
80
----------------------------------------------------------------------------------------------------
G. New Year and the Factorisation Collaboration
time limit per test: 6 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
21
7
17
15
17
11
-1
15
Output
+ 12 16
- 6 10
* 8 15
/ 5 4
sqrt 16
sqrt 5
^ 6 12
! 2 3 7
----------------------------------------------------------------------------------------------------
H. New Year and the Tricolore Recreation
time limit per test: 4 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 6
0 3 9
Output
Alice
Bob
Input
1 2
0 3 9
Output
Alice
Bob
Input
10 133
-248 -193 -187
97 101 202
-72 67 91
23 89 215
-129 -108 232
-223 -59 236
-99 86 242
-137 -109 -45
-105 173 246
-44 228 243
Output
Bob
Alice
----------------------------------------------------------------------------------------------------
