let () = Scanf.scanf "%d %d\n" @@ fun d g ->
  let pcs = Array.init d @@ fun _ ->
    Scanf.scanf "%d %d\n" @@ fun p c -> p, c in
  let n = Array.fold_left ( + ) 1 (Array.map fst pcs) in
  let dp = Array.make n 0 in
  Array.iteri (fun i (p, c) ->
    for j = n - 1 downto 0 do
      dp.(j) <-
        Array.fold_left max min_int @@ Array.init (p + 1) @@ fun k ->
        try dp.(j - k) + 100 * (i + 1) * k + if k = p then c else 0 with _ -> min_int
    done) pcs;
  try
    for i = 0 to n - 1 do
      if g <= dp.(i) then (Printf.printf "%d\n" i; raise Not_found)
    done
  with Not_found -> ()