n, m = map(int, input().split())

s = [tuple(map(int, input().split())) for _ in range(n)]
s.sort()

ans = 0
for a, b in s:
    ans += min(a*b, a*m)
    m -= b
    if m <= 0:
        break

print(ans) 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 s = [tuple(map(int, input().split())) for _ in range(n)] s [tuple(map(int, input().split())) for _ in range(n)] s.sort() s.sort s sort ans = 0 ans 0 for a, b in s:
    ans += min(a*b, a*m)
    m -= b
    if m <= 0:
        break a b s ans += min(a*b, a*m) ans min(a*b, a*m) min a*b a b a*m a m m -= b m b if m <= 0:
        break m <= 0 m 0 break print(ans) print ans s = [tuple(map(int, input().split())) for _ in range(n)] [tuple(map(int, input().split())) for _ in range(n)] s ans = 0 0 ans m -= b b m n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m ans += min(a*b, a*m) min(a*b, a*m) ans
n, m = map(int, input().split())

s = [tuple(map(int, input().split())) for _ in range(n)]
s.sort()

ans = 0
for a, b in s:
    ans += min(a*b, a*m)
    m -= b
    if m <= 0:
        break

print(ans)
