#P2928. [USACO09HOL] Cattle Bruisers G
[USACO09HOL] Cattle Bruisers G
Description
Canmuu is out for revenge after being utterly defeated by Bessie in paintball and has challenged Bessie to a video game.
In this game, Bessie starts out at point in the coordinate grid , and tries to escape, starting at time 0. She moves continuously at a velocity of units/second . Thus, at time 1 she will be at point ; at time she will be at .
Unfortunately, Canmuu has sent cattle bruisers to pursue Bessie. At time , cattle bruiser i is at position $(X_i, Y_i) (-1,000 \le X_i \le 1,000; -1,000 \le Y_i \le 1,000)$ with velocity units/second $(-1,000 \le VX_i \le 1,000; -1,000 \le VY_i \le 1,000)$.
Each cattle bruiser carries a 'proximity' weapon to fire at Bessie; the weapon can hurt Bessie when the cattle bruiser is no further than units from her.
Bessie has a shield to protect herself from these attacks. However, she does not want to waste any of her shield's power, so she would like to know the maximum number of cattle bruisers within firing range for any (potentially non-integer) time.
In order to avoid precision errors with real numbers, it is guaranteed that the answer produced will be the same whether the attack range is decreased to or increased to .
FEEDBACK: Your first submissions for this problem will be run on some of the official test data, and you will receive a summary of the results.
自从卡门在弹珠游戏中被贝茜彻底击败,他一直在想找机会复仇。这会儿,他邀贝茜去玩一个电脑游戏。
游戏中,贝茜在()处开始行动,这时时刻为 。她要试图逃离。她的速度为 () 每秒。
不幸的是,卡门为了复仇,放出 个杀手追击贝茜。
在 时,杀手 的位置是 , 他的速度是 每秒。
由于每个杀手配备了手枪,手枪的射程是 ,也就是说贝茜要与这个杀手的距离需要保持超过 ,否则有性命之虞。
然而,贝茜还有一件秘密武器,盾。但是,她不想过多地消耗盾的能量。所以,她想知道在逃脱过程中,某一个时刻她在最多为多少个杀手的射程内。当然这个时刻不一定是整数。
为了防止出现精度误差,数据保证在 时也能得出正确结果。
Input Format
* Line : Six space-separated integers: , , , , , and .
* Lines ~ : Line i+1 contains four space-separated integers: , , , and .
第一行:六个整数:.
后 行每行包含四个整数:.
Output Format
* Line : Print a single integer denoting the maximum number of cattle bruisers within attack range at any point in time.
输出一个整数,表示在任意时刻攻击范围内最多可存在的杀手数量。
3 1 0 0 0 2
0 -3 0 4
1 2 -1 1
1 -2 2 -1
2
Hint
Bessie starts at point and is moving at units per second in the (positive) y-direction. There are cattle bruisers, the first of which starts at point and travels units per second in the y-direction. The maximum distance for a cattle bruiser to be in range of Bessie is unit.
At time , Bessie is at point , and the three bruisers are at points , , and . The first two cattle bruisers are within unit of Bessie, while the third will never be within unit of Bessie, so is the most achievable.
样例解释:
贝茜从点 出发,以每秒 个单位的速度沿 y 轴正方向移动。有 个杀手,其中第一个从点 出发,以每秒 个单位的速度沿 y 轴移动。杀手与贝茜的最远有效距离为 个单位。
在时刻 ,贝茜位于点 ,而三个杀手分别位于点 和 。前两个杀手与贝茜的距离均不超过 单位,但第三个杀手永远无法进入贝茜 单位范围内,因此最多可存在的杀手数量为 。
京公网安备 11011102002149号