n, m = map(int, input().split())
drink = sorted([list(map(int, input().split())) for _ in range(n)])

ans = 0

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

ans = 0

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

print(ans)
