Codeforces Beta Round 28 (Codeforces format)


A. Bender Problem
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 2
0 0
0 2
2 2
2 0
4 4
Output
YES
1 -1 2 -1 
Input
6 3
0 0
1 0
1 1
2 1
2 2
0 2
3 2 3
Output
YES
1 -1 2 -1 3 -1 
Input
6 3
0 0
1 0
1 1
2 1
2 2
0 2
2 2 3
Output
NO
----------------------------------------------------------------------------------------------------
B. pSort
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
5 4 3 2 1
1 1 1 1 1
Output
YES
Input
7
4 3 5 1 2 7 6
4 6 6 1 6 6 1
Output
NO
Input
7
4 2 5 1 3 7 6
4 6 6 1 6 6 1
Output
YES
----------------------------------------------------------------------------------------------------
C. Bath Queue
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1
2
Output
1.00000000000000000000
Input
2 2
1 1
Output
1.50000000000000000000
Input
2 3
1 1 1
Output
1.33333333333333350000
Input
7 5
1 1 2 3 1
Output
2.50216960000000070000
----------------------------------------------------------------------------------------------------
D. Don't fear, DravDe is kind
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5
1 1 0 3
1 1 1 2
1 1 2 1
1 1 3 0
2 1 3 0
Output
4
1 2 3 5 
Input
5
1 1 0 3
10 1 2 1
2 2 1 1
10 1 1 2
3 1 3 0
Output
3
1 3 5 
----------------------------------------------------------------------------------------------------
E. DravDe saves the world
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
0 0
1 0
1 1
0 1
0 -1
1 0 1
-1
0 1 -1
Output
1.00000000 0.00000000
Input
4
0 0
0 1
1 1
1 0
0 -1
-1 -1 1
-1
0 1 -1
Output
-1.00000000 -1.00000000
Input
4
0 0
1 0
1 1
0 1
0 -1
1 1 1
-1
1 1 -1
Output
0.50000000 0.00000000
----------------------------------------------------------------------------------------------------
