n, h =  gets.chomp.split.map(&:to_i)
s = Array.new(n){ gets.chomp.split.map(&:to_i) }

b = s.sort_by{|a,b,c| b}.reverse
a = b.map!.with_index{|a, i| a + [i]}.sort_by{|a,b,c| a}.reverse

x = a.first

c = 0
i = 0

while h > 0
  if i != x[2]
    if b[i][1] >= x[2]
      h -= b[i][1]
      c += 1
    end

    i += 1
  else
    if x[0] < x[1]
      h -= x[1]
      c += 1
    end

    d = (h + x[0] - 1) / x[0]
    h -= x[0] * d
    c += d
  end
end

puts c