Juicetin moonwalks into a donut shop. "Nice tori you got there," Juicetin compliments as he crouches before the shelf of chocolate donuts with rainbow sprinkles.

"Nice what?" Asked the shop owner.

"Bro you sell tori, how do you not know what a torus is?"

"You mean donuts? Who calls them tori?"

"Clearly you are not a topologist. A torus is a surface of revolution generated by revolving a circle in three-dimensional space about an axis that is coplanar to the circle. In topology, a torus is homeomorphic to the Cartesian product for two circles $ S^1 \times S^1 $. You can define a torus parametrically by $ x(\theta, \varphi) = (R + r\cos\theta) \cos\varphi $, $ y(\theta, \varphi) = (R + r\cos\theta) \sin\varphi $ and $ z(\theta, \varphi) = r\sin\theta $ with $ \theta, \varphi = [0,2\pi) $. The volume and the surface area of a torus are easily computed using Pappus's centroid theorem, giving $ A = (2\pi r)(2\pi R) = 4\pi^2 Rr $ and-"

"Stop speaking math symbols you degenerate."

"no u"

"no no u"

"no no u?" Juicetin takes out a tin of durian juice and threatens the shop owner. "Give me a discount on these donuts before I pour this onto your head!"

The shop owner had no choice but to give Juicetin a discount. The shop sells $ n $ types of donuts. Every donut has the same original price $ \$x $ and the same discounted price $ \$y $. Juicetin wants to purchase exactly $ a_i $ donuts of type $ i $. He can only buy one donut at a time. He can buy a donut of type $ i $ at the discounted price $ \$y $ if he has already bought a total of $ b_i $ donuts of any type, otherwise he pays the original price $ \$x $. Juicetin cannot buy more donuts of a type than necessary because he thinks that this is wasteful. Calculate for Juicetin the minimum amount of money (in dollars) he needs to spend to buy all the donuts he wants.

Input

The first line of input consists of three integers, $n, x$ and $y$.
The following $n$ lines of input consists of 2 integers: $a_i$ and $b_i$.

Output

Output an integer, the answer to the problem.

Constraints

$ 1 \le n \le 2 \cdot 10^5 $
$ 1 \le y \lt x \le 10^6$
$ 1 \le a_i, b_i \le 10^7 $

Sample Test Cases

Input Output
3 2 1
1 3
2 3
2 1
6
Click to copy.

Scoring: Per Subtask
Authored by s16f22 and s17r28
Appeared in 2021 Mini Competition 0