Codeforces Round 182 (Div. 2)


A. Eugeny and Array
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
1 -1
1 1
1 2
2 2
Output
0
1
0
Input
5 5
-1 1 1 1 -1
1 1
2 3
3 5
2 5
1 5
Output
0
1
0
1
0
----------------------------------------------------------------------------------------------------
B. Eugeny and Play List
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 2
2 8
1 16
Output
1
1
Input
4 9
1 2
2 1
1 1
2 2
1 2 3 4 5 6 7 8 9
Output
1
1
2
2
3
4
4
4
4
----------------------------------------------------------------------------------------------------
C. Yaroslav and Sequence
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
50 50 50
Output
150
Input
2
-1 -100 -1
Output
100
----------------------------------------------------------------------------------------------------
D. Yaroslav and Time
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1000
1000
0 0
0 1
0 3
Output
2000
Input
3 1000
1000
1 0
1 1
1 2
Output
1000
----------------------------------------------------------------------------------------------------
E. Yaroslav and Algorithm
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
10
79
Output
10<>11
79<>80
----------------------------------------------------------------------------------------------------
