n, m = map(int, input().split())
drink = [list(map(int, input().split())) for i in range(n)]
drink.sort()
ans = 0

for i, j in drink:
    if m != 0:
        if m >= j:
            ans += i * j
            m -= j
        else:
            ans += i * m
            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 i in range(n) for i in range(n) i range(n) range n for i in range(n) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split drink = [list(map(int, input().split())) for i in range(n)] drink [list(map(int, input().split())) for i in range(n)] drink.sort() drink.sort drink sort ans = 0 ans 0 for i, j in drink:
    if m != 0:
        if m >= j:
            ans += i * j
            m -= j
        else:
            ans += i * m
            break i j drink if m != 0:
        if m >= j:
            ans += i * j
            m -= j
        else:
            ans += i * m
            break m != 0 m 0 if m >= j:
            ans += i * j
            m -= j
        else:
            ans += i * m
            break m >= j m j ans += i * j ans i * j i j m -= j m j ans += i * m ans i * m i m break print(ans) print ans n, m = map(int, input().split()) map(int, input().split()) n m = map(int, input().split()) map(int, input().split()) m drink = [list(map(int, input().split())) for i in range(n)] [list(map(int, input().split())) for i in range(n)] drink ans += i * j i * j ans m -= j j m ans = 0 0 ans ans += i * m i * m ans
n, m = map(int, input().split())
drink = [list(map(int, input().split())) for i in range(n)]
drink.sort()
ans = 0

for i, j in drink:
    if m != 0:
        if m >= j:
            ans += i * j
            m -= j
        else:
            ans += i * m
            break

print(ans)