loop do
  n, m = gets.split.map(&:to_i)
  break if n == 0 && m == 0
  dps = n.times.map { gets.split.map(&:to_i) }
  dps = dps.sort_by { |(d, p)| p }
  while m > 0 && !dps.empty?
    d = dps[-1][0]
    if m >= d
      dps.pop
      m -= d
    else
      dps[-1][0] -= m
      m = 0
    end
  end
  p dps.map { |(d, p)| d * p }.reduce(0, :+)
end
