#P1493. 分梨子

分梨子

Description

There is a pear tree in Finley's yard, and it has recently produced many pears. Finley decides to pick some pears to distribute to the kindergarten children. However, the pears vary in size and taste, so it is important to choose pears that are as similar as possible to give to the kids, so that those who get smaller pears will not cry.

Each pear has two attributes, AiA_i and BiB_i, representing the pear's size and sweetness, respectively. Suppose among the selected pears, the minimum values of the two attributes are A0A_0 and B0B_0. As long as for every selected pear ii, the inequality C1×(AiA0)+C2×(BiB0)C3C_1 \times (A_i-A_0)+C_2 \times (B_i-B_0) \le C_3 holds (where C1,C2C_1,C_2 and C3C_3 are known constants), then these pears are considered similar enough and can be given to the children.

As the kindergarten principal, can you compute the maximum number of pears that can be selected?

Input Format

The first line contains an integer NN (1N20001 \le N \le 2000), the total number of pears.

The second line contains three positive integers, C1,C2C_1,C_2 and C3C_3 (C1,C22000C_1,C_2 \le 2000, C3109C_3 \le 10^9).

The next NN lines each contain two integers. On the ii-th line, the two integers are AiA_i and BiB_i.

Output Format

Output a single integer, the maximum number of pears that can be selected.

3
2 3 6
3 2
1 1
2 1

2

Hint

Sample explanation: You can choose pears 1,31,3 or 2,32,3.

Translated by ChatGPT 5