Maximum waiting time between events such that k events are not missed
The solution was using a binary search on the time between laps and since every checking of the value is linear time, computing the solution is cheap. Thank you anyway.