VK Cup 2012 Round 3 (Unofficial Div. 2 Edition)


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

Examples
Input
5 50
1 2 3 4 5
Output
12.000000
11.000000
10.000000
9.000000
8.000000
Input
2 2
1 100
Output
-1
----------------------------------------------------------------------------------------------------
B. File List
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
read.meexample.txtb.cpp
Output
YES
read.m
eexample.t
xtb.cpp
Input
version.infontldrcontestdata.zip
Output
NO
----------------------------------------------------------------------------------------------------
C. Range Increments
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6
1 2 1 1 4 1
Output
5
2 2
5 5
5 5
5 5
1 6
Input
5
1 0 1 0 1
Output
3
1 1
3 3
5 5
----------------------------------------------------------------------------------------------------
D. Variable, or There and Back Again
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3
1 0 0 2
1 2
2 3
3 4
Output
1
1
1
1
Input
3 1
1 0 2
1 3
Output
1
0
1
Input
3 1
2 0 1
1 3
Output
0
0
0
----------------------------------------------------------------------------------------------------
E. Ancient Berland Hieroglyphs
time limit per test: 1.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 4
1 2 3 4 5
1 3 5 6
Output
2
Input
4 6
1 3 5 2
1 2 3 4 5 6
Output
3
Input
3 3
1 2 3
3 2 1
Output
2
----------------------------------------------------------------------------------------------------
