Educational Codeforces Round 48 (Rated for Div. 2)


A. Death Note
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 5
3 7 9
Output
0 2 1 
Input
4 20
10 9 19 2
Output
0 0 1 1 
Input
1 100
99
Output
0 
----------------------------------------------------------------------------------------------------
B. Segment Occurrences
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
10 3 4
codeforces
for
1 3
3 10
5 6
5 7
Output
0
1
0
1
Input
15 2 3
abacabadabacaba
ba
1 15
3 4
2 14
Output
4
0
3
Input
3 5 2
aaa
baaab
1 3
1 1
Output
0
0
----------------------------------------------------------------------------------------------------
C. Vasya And The Mushrooms
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3
1 2 3
6 5 4
Output
70
Input
3
1 1000 10000
10 100 100000
Output
543210
----------------------------------------------------------------------------------------------------
D. Vasya And The Matrix
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2 3
2 9
5 3 13
Output
YES
3 4 5
6 7 8
Input
3 3
1 7 6
2 15 12
Output
NO
----------------------------------------------------------------------------------------------------
E. Rest In The Shades
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
-3 1 6
2
2 4
6 7
5
3 1
1 3
6 1
6 4
7 6
Output
5.000000000000000
3.000000000000000
0.000000000000000
1.500000000000000
2.000000000000000
----------------------------------------------------------------------------------------------------
F. Road Projects
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 2
1 2 18
2 3 22
3 4 24
4 7 24
2 6 4
3 5 12
1
100
Output
83
88
----------------------------------------------------------------------------------------------------
G. Appropriate Team
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

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