G. Great Expectations
time limit per test
4 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
100 111 5
20 0.5 10
80 0.5 2
85 0.5 2
90 0.5 2
95 0.5 2
Output
124.00000000
Input
2 4 1
1 0.5 5
Output
3.00000002
Input
10 20 3
5 0.3 8
6 0.8 3
8 0.9 3
Output
18.90298507
Input
10 50 1
5 0.5 30
Output
15.00000000