Little Johnny woke up late. Now he only has timeLeft minutes to get to school.
Sadly, Johnny doesn't have a direct connection to school. He has to use three specific bus lines (one after another) to get there.
The buses in Johnny's town don't have a fixed schedule. Instead, each bus line is assigned some
nonnegative integer W.
If you arrive at a bus stop of a bus line,
you know that the time you will have to wait is a random variable
drawn from the interval [0,W] with uniform probability.
Note that from a passenger's point of view the number W corresponds to the maximum waiting time.
(You can imagine this in a real life setting as follows:
If you stand on a bus stop of a line that has a positive W, precisely every W minutes a bus comes by, you just don't know the offset.
If you stand on a bus stop of a line that has W=0, there is always a bus ready to take you.)
You are given two int[]s wait and travel, and an int timeLeft.
The int[] wait specifies the value W (the maximum waiting time) for each of the bus lines Johnny has to take.
The int[] travel specifies how long Johnny rides each of the three buses.
Write a method that computes the probability that Johnny will arrive to school on time.
