This is not exactly a CS class project but it is very similar to that. Need a data structure that would allow handling interval queries.
Given a set of n intervals (some intervals may consist of several segments),
preprocess them so that the queries can be answered efficiently.
First query: given a query point and index i,
a) find if point is within all but ith intervals
b) if not, find the nearest two points, one on the left and one on the right, that are within all intervals but ith
(there's another query but it's simpler than first one).
Preprocessing should take n log n time, queries should take log n time.