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

建议使用的浏览器:

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

2859:A rectangle

题目描述

There are four active children, whose names are Her-ri, Sumyou, Dashom, and Hooyeon, respectively. They play with N distinct points on the x-y coordinates. Each of them chooses a point, and they want to make a rectangle, with 4 points they choose, whose sides are parallel to either x-axis or y-axis. Also, a rectangle should have A width and B height. 4 children are really eager to know how many ways they can build up a rectangle. For example, if there are 6 points whose pairs are (0, 0), (5, 0), (5, 10), (7, 10), (7, 0) and (0, 10) and children want to make a rectangle whose width is 5 and height is 10, there is just one way to make it.

输入解释

The first line of input will be a positive integer, N (5 ≤ N ≤ 500,000), which indicates the number of points on the coordinates. The second line contains two positive integers A and B (A, B ≤ 1,000,000,000), which should be the width and height of the rectangle, respectively. The i-th line of next N lines will contain xi and yi (−1,000,000,000 ≤ xi, yi, ≤ 1,000,000,000), which represent the i-th point.

输出解释

Output should contain the number of ways children can make a rectangle. If there's no way, just output 0.

输入样例
6
2 3
0 0
2 0
2 3
0 3
4 0
4 3
输出样例
2
来自北京大学POJ的附加信息
Case time limit(单组数据时间限制) 1000MS

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2859

最后修改于 2020-10-29T06:46:07+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
7000 65536