n,m = map(int,input().split())
energy = sorted([tuple(map(int,input().split())) for _ in range(n)])
ret = 0
ind = 0
while(m):
  a,b = energy[ind]
  if b > m:
    ret += a * m
    m = 0
  else:
    ret += a * b
    m -= b
  ind += 1
print(ret) n,m = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split m tuple(map(int,input().split())) for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) tuple(map(int,input().split())) tuple map(int,input().split()) map int input().split() ().split () input split energy = sorted([tuple(map(int,input().split())) for _ in range(n)]) energy sorted([tuple(map(int,input().split())) for _ in range(n)]) sorted [tuple(map(int,input().split())) for _ in range(n)] ret = 0 ret 0 ind = 0 ind 0 while(m):
  a,b = energy[ind]
  if b > m:
    ret += a * m
    m = 0
  else:
    ret += a * b
    m -= b
  ind += 1 m a,b = energy[ind] a energy[ind] energy ind b if b > m:
    ret += a * m
    m = 0
  else:
    ret += a * b
    m -= b
   b > m b m ret += a * m ret a * m a m m = 0 m 0 ret += a * b ret a * b a b m -= b m b ind += 1 ind 1 print(ret) print ret m = map(int,input().split()) map(int,input().split()) m a,b = energy[ind] energy[ind] a m = 0 0 m ret += a * m a * m ret ind = 0 0 ind m -= b b m n,m = map(int,input().split()) map(int,input().split()) n ind += 1 1 ind energy = sorted([tuple(map(int,input().split())) for _ in range(n)]) sorted([tuple(map(int,input().split())) for _ in range(n)]) energy ret = 0 0 ret ret += a * b a * b ret b = energy[ind] energy[ind] b
n,m = map(int,input().split())
energy = sorted([tuple(map(int,input().split())) for _ in range(n)])
ret = 0
ind = 0
while(m):
  a,b = energy[ind]
  if b > m:
    ret += a * m
    m = 0
  else:
    ret += a * b
    m -= b
  ind += 1
print(ret)