编程介的小学生 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条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度