Rest Stops

Bessie rests at grass stops along a trail and must never fall behind Farmer John; maximize total tastiness of eaten grass.

Medium5GreedySortingPrefix sumMathInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

Farmer John and his personal trainer Bessie are hiking up Mount Vancowver. For this problem the mountain is one straight trail of length LL meters (1L1061 \le L \le 10^6). Farmer John hikes at a constant rate of rFr_F seconds per meter (1rF1061 \le r_F \le 10^6). He is working on his stamina, so he takes no rest along the way.

Bessie is allowed to rest, and at a rest stop she can eat tasty grass. Of course she cannot stop just anywhere. There are NN rest stops along the trail (1N1051 \le N \le 10^5). The ii-th stop is xix_i meters from the start of the trail (0<xi<L0 < x_i < L), and the grass there has tastiness cic_i (1ci1061 \le c_i \le 10^6). If Bessie rests at stop ii for tt seconds, she gains citc_i \cdot t tastiness units.

While she is not resting, Bessie travels at a constant rate of rBr_B seconds per meter (1rB1061 \le r_B \le 10^6). Bessie is young and fit, so rBr_B is strictly less than rFr_F.

The two of them leave the start of the trail at the same moment. Bessie wants to eat as much tasty grass as she can, but she worries about Farmer John. She thinks that if she is behind him on the trail at any moment of the hike, he might lose all motivation to continue.

Find the maximum total tastiness Bessie can obtain while making sure that Farmer John completes the hike.

Input

The first line contains four integers LL, NN, rFr_F, and rBr_B. The next NN lines describe the rest stops. For each ii between 11 and NN, the i+1i+1-st line contains two integers xix_i and cic_i, the position of the ii-th rest stop and the tastiness of the grass there.

It is guaranteed that rF>rBr_F > r_B and that 0<x1<<xN<L0 < x_1 < \dots < x_N < L. Note that rFr_F and rBr_B are given in seconds per meter.

Output

Print a single integer, the maximum total tastiness Bessie can obtain.

Hint

In the first example it is best for Bessie to rest 77 seconds at the stop at x=7x=7, which gives 1414 tastiness units, and then rest 11 more second at the stop at x=8x=8, which gives 11 more unit. The total is 1515.