测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A10160. BCPC

编程题 普及/提高-

题目描述

In the first line of the input three integers $n$ , $c$ and $d$ ( $3<=n<=345678,1<=c,d<=10^{9}$ ) are written. They denote the number of students Blenda can use to form teams, the value subtracted from all reading speeds and the value subtracted from all writing speeds respectively.

Each of the next $n$ lines contains two integers $r_{i}$ and $w_{i}$ ( $0<r_{i},w_{i}<=10^{9},|r_{i}-c|+|w_{i}-d|>0$ ). There are no two students, such that both their reading and writing speeds coincide, i.e. for every $i≠j$ condition $|r_{i}-r_{j}|+|w_{i}-w_{j}|>0$ holds.

输入格式

Print the number of different teams in BSU, that are good according to Blenda's definition.

输出格式

In the first sample the following teams are good: $(i=1,j=2,k=3)$ , $(i=2,j=5,k=1)$ , $(i=1,j=4,k=3)$ , $(i=5,j=1,k=4)$ .

Note, that for example the team $(i=3,j=1,k=2)$ is also good, but is considered to be the same as the team $(i=1,j=2,k=3)$ .

输入输出样例

输入 #1
5 2 2
1 1
4 1
2 3
3 2
3 4
输出 #1
4
输入 #2
7 6 6
3 2
1 7
5 7
3 7
6 4
8 9
8 5
输出 #2
11

说明/提示

In the first sample the following teams are good: $(i=1,j=2,k=3)$ , $(i=2,j=5,k=1)$ , $(i=1,j=4,k=3)$ , $(i=5,j=1,k=4)$ .

Note, that for example the team $(i=3,j=1,k=2)$ is also good, but is considered to be the same as the team $(i=1,j=2,k=3)$ .
上一题 去做题 下一题