#GD0000005. Thu gom nước tăng lực (Energy Drink Collector)

Thu gom nước tăng lực (Energy Drink Collector)

Energy Drink Collector

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

There are NN stores. Store ii sells at most BiB_i energy drinks at price AiA_i each. Buy exactly MM drinks with minimum total cost.

Input

The first line contains N,MN,M. Each of the next NN lines contains Ai,BiA_i,B_i.

Output

Print the minimum cost.

Subtasks

General constraints:

  • 1≤N,M≤1051 \le N,M \le 10^5.

  • 1≤Ai≤1091 \le A_i \le 10^9.

  • 1≤Bi≤1051 \le B_i \le 10^5.

  • ∑Bi≥M\sum B_i \ge M.

  • Subtask 1 (20 points): N,M≤20N,M \le 20, Ai≤100A_i \le 100

  • Subtask 2 (30 points): N,M≤2000N,M \le 2000, Ai≤106A_i \le 10^6

  • Subtask 3 (50 points): No additional constraints.

Examples

Input

2 5
4 9
2 4

Output

12

Explanation

Buy four drinks at price 22 and one at price 44. The total cost is 4⋅2+1⋅4=124\cdot2+1\cdot4=12.