ACM ICPC World Finals 2009

Problem A: A Careful Approach

Since the number of planes is at most 8, an optimal solution can be found by simply trying all 8! = 40320 possible orders for the planes to land. When trying a specific ordering, the largest possible landing window can be computed by binary searching over the maximum possible window and then greedily checking whether a certain window length can be achieved. Something which may be easy to miss in this problem is that it can be the case that the landing time of a plane should be a non-integral number of seconds.