Educational Codeforces Round 1


A. Tricky Sum
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
2
4
1000000000
Output
-4
499999998352516354
----------------------------------------------------------------------------------------------------
B. Queries on a String
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
abacaba
2
3 6 1
1 4 2
Output
baabcaa
----------------------------------------------------------------------------------------------------
C. Nearest vectors
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
-1 0
0 -1
1 0
1 1
Output
3 4
Input
6
-1 0
0 -1
1 0
1 1
-4 -5
-4 -6
Output
6 5
----------------------------------------------------------------------------------------------------
D. Igor In the Museum
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
5 6 3
******
*..*.*
******
*....*
******
2 2
2 5
4 3
Output
6
4
10
Input
4 4 1
****
*..*
*.**
****
3 2
Output
8
----------------------------------------------------------------------------------------------------
E. Chocolate Bar
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
2 2 1
2 2 3
2 2 2
2 2 4
Output
5
5
4
0
----------------------------------------------------------------------------------------------------
F. Cut Length
time limit per test: 0.5 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 3
0 0
1 0
1 1
0 1
0 0 1 1
0 0 0 1
0 0 1 -1
Output
1.41421356237309514547
1.00000000000000000000
0.00000000000000000000
----------------------------------------------------------------------------------------------------
