Topcoder: Line sweep algorithms