Codeforces Round 152 (Div. 1)
D
Donkey and Stars
Codeforces
2700
原题
← CE →
翻译中…

In the evenings Donkey would join Shrek to look at the stars. They would sit on a log, sipping tea and they would watch the starry sky. The sky hung above the roof, right behind the chimney. Shrek's stars were to the right of the chimney and the Donkey's stars were to the left. Most days the Donkey would just count the stars, so he knew that they are exactly $*n*$. This time he wanted a challenge. He imagined a coordinate system: he put the origin of the coordinates at the intersection of the roof and the chimney, directed the $*OX*$ axis to the left along the roof and the $*OY*$ axis — up along the chimney (see figure). The Donkey imagined two rays emanating from he origin of axes at angles $α_{1}$ and $α_{2}$ to the $*OX*$ axis.

翻译中…

image

翻译中…

Now he chooses any star that lies strictly between these rays. After that he imagines more rays that emanate from this star at the same angles $α_{1}$ and $α_{2}$ to the $*OX*$ axis and chooses another star that lies strictly between the new rays. He repeats the operation as long as there still are stars he can choose between the rays that emanate from a star.

翻译中…

image

翻译中…

As a result, the Donkey gets a chain of stars. He can consecutively get to each star if he acts by the given rules.

翻译中…

Your task is to find the maximum number of stars $*m*$ that the Donkey's chain can contain.

翻译中…

Note that the chain must necessarily start in the point of the origin of the axes, that isn't taken into consideration while counting the number $*m*$ of stars in the chain.

翻译中…

Input

翻译中…

The first line contains an integer $*n*$ ($1 ≤ *n* ≤ 10^{5}$) — the number of stars. The second line contains simple fractions representing relationships "$*a*$/$*b*$ $*c*$/$*d*$", such that image and image ($0 ≤ *a*, *b*, *c*, *d* ≤ 10^{5}$; image; image; image). The given numbers $*a*$, $*b*$, $*c*$, $*d*$ are integers.

翻译中…

Next $*n*$ lines contain pairs of integers $*x*_{*i*}$, $*y*_{*i*}$ ($1 ≤ *x*_{*i*}, *y*_{*i*} ≤ 10^{5}$)— the stars' coordinates.

翻译中…

It is guaranteed that all stars have distinct coordinates.

翻译中…

Output

翻译中…

In a single line print number $*m*$ — the answer to the problem.

翻译中…

Note

翻译中…

In the sample the longest chain the Donkey can build consists of four stars. Note that the Donkey can't choose the stars that lie on the rays he imagines.

翻译中…

image

翻译中…

样例

Input #1
15
1/3 2/1
3 1
6 2
4 2
2 5
4 5
6 6
3 4
1 6
2 1
7 4
9 3
5 3
1 3
15 5
12 4
Output #1
4
InputCopy OutputCopy
题目信息
题号
249D
时间限制
2 s
内存限制
256 MB
标签
数据结构
动态规划
计算几何
数学
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。