loop do
  m, n = gets.split.map(&:to_i)
  break if m == 0
  arr = m.times.map{ gets.split.map(&:to_i) }.sort_by{ |a| a[1] }
  n = arr.transpose[0].reduce(:+) - n
  res = 0
  arr.each do |a, b|
    break if n <= 0
    res += (n - a > 0 ? a : n) * b
    n -= a
  end
  p res
end