# frozen_string_literal: true

def show(x)
  puts x
end

def solve(n,h,bs,max_a)
  c = h-bs.reduce(:+)
  d = (c / max_a)
  bs.size + d + (c%max_a != 0 ? 1 : 0)
end

def read
  n, h = gets.split.map(&:to_i)
  xs = []
  n.times do
    xs << gets.split.map(&:to_i)
  end
  as, bs = xs.transpose
  max_a = as.max
  [n,h,bs.select {|i| i > max_a },max_a]
end

show solve *read

