output_description: Print the minimum amount of money with which Takahashi can buy M cans of
  energy drinks.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N M
      A_1 B_1
      A_2 B_2
      \vdots
      A_N B_N
attempt: N, M, *L = map(int, open(0).read().split())
  C = 0
  for a, b in sorted(zip(*[iter(L)] * 2)):
      C += a * min(M, b)
      M = max(M - b, 0)
  print(C)
  
problem_description: Statement
  
  Hearing that energy drinks increase rating in those sites, Takahashi decides
  to buy up M cans of energy drinks.
  
  There are N stores that sell energy drinks. In the i-th store, he can buy at
  most B_i cans of energy drinks for A_i yen (the currency of Japan) each.
  
  What is the minimum amount of money with which he can buy M cans of energy
  drinks?
  
  It is guaranteed that, in the given inputs, a sufficient amount of money can
  always buy M cans of energy drinks.
samples: [{"input": "2 5\n    4 9\n    2 4", "output": "12\n    \n\nWith 12 yen, we can buy one drink at the first store and four drinks at the\nsecond store, for the total of five drinks. However, we cannot buy 5 drinks\nwith 11 yen or less.\n\n* * *"}, {"input": "4 30\n    6 18\n    2 5\n    3 10\n    7 9", "output": "130\n    \n\n* * *"}, {"input": "1 100000\n    1000000000 100000", "output": "100000000000000\n    \n\nThe output may not fit into a 32-bit integer type."}]