Codeforces Round 128 (Div. 2)


A. Two Problems
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
30 5 20 20 3 5
Output
YES
Input
10 4 100 5 5 1
Output
NO
----------------------------------------------------------------------------------------------------
B. Game on Paper
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 11
1 1
1 2
1 3
2 2
2 3
1 4
2 4
3 4
3 2
3 3
4 1
Output
10
Input
4 12
1 1
1 2
1 3
2 2
2 3
1 4
2 4
3 4
3 2
4 2
4 1
3 1
Output
-1
----------------------------------------------------------------------------------------------------
C. Photographer
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 10
2 3
1 4
2 1
1 0
Output
2
3 2 
Input
3 6
6 6
1 1
1 0
1 0
Output
1
2 
----------------------------------------------------------------------------------------------------
D. Hit Ball
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2 11
3 -11 2
Output
6.5000000000 2.0000000000
Input
7 2 11
4 -3 3
Output
4.1666666667 1.0000000000
----------------------------------------------------------------------------------------------------
E. Transportation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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