n,h=gets.split.map(&:to_i)
swords=n.times.map{gets.split.map(&:to_i)}
swords.sort_by!{|a,b|10**9*b+a}.reverse!
max=0
swords.reverse.each{|ary|
  a,b=ary
  max=a if max<a
  ary << max
}
puts n.times.map{|i|
  a,b,c=swords[i]
  h-=b
  ret=i+1
  ret+=(h+c-1)/c if h>0
  ret
}.min