All submissions for this problem are available.
A new format of a robotic competition requires a participant to make a robot that touches flags to score points. Initially, the robot can be set at any of the flags, facing any direction, with 2 parameters set: the distance it moves and a direction, left or right. The robot then moves that distance, turns 90 degrees in the direction set, then moves that distance again, turns again, and so on, alternating between move and turn until it reaches it's original flag. If the robot touches a flag at each location where it turns, the robot scores a point. The robot may then be set at any flag, and the process repeated. The robot cannot go through the same sequence of flags to score multiple points.
The first line gives t, the number of test cases( t ≤ 300 ). Then t test cases follow.
For each test case:
The first line gives n, the number of flags,
The next n lines give 2 integers x y each, for the x and y coordinate of each flag.
(0 < n ≤ 2000)
(-30000 < x < 30000)
(-30000 < y < 30000)
For each test case output a single line.
print number x, denoting the maximum number of points a robot can score given a set of flags.
Input: 2 6 0 0 0 1 0 2 1 0 1 1 1 2 7 0 1 9 9 3 6 2 1 1 2 5 7 1 0 Output: 16 8
|Time Limit:||1.81 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, ADA, CAML, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, ERL|
Fetching successful submissions
If you are still having problems, see a sample solution here.