OK, let's say we can find the largest non-negative integer n such that n*(n+1)/2 <= a + n*u. That is, we come close to the robber in such a way that the next jump gets the cop ahead of the robber. What next? I see it has to be greedy in some way.