The competition at AtCoder has ended, I participated but couldn't solve F. The editorial link on the website is in Japanese, which I don't understand. Google translate doesn't give me a good translation or at least I cannot understand it. So can anyone share his/her solution to the problem or the solution from the editorial in english. Here is the problem for those that haven't seen it:
Suppose we have a line and N(N <= 10,000) pairs of points on it with coordinates (x_i, y_i). For each pair we can choose the first or the second point. We are to find the maximum distance between two consecutive points from the chosen(e.g when they are sorted on the line) which we can obtain by using different choices (whether to use x_i or y_i).