I faced this problem in an interview, I couldn't solve it in interview. I recall a similair problem that i solved during IOI though cannot recall it.
Given N houses in a line. each of M pokemon makes an appearance at a house exactly once. ex - a pokemon appears for an instant at 5th house at time = 6. another pokemon appears for an instant at 7th house at time = 1. and so on.
we start at house P, we can move at speed of X house/sec. find max number of pokemon you can catch?
All i can think of is greedy or bruteforce but bruteforce is exponential and greedy is incorrect.