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

AB = sorted([list(map(int, input().split())) for _ in range(N)])

ans = 0
honsu = 0

for a, b in AB:
    if M - honsu > b:
        ans += a * b
        honsu += b
    else:
        ans += a * (M - honsu)
        honsu += M - honsu
    if M == honsu:
        break

print(ans) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M list(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split AB = sorted([list(map(int, input().split())) for _ in range(N)]) AB sorted([list(map(int, input().split())) for _ in range(N)]) sorted [list(map(int, input().split())) for _ in range(N)] ans = 0 ans 0 honsu = 0 honsu 0 for a, b in AB:
    if M - honsu > b:
        ans += a * b
        honsu += b
    else:
        ans += a * (M - honsu)
        honsu += M - honsu
    if M == honsu:
        break a b AB if M - honsu > b:
        ans += a * b
        honsu += b
    else:
        ans += a * (M - honsu)
        honsu += M - honsu
     M - honsu > b M - honsu M honsu b ans += a * b ans a * b a b honsu += b honsu b ans += a * (M - honsu) ans a * (M - honsu) a M - honsu M honsu honsu += M - honsu honsu M - honsu M honsu if M == honsu:
        break M == honsu M honsu break print(ans) print ans ans += a * (M - honsu) a * (M - honsu) ans M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N honsu = 0 0 honsu AB = sorted([list(map(int, input().split())) for _ in range(N)]) sorted([list(map(int, input().split())) for _ in range(N)]) AB ans += a * b a * b ans honsu += b b honsu ans = 0 0 ans honsu += M - honsu M - honsu honsu
N, M = map(int, input().split())

AB = sorted([list(map(int, input().split())) for _ in range(N)])

ans = 0
honsu = 0

for a, b in AB:
    if M - honsu > b:
        ans += a * b
        honsu += b
    else:
        ans += a * (M - honsu)
        honsu += M - honsu
    if M == honsu:
        break

print(ans)
