I've come across this problem, I know that I'm going to binary search the answer (Given the fact that if x(time) is good, x + 1 is also good), but I am very stuck at how to determine if that time is good or not in the first place. Any help would be much appreciated. Thanks in advance,