N, M = map(int, input().split())
shops = []
for _ in range(N):
    a, b = map(int, input().split())
    shops.append((a, b))
shops = sorted(shops, key=lambda s: s[0])
m = 0
total = 0
for a, b in shops:
    if m + b >= M:
        total += (M - m) * a
        break
    else:
        total += a * b
        m += b
print(total) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M shops = [] shops [] for _ in range(N):
    a, b = map(int, input().split())
    shops.append((a, b)) _ range(N) range N a, b = map(int, input().split()) a map(int, input().split()) map int input().split() ().split () input split b shops.append((a, b)) shops.append shops append (a, b) a b shops = sorted(shops, key=lambda s: s[0]) shops sorted(shops, key=lambda s: s[0]) sorted shops key=lambda s: s[0] key lambda s: s[0] s[0] s 0 s m = 0 m 0 total = 0 total 0 for a, b in shops:
    if m + b >= M:
        total += (M - m) * a
        break
    else:
        total += a * b
        m += b a b shops if m + b >= M:
        total += (M - m) * a
        break
    else:
        total += a * b
        m += b m + b >= M m + b m b M total += (M - m) * a total (M - m) * a M - m M m a break total += a * b total a * b a b m += b m b print(total) print total M = map(int, input().split()) map(int, input().split()) M m += b b m shops = sorted(shops, key=lambda s: s[0]) sorted(shops, key=lambda s: s[0]) shops total += (M - m) * a (M - m) * a total N, M = map(int, input().split()) map(int, input().split()) N total += a * b a * b total a, b = map(int, input().split()) map(int, input().split()) a m = 0 0 m total = 0 0 total b = map(int, input().split()) map(int, input().split()) b shops = [] [] shops
N, M = map(int, input().split())
shops = []
for _ in range(N):
    a, b = map(int, input().split())
    shops.append((a, b))
shops = sorted(shops, key=lambda s: s[0])
m = 0
total = 0
for a, b in shops:
    if m + b >= M:
        total += (M - m) * a
        break
    else:
        total += a * b
        m += b
print(total)
