Codeforces Round 341 (Div. 2)


A. Wet Shark and Odd and Even
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
Output
6
Input
5
999999999 999999999 999999999 999999999 999999999
Output
3999999996
----------------------------------------------------------------------------------------------------
B. Wet Shark and Bishops
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 1
1 5
3 3
5 1
5 5
Output
6
Input
3
1 1
2 3
3 5
Output
0
----------------------------------------------------------------------------------------------------
C. Wet Shark and Flowers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
1 2
420 421
420420 420421
Output
4500.0
Input
3 5
1 4
2 3
11 14
Output
0.0
----------------------------------------------------------------------------------------------------
D. Rat Kwesh and Cheese
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1.1 3.4 2.5
Output
z^y^x
Input
2.0 2.0 2.0
Output
x^y^z
Input
1.9 1.8 1.7
Output
(x^y)^z
----------------------------------------------------------------------------------------------------
E. Wet Shark and Blocks
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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