Codeforces Round 357 (Div. 2)


A. A Good Contest
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
Burunduk1 2526 2537
BudAlNik 2084 2214
subscriber 2833 2749
Output
YES
Input
3
Applejack 2400 2400
Fluttershy 2390 2431
Pinkie_Pie -2500 -2450
Output
NO
----------------------------------------------------------------------------------------------------
B. Economy Game
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1359257
Output
YES
Input
17851817
Output
NO
----------------------------------------------------------------------------------------------------
C. Heap Operations
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
insert 3
getMin 4
Output
4
insert 3
removeMin
insert 4
getMin 4
Input
4
insert 1
insert 1
removeMin
getMin 2
Output
6
insert 1
insert 1
removeMin
removeMin
insert 2
getMin 2
----------------------------------------------------------------------------------------------------
D. Gifts by the List
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 2
1 2
2 3
1 2 1
Output
-1
Input
4 2
1 2
3 4
1 2 3 3
Output
3
2
1
3
----------------------------------------------------------------------------------------------------
E. Runaway to a Shadow
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
0 0 1 1
3
1 1 1
-1 -1 1
-2 2 1
Output
0.50000000000
Input
0 0 1 0
1
1 0 1
Output
1.00000000000
----------------------------------------------------------------------------------------------------
