n, m = map(int, input().split())
l = []
for i in range(n):
  a, b = map(int, input().split())
  l.append([a, b])
s = sorted(l, key=lambda x:x[0])
ans = 0
for i in range(n):
  a, b = s[i]
  if b <= m:
    ans += a*b
    m -= b
  else:
    ans += a*m
    break
print(ans) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m l = [] l [] for i in range(n):
  a, b = map(int, input().split())
  l.append([a, b]) i range(n) range n a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b l.append([a, b]) l.append l append [a, b] a b s = sorted(l, key=lambda x:x[0]) s sorted(l, key=lambda x:x[0]) sorted l key=lambda x:x[0] key lambda x:x[0] x[0] x 0 x ans = 0 ans 0 for i in range(n):
  a, b = s[i]
  if b <= m:
    ans += a*b
    m -= b
  else:
    ans += a*m
    break i range(n) range n a, b = s[i] a s[i] s i b if b <= m:
    ans += a*b
    m -= b
  else:
    ans += a*m
    break b <= m b m ans += a*b ans a*b a b m -= b m b ans += a*m ans a*m a m break print(ans) print ans a, b = s[i] s[i] a ans += a*m a*m ans n, m = map(int, input().split()) map(int, input().split()) n s = sorted(l, key=lambda x:x[0]) sorted(l, key=lambda x:x[0]) s b = map(int, input().split()) map(int, input().split()) b ans = 0 0 ans m -= b b m b = s[i] s[i] b a, b = map(int, input().split()) map(int, input().split()) a l = [] [] l m = map(int, input().split()) map(int, input().split()) m ans += a*b a*b ans
n, m = map(int, input().split())
l = []
for i in range(n):
  a, b = map(int, input().split())
  l.append([a, b])
s = sorted(l, key=lambda x:x[0])
ans = 0
for i in range(n):
  a, b = s[i]
  if b <= m:
    ans += a*b
    m -= b
  else:
    ans += a*m
    break
print(ans)