You are in charge of building an airport runway scheduling system. Let’s say that today you have 5 landings scheduled at time 37, 41, 46, 49, and 56, but now another airline wants to see if they can schedule landings at time 44, 53, and 20 as well. How could we handle this new request?
We have this new request for landings that need to be checking to see whether it would overlap within k time with another scheduled flight or not. If so, we could not insert it into our schedule. The input file contains several lines, one for each number to be scheduled. Each line contains first integer n, where n is the number of scheduled landings today, follows by the scheduled time for landings, k time to check overlap, and new request time for landings.
Write a program that maintains reservations for set of landings on airport runway scheduling system.
Request at time 44 is not allowed
Request at time 53 is allowed
Request at time 20 is not allowed