let inf = 10101010101010
let () =
  Scanf.scanf "%d %d" @@ fun d g ->
  let pc = Array.init d (fun i -> Scanf.scanf " %d %d" (fun x y -> i, x, y))
    |> Array.to_list |> List.rev in

  Array.init (1 lsl d) (fun b ->
    let s', n' =
      List.fold_left (fun (s, n) (i, p, c) ->
        if b land (1 lsl i) <> 0 then begin
          (s + p * 100 * (i+1) + c, n + p)
        end else (s, n)) (0, 0) pc
    in
    let s, n =
      List.fold_left (fun (s, n) (i, p, c) ->
      if b land (1 lsl i) <> 0 then (s, n) else begin
        let u = 100 * (i+1) in
        let m = (g - s + u - 1) / u |> min (p-1) |> max 0 in
        (s + m * u, n + m)
      end) (s', n') pc in
    if s >= g then n else inf
  ) |> Array.fold_left min inf |> Printf.printf "%d\n"