Codeforces Beta Round 90


A. Epic Game
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 5 9
Output
0
Input
1 1 100
Output
1
----------------------------------------------------------------------------------------------------
B. Before Exam
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
7 3
7 15 0 19 10 5 12
2
1 6
7 4
Output
5.0000000000 15.5000000000
Input
4 2
10 8 1 17
2
2 3
3 2
Output
4.5000000000 13.5000000000
----------------------------------------------------------------------------------------------------
C. Education Reform
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 5 2
1 10 1
1 10 2
1 10 3
1 20 4
1 100 5
Output
YES
2 8
3 10
4 20
5 40
Input
3 4 3
1 3 1
2 4 4
2 3 3
2 2 2
Output
NO
----------------------------------------------------------------------------------------------------
D. String Transformation
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
Die Polizei untersucht eine Straftat im IT-Bereich.
untersucht eine Straftat.hciereB-TI mi  ieziloP eiD
Output
11 36
Input
cbaaaa
aaaabc
Output
4 5
Input
123342
3324212
Output
-1 -1
----------------------------------------------------------------------------------------------------
E. Alternative Reality
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 1
0 0 0
0 1 0
1 0 0
1 1 0
0 0 1
Output
0.7071067812
Input
5 3
0 1 0
1 0 1
1 2 1
2 0 1
1 3 0
1 1 1
1 2 3
3 0 3
Output
1.6329931619
1.6366341768
1.5411035007
Input
2 1
0 20 0
0 0 0
0 10 0
Output
0.0000000000
----------------------------------------------------------------------------------------------------
