weeb Japanese animation enthusiast, so it's no surprise that he enjoys playing osu!, an anime-themed rhythm game. In this game, circles appear one-by-one on the screen, and players are required to move their cursor to them and click on them at just the right time to get points.
New circles usually appear close to the positions of previous circles, but they may occasionally appear on the other side of the screen as well (called "jumps").
Given a sequence of coordinates of circles (points) in the form
Input Specification
The first line will contain 2 space-separated integers
The next
Output Specification
Output a single integer representing the longest possible combo
can achieve.Sample Input
5 5
0 0
1 1
2 1
2 -6
-1 -4
Sample Output
3
Comments
After he misses, is his next click guaranteed or does it still have to be within his reach?
Sorry for the late reply, but yes, his next click is guaranteed.
Consider this test case.
Kashif can forgo the second circle to get a combo of 3, instead of getting a combo of 2 if he hits in order.
In osu! the circles must be clicked in the order they show up (I.E. no skipping).
Can Kashif continue game after he misses for the first time? And should all circles be hit in consecutive way?
Yes, misses only affect combo, and yes, all circles must be hit in the order given in input.