Problem Statement | |||||||||||||
You are walking down the escalator to catch a subway train.
The escalator itself moves at a speed of Ve meters per minute.
You can walk down the escalator at a relative speed of Vy meters per minute.
The length of the escalator is L meters.
Trains arrive T minutes apart.
Let t be the time between your arrival to the station if you stand still on the escalator and the arrival of the last train before your arrival. Assume that t is a random variable uniformly distributed between 0 and T. Return the probability of catching an earlier train if you choose to walk down the escalator instead of standing still on it. | |||||||||||||
Definition | |||||||||||||
| |||||||||||||
Notes | |||||||||||||
- | The returned value must have an absolute or relative error less than 1e-9. | ||||||||||||
Constraints | |||||||||||||
- | Ve will be between 10 and 60, inclusive. | ||||||||||||
- | Vy will be between 1 and 10, inclusive. | ||||||||||||
- | L will be between 10 and 100, inclusive. | ||||||||||||
- | T will be between 2 and 20, inclusive. | ||||||||||||
Examples | |||||||||||||
0) | |||||||||||||
| |||||||||||||
1) | |||||||||||||
| |||||||||||||
2) | |||||||||||||
| |||||||||||||
3) | |||||||||||||
|