当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6906:False God

题目描述
You are facing an endgame of Shogi.



You have only one Kin(金将). However, your opponent has n Fu(步兵).

The rule of this game is as following.



If Kin is at (x,y), it can move to one of the following positions in one step: (x+1,y),(x+1,y+1),(x,y+1), (x-1,y+1),(x-1,y),(x,y-1).



If Fu is at (x,y), it can only move to (x,y-1) in one step.

Now you know the initial position of your Kin and your opponent’s Fu. Each turn, you move your Kin first and then all Fu will move one step.

When you are moving Kin, you can defeat the Fu at that position. If one Fu moves one step and meets Kin, your opponent is also defeated.

To win this game, you want to defeat Fu as many as possible. Now Chino wonders the maximum count of Fu that will be defeated. Can you help cute Chino?
输入解释
The first line contains one integer T (1 ≤ T ≤ 10) denoting the number of testcases.

For each testcase,

The first line contains two integers $x_0,y_0$ (|$x_0$|,|$y_0$|≤ 1000000000) denoting the initial position for Kin.

The second line contains one integer n (1 ≤ n ≤ 1000) denoting the number of Fus your opponent has.

The next n lines each contains two integers $x_i,y_i$ (|$x_i$|,|$y_i$|≤ 1000000000) denoting the position of Fu i (1 ≤ i ≤ n).

It is guaranteed that $(x_i,y_i) \neq (x_j,y_j)$ for all pairs of i,j satisfying 0 ≤ i < j ≤ n.

It is guaranteed that $\sum$n ≤ 5000.
输出解释
One line for each testcase with one integer denoting the answer.
输入样例
2
1 1
2
0 2
2 2
2 1
5
0 0
2 0
3 3
5 4
4 6
输出样例
1
4

提示
For the second testcase, your Kin can defeat the last 4 Fu.
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6906

最后修改于 2021-06-22T18:18:49+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 262144/262144K(Java/Others)