N,M = map(int, input().split())

tpls = []
for i in range(N):
    a,b = map(int, input().split())
    tpls.append((a, b))
tpls.sort()
need = 0
now = 0
idx = 0
while now < M:
    a, b = tpls[idx]
    if now + b > M:
        need += a * (M - now)
        now = M
    else:
        need += a*b
        now += b
    idx += 1
print(need) N,M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M tpls = [] tpls [] for i in range(N):
    a,b = map(int, input().split())
    tpls.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 tpls.append((a, b)) tpls.append tpls append (a, b) a b tpls.sort() tpls.sort tpls sort need = 0 need 0 now = 0 now 0 idx = 0 idx 0 while now < M:
    a, b = tpls[idx]
    if now + b > M:
        need += a * (M - now)
        now = M
    else:
        need += a*b
        now += b
    idx += 1 now < M now M a, b = tpls[idx] a tpls[idx] tpls idx b if now + b > M:
        need += a * (M - now)
        now = M
    else:
        need += a*b
        now += b
     now + b > M now + b now b M need += a * (M - now) need a * (M - now) a M - now M now now = M now M need += a*b need a*b a b now += b now b idx += 1 idx 1 print(need) print need need += a*b a*b need idx += 1 1 idx a, b = tpls[idx] tpls[idx] a M = map(int, input().split()) map(int, input().split()) M need += a * (M - now) a * (M - now) need now += b b now b = map(int, input().split()) map(int, input().split()) b tpls = [] [] tpls b = tpls[idx] tpls[idx] b now = M M now a,b = map(int, input().split()) map(int, input().split()) a need = 0 0 need N,M = map(int, input().split()) map(int, input().split()) N now = 0 0 now idx = 0 0 idx
N,M = map(int, input().split())

tpls = []
for i in range(N):
    a,b = map(int, input().split())
    tpls.append((a, b))
tpls.sort()
need = 0
now = 0
idx = 0
while now < M:
    a, b = tpls[idx]
    if now + b > M:
        need += a * (M - now)
        now = M
    else:
        need += a*b
        now += b
    idx += 1
print(need)