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

建议使用的浏览器:

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

5560:The Shields

题目描述
General Zhang recently got a plasma shield to intercept incoming missiles.

The shape of the plasma shield is basically a square with a horizontal diagonal. Due to some technology issues, the plasma shield cannot protect the whole square area. One vertical stripe in the middle of the square is penetrable to the missiles. So, in fact the shield is formed by two identical isosceles right triangle. Missiles hitting the surface or the edge of the shield are considered intercepted.



Now $N$ missiles are coming to General Zhang’s army. The $i-th$ missile will strike the position $(x_i,y_i)$. Because he only has one plasma shield, he want to calculate when the shield is turned on in a particular way, how many of the missiles it can stop.

General Zhang will give you $M$ queries, each query describe the shape of a plasma by 4 integers $(X,Y,D,W)$. $(X,Y)$ denotes the center of the shield. $D$ denotes the length of the diagonal. $W$ denotes the width of the unprotected stripe. For each query, you need to output number of the missiles stopped by the shield.
输入解释
The first line of input contains an integer $T$ ($T≤20$), which represents the number of test cases.
Each test case starts with $N$ and $M$ ($1≤N,M≤20000$) in a line. The $i-th$ line of the next $N$ lines contains two integers $x_i$ and $y_i$. The next $M$ lines each line has 4 integers $X,Y,D,W$, which represents a query. $D$ and $W$ are guaranteed to be even numbers.
输出解释
For each test case, output a single line consisting of “Case #X:” first. $X$ is the test case number starting from 1. For each query, output the number of missiles that are intercepted in a single line. Do not output extra spaces or newlines.
输入样例
1
4 3
-5 0
-4 0
-3 0
0 0
0 0 0 0
0 0 8 0
0 0 8 2
输出样例
Case #1:
1
3
2
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5560

最后修改于 2020-10-25T23:23:46+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
18000/9000MS(Java/Others) 65536/65536K(Java/Others)