Codeforces Round 114 (Div. 1)


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

Examples
Input
3 10 10000
0 10
5 11
1000 1
Output
1000.5000000000
1000.5000000000
11000.0500000000
Input
1 2 26
28 29
Output
33.0990195136
----------------------------------------------------------------------------------------------------
B. Wizards and Huge Prize
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
3 1 0
10 20 30
-1 -1 2
Output
0.300000000000
Input
1 1 1
100
123
Output
1.000000000000
----------------------------------------------------------------------------------------------------
C. Wizards and Numbers
time limit per test: 2 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4
10 21
31 10
0 1
10 30
Output
First
Second
Second
First
----------------------------------------------------------------------------------------------------
D. Wizards and Roads
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
6 6
0 0
1 1
2 2
3 3
4 4
5 5
2 3 3 2
4
0 5
1 4
2 3
3 3
Output
3
2
1
0
Input
6 1
0 0
3 5 23917 11
4
0 1000000008
0 10
100 150
200 10000
Output
2
1
0
1
----------------------------------------------------------------------------------------------------
E. Wizards and Bets
time limit per test: 3 seconds
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
4 2 1000003
1 3
2 4
Output
1
Input
4 2 1000003
4 1
3 2
Output
1000002
Input
4 4 1000003
2 1
2 4
3 1
3 4
Output
0
Input
6 5 1000003
1 4
1 5
1 6
2 6
3 6
Output
0
Input
5 2 1000003
5 1
3 4
Output
1
----------------------------------------------------------------------------------------------------
