Problem F
Space Probe

The space probe is out of control! It’s going to start its
measurement sequence sometime between two given times
The measurement sequence is pre-programmed and cannot be
changed. It consists of
The measurements are instantaneous events — each happens in
a very short time, so we consider the duration of any
measurement to be
The probe is rotating in space and cannot be controlled. Due
to its rotation, there are intervals of time when measurement
devices are pointed at the Sun. If the probe were to use a
measurement device while the device is pointed at the Sun, the
device’s sensors would be destroyed and the whole probe would
be lost. We do know the trajectory and the rotation of the
probe and therefore there is a set of
Find the probability that the probe makes all measurements successfully and is not lost due to solar radiation damage!
Note that in this problem, all known times and time interval
lengths are expressed as integers. However, the time of the
start of the measurement sequence is unknown and we suppose
that it may be expressed as any real number in the interval
Input
The first input line contains four integers
We know that
Output
Output the probability of the probe’s survival, that is, the
probability that no measurement will be made during any of the
intervals in which the Sun could damage the sensors. Your
answer must be within an absolute or relative error of
Sample Input 1 | Sample Output 1 |
---|---|
2 2 10 20 1 5 12 14 15 18 |
0.4000000000 |
Sample Input 2 | Sample Output 2 |
---|---|
6 3 100 200 0 10 20 30 40 50 140 150 170 171 210 300 |
0.0900000000 |