Codeforces Round 388 (Div. 2)


A. Bachgold Problem
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
Output
2
2 3
Input
6
Output
3
2 2 2
----------------------------------------------------------------------------------------------------
B. Parallelogram is Back
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 0
1 0
0 1
Output
3
1 -1
-1 1
1 1
----------------------------------------------------------------------------------------------------
C. Voting
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
DDRRR
Output
D
Input
6
DDRRRR
Output
R
----------------------------------------------------------------------------------------------------
D. Leaving Auction
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
1 10
2 100
3 1000
1 10000
2 100000
3 1000000
3
1 3
2 2 3
2 1 2
Output
2 100000
1 10
3 1000
Input
3
1 10
2 100
1 1000
2
2 1 2
2 2 3
Output
0 0
1 10
----------------------------------------------------------------------------------------------------
E. Inversions After Shuffle
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
2 3 1
Output
1.916666666666666666666666666667
----------------------------------------------------------------------------------------------------
