n, m = map(int, input().split())
ab = sorted([tuple(map(int, input().split())) for i in range(n)])
i, ans = 0, 0
while ab[i][1] < m:
    m -= ab[i][1]
    ans += ab[i][1] * ab[i][0]
    i += 1
ans += ab[i][0] * m
print(ans) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m tuple(map(int, input().split())) for i in range(n) for i in range(n) i range(n) range n for i in range(n) tuple(map(int, input().split())) tuple map(int, input().split()) map int input().split() ().split () input split ab = sorted([tuple(map(int, input().split())) for i in range(n)]) ab sorted([tuple(map(int, input().split())) for i in range(n)]) sorted [tuple(map(int, input().split())) for i in range(n)] i, ans = 0, 0 i 0 ans 0 while ab[i][1] < m:
    m -= ab[i][1]
    ans += ab[i][1] * ab[i][0]
    i += 1 ab[i][1] < m ab[i][1] [i] ab i 1 m m -= ab[i][1] m ab[i][1] [i] ab i 1 ans += ab[i][1] * ab[i][0] ans ab[i][1] * ab[i][0] ab[i][1] [i] ab i 1 ab[i][0] [i] ab i 0 i += 1 i 1 ans += ab[i][0] * m ans ab[i][0] * m ab[i][0] [i] ab i 0 m print(ans) print ans ans += ab[i][1] * ab[i][0] ab[i][1] * ab[i][0] ans ab = sorted([tuple(map(int, input().split())) for i in range(n)]) sorted([tuple(map(int, input().split())) for i in range(n)]) ab i, ans = 0, 0 0 i ans += ab[i][0] * m ab[i][0] * m ans i += 1 1 i m = map(int, input().split()) map(int, input().split()) m n, m = map(int, input().split()) map(int, input().split()) n m -= ab[i][1] ab[i][1] m ans = 0, 0 0 ans
n, m = map(int, input().split())
ab = sorted([tuple(map(int, input().split())) for i in range(n)])
i, ans = 0, 0
while ab[i][1] < m:
    m -= ab[i][1]
    ans += ab[i][1] * ab[i][0]
    i += 1
ans += ab[i][0] * m
print(ans)