编程介的小学生 2017-08-24 15:22 采纳率: 20.5%
浏览 801
已采纳

Fairy Wars

Cirno is an ice fairy and lives near the Misty Lake. One day, she found her house was exploded by the Three Mischievous Fairies - Sunny Milk, Luna Child and Star Sapphire.

How could Cirno endure this! She was going for revenge and declared war between her and the culprits. Shortly afterwards, she fell into a trap. It is a barrage of bullets.

As an ice fairy, she can freeze the bullets around her within a radius R and then, each frozen bullet will form a small ice block with L * L size. The sides of each block are parallel to the X-axis or Y-axis and the center of each block is located in the position of its corresponding bullet.

TH_FairyWars.jpg
If an ice block contains some unfrozen bullets, those bullets will also turn into ice blocks soon. Under this rule, it may cause a chain reaction between bullets. By the way, the reaction is very fast, so you can assume all the bullets are motionless.

Give you the coordinates of each bullet and the position of Cirno. Please calculate the number of ice blocks in the end.

Input

There are multiple test cases. For each test case:

The first line contains three positive integers N (will not greater than 50000), R and L which indicates the number of bullets, the radius of the initial frozen area and the size of each ice block. Then followed by N lines, each line contains two integers Xi and Yi represents the position of each bullet. The last line contains two integers X0 and Y0 represents the position of Cirno. The absolute value of any integer in the input file will not exceed 1,000,000,000.

Output

For each test case, output the number of ice blocks in the end.

Sample Input

3 3 4
-1 1
1 -1
2 2
4 -1
Sample Output

2

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog