#P3222. [HNOI2012] 射箭
[HNOI2012] 射箭
Description
Momo is playing a 2D archery game, as shown in Figure 1. In this game, the x-axis lies on the ground, and in the first quadrant there are several vertical segments serving as targets. Any two targets are disjoint, and none of them touch the coordinate axes.
Momo controls an archer located at . She can shoot an arrow of light with piercing ability at any angle between 0 and 90 degrees (excluding 0 degrees and 90 degrees), with any power. Since there is no air resistance in the game and the arrow of light has no shaft, the trajectory is a standard parabola. All targets crossed by the trajectory are considered hit, including those whose endpoints are hit only.
This game has multiple modes, and Momo’s favorite is the challenge mode.
In challenge mode, the first level has only one target. Hitting this target allows her to enter level two, where one more target appears in addition to the first one. If she can hit both targets with a single shot, she can enter level three, where a third target appears. And so on: at each level, a new target appears. At level , she must hit all targets that have appeared in the first levels with a single shot to enter level ; otherwise, the game ends.
Momo has spent a lot of time on this game, but she can only reach level seven, “Seven Stars in a Row,” which confuses her. She has obtained the positions of the targets that appear in each level and wants you to tell her the maximum number of levels she can pass.
Input Format
The first line of input contains a positive integer , indicating that there are levels.
The next lines follow. Line contains three positive integers , meaning that in level the target’s x-coordinate is , and its y-range is from to .
Output Format
Output a single integer, the maximum number of levels that can be cleared.
5
2 8 12
5 4 5
3 8 10
6 2 3
1 3 7
3
Hint

Constraints:
- 30% of the testdata satisfy .
- 50% of the testdata satisfy .
- 100% of the testdata satisfy , and all given coordinates do not exceed .
Translated by ChatGPT 5
京公网安备 11011102002149号