output_description: Print the minimum total number of attacks required to vanish the monster.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N H
      a_1 b_1
      :
      a_N b_N
attempt: import sys
  import heapq
  import re
  from itertools import permutations
  from bisect import bisect_left, bisect_right
  from collections import Counter, deque
  from fractions import gcd
  from math import factorial, sqrt, ceil
  from functools import lru_cache, reduce
  
  INF = 1 << 60
  MOD = 1000000007
  sys.setrecursionlimit(10**7)
  
  
  # UnionFind
  class UnionFind:
      def __init__(self, n):
          self.n = n
          self.parents = [-1] * n
  
      def find(self, x):
          if self.parents[x] < 0:
              return x
          else:
              self.parents[x] = self.find(self.parents[x])
              return self.parents[x]
  
      def union(self, x, y):
          x = self.find(x)
          y = self.find(y)
  
          if x == y:
              return
  
          if self.parents[x] > self.parents[y]:
              x, y = y, x
  
          self.parents[x] += self.parents[y]
          self.parents[y] = x
  
      def size(self, x):
          return -self.parents[self.find(x)]
  
      def same(self, x, y):
          return self.find(x) == self.find(y)
  
      def members(self, x):
          root = self.find(x)
          return [i for i in range(self.n) if self.find(i) == root]
  
      def roots(self):
          return [i for i, x in enumerate(self.parents) if x < 0]
  
      def group_count(self):
          return len(self.roots())
  
      def all_group_members(self):
          return {r: self.members(r) for r in self.roots()}
  
      def __str__(self):
          return "\n".join("{}: {}".format(r, self.members(r)) for r in self.roots())
  
  
  def is_prime(n):
      if n == 1:
          return False
      for i in range(2, int(n**0.5) + 1):
          if n % i == 0:
              return False
      return True
  
  
  # ワーシャルフロイド (任意の2頂点の対に対して最短経路を求める)
  # 計算量n^3 (nは頂点の数)
  def warshall_floyd(d, n):
      # d[i][j]: iからjへの最短距離
      for k in range(n):
          for i in range(n):
              for j in range(n):
                  d[i][j] = min(d[i][j], d[i][k] + d[k][j])
      return d
  
  
  # ダイクストラ
  def dijkstra_heap(s, edge, n):
      # 始点sから各頂点への最短距離
      d = [10**20] * n
      used = [True] * n  # True:未確定
      d[s] = 0
      used[s] = False
      edgelist = []
      for a, b in edge[s]:
          heapq.heappush(edgelist, a * (10**6) + b)
      while len(edgelist):
          minedge = heapq.heappop(edgelist)
          # まだ使われてない頂点の中から最小の距離のものを探す
          if not used[minedge % (10**6)]:
              continue
          v = minedge % (10**6)
          d[v] = minedge // (10**6)
          used[v] = False
          for e in edge[v]:
              if used[e[1]]:
                  heapq.heappush(edgelist, (e[0] + d[v]) * (10**6) + e[1])
      return d
  
  
  # 素因数分解
  def factorization(n):
      arr = []
      temp = n
      for i in range(2, int(-(-(n**0.5) // 1)) + 1):
          if temp % i == 0:
              cnt = 0
              while temp % i == 0:
                  cnt += 1
                  temp //= i
              arr.append([i, cnt])
  
      if temp != 1:
          arr.append([temp, 1])
  
      if arr == []:
          arr.append([n, 1])
  
      return arr
  
  
  # 2数の最小公倍数
  def lcm(x, y):
      return (x * y) // gcd(x, y)
  
  
  # リストの要素の最小公倍数
  def lcm_list(numbers):
      return reduce(lcm, numbers, 1)
  
  
  # リストの要素の最大公約数
  def gcd_list(numbers):
      return reduce(gcd, numbers)
  
  
  # 素数判定
  
  
  # limit以下の素数を列挙
  def eratosthenes(limit):
      A = [i for i in range(2, limit + 1)]
      P = []
  
      while True:
          prime = min(A)
  
          if prime > sqrt(limit):
              break
  
          P.append(prime)
  
          i = 0
          while i < len(A):
              if A[i] % prime == 0:
                  A.pop(i)
                  continue
              i += 1
  
      for a in A:
          P.append(a)
  
      return P
  
  
  # 同じものを含む順列
  def permutation_with_duplicates(L):
  
      if L == []:
          return [[]]
  
      else:
          ret = []
  
          # set（集合）型で重複を削除、ソート
          S = sorted(set(L))
  
          for i in S:
  
              data = L[:]
              data.remove(i)
  
              for j in permutation_with_duplicates(data):
                  ret.append([i] + j)
  
          return ret
  
  
  # ここから書き始める
  n, h = map(int, input().split())
  b = [0 for i in range(n)]
  a_max = 0
  for i in range(n):
      c, d = map(int, input().split())
      a_max = max(a_max, c)
      b[i] = d
  b.sort(reverse=True)
  for i in range(1, n):
      b[i] += b[i - 1]
  if a_max >= h or b[0] >= h:
      print(1)
  else:
      ans = -(-h // a_max)
      for i in range(n):
          if b[i] >= h:
              ans = min(ans, i + 1)
              break
          ans = min(ans, i + 1 - (-(h - b[i]) // a_max))
      print(ans)
  
problem_description: Statement
  
  You are going out for a walk, when you suddenly encounter a monster.
  Fortunately, you have N katana (swords), Katana 1, Katana 2, …, Katana N, and
  can perform the following two kinds of attacks in any order:
  
    * Wield one of the katana you have. When you wield Katana i (1 ≤ i ≤ N), the monster receives a_i points of damage. The same katana can be wielded any number of times.
    * Throw one of the katana you have. When you throw Katana i (1 ≤ i ≤ N) at the monster, it receives b_i points of damage, and you lose the katana. That is, you can no longer wield or throw that katana.
  
  The monster will vanish when the total damage it has received is H points or
  more. At least how many attacks do you need in order to vanish it in total?
samples: [{"input": "1 10\n    3 5", "output": "3\n    \n\nYou have one katana. Wielding it deals 3 points of damage, and throwing it\ndeals 5 points of damage. By wielding it twice and then throwing it, you will\ndeal 3 + 3 + 5 = 11 points of damage in a total of three attacks, vanishing\nthe monster.\n\n* * *"}, {"input": "2 10\n    3 5\n    2 6", "output": "2\n    \n\nIn addition to the katana above, you also have another katana. Wielding it\ndeals 2 points of damage, and throwing it deals 6 points of damage. By\nthrowing both katana, you will deal 5 + 6 = 11 points of damage in two\nattacks, vanishing the monster.\n\n* * *"}, {"input": "4 1000000000\n    1 1\n    1 10000000\n    1 30000000\n    1 99999999", "output": "860000004\n    \n\n* * *"}, {"input": "5 500\n    35 44\n    28 83\n    46 62\n    31 79\n    40 43", "output": "9"}]