CF592E.BCPC
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
In the first line of the input three integers n , c and d ( 3<=n<=345678,1<=c,d<=109 ) 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 ri and wi ( 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) .