Blaster the Daredevil
시간 제한7초메모리 제한2048 MB
원점에서 출발하는 직선이 최대한 많은 수직 선분과 만나도록 발사 각도를 정해 통과하는 hoop 수의 최댓값을 구한다.
문제
This year, Blaster wants to make a grand exit from graduation, and what better way to do so than by launching himself out of a cannon? Blaster's stunt can be modeled as a path in the XY-plane where the cannon is positioned at the origin, , and can be aimed at any angle.
Suspended in the air are floating hoops, each represented as a vertical segment. The -th hoop is located meters along the X-axis. The bottom of the hoop is positioned meters above the X-axis, and the top of the hoop is positioned meters above the X-axis.
Blaster, modeled as a single point, will follow a perfectly straight-line trajectory after launch (since he has conveniently disabled Earth's gravity for this stunt). He is considered to pass through a hoop if his trajectory intersects or touches at least one point on the vertical line segment between and .
Your task is to determine the maximum number of hoops Blaster can pass through if you carefully choose the cannon's launch angle.
입력
The first line contains a single integer — the number of hoops.
Each of the next lines contains three integers , describing the position and height range of the -th hoop.
It is guaranteed that perturbing the endpoints of hoops up or down by at most meters will not affect the answer.
출력
Print a single integer---the maximum number of hoops Blaster can pass through for an optimal choice of launch angle.