303043: CF592E. BCPC

Memory Limit:256 MB Time Limit:4 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

BCPC

题目描述

BCPC stands for Byteforces Collegiate Programming Contest, and is the most famous competition in Byteforces. BCPC is a team competition. Each team is composed by a coach and three contestants. Blenda is the coach of the Bit State University(BSU), and she is very strict selecting the members of her team. ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF592E/30dca87412072f43fdb65bfe848e3b24c583bfe0.png)In BSU there are $ n $ students numbered from 1 to $ n $ . Since all BSU students are infinitely smart, the only important parameters for Blenda are their reading and writing speed. After a careful measuring, Blenda have found that the $ i $ -th student have a reading speed equal to $ r_{i} $ (words per minute), and a writing speed of $ w_{i} $ (symbols per minute). Since BSU students are very smart, the measured speeds are sometimes very big and Blenda have decided to subtract some constant value $ c $ from all the values of reading speed and some value $ d $ from all the values of writing speed. Therefore she considers $ r_{i}'=r_{i}-c $ and $ w_{i}'=w_{i}-d $ . The student $ i $ is said to overwhelm the student $ j $ if and only if $ r_{i}'·w_{j}'>r_{j}'·w_{i}' $ . Blenda doesn’t like fights in teams, so she thinks that a team consisting of three distinct students $ i,j $ and $ k $ is good if $ i $ overwhelms $ j $ , $ j $ overwhelms $ k $ , and $ k $ overwhelms $ i $ . Yes, the relation of overwhelming is not transitive as it often happens in real life. Since Blenda is busy preparing a training camp in Codeforces, you are given a task to calculate the number of different good teams in BSU. Two teams are considered to be different if there is at least one student that is present in one team but is not present in the other. In other words, two teams are different if the sets of students that form these teams are different.

输入输出格式

输入格式


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&lt;r_{i},w_{i}<=10^{9},|r_{i}-c|+|w_{i}-d|&gt;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}|&gt;0 $ holds.

输出格式


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

输入输出样例

输入样例 #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) $ .

Input

加入题单

算法标签: