let scanInt () = stdin.ReadLine() |> int
let scanInts () = stdin.ReadLine().Split() |> Array.map int
let scanIntML n = [ for i in 1..n -> scanInt () ]
let scanIntsML n = [ for i in 1..n -> scanInts () ]

// ceil 
let frceil a b = a/b + (if a % b = 0 then 0 else 1)

// 残高と3つ組を受け取り(残高,使用回数)を返却
let subFn tgt (point,nmax,bonus) =
  if (tgt >= point * nmax) // 最大数必要？
    then (max (tgt - point * nmax - bonus) 0, nmax)
  else (0, frceil tgt point)

// 再帰関数
let rec rfn tgt cnt lst =
  // printfn "%A %A %A" tgt cnt lst
  match (tgt, lst) with
    |0,_ -> cnt
    |_,[] -> -1 // ErrorValue
    |t,hd::tl ->
        let (ntgt,c) = subFn t hd
        rfn ntgt (cnt+c) tl

// main
let [|D;G|] = scanInts ()

scanIntsML D
|> List.mapi (fun i a -> ((i+1)*100, a.[0], a.[1])) // (point, num, bonus)
// |> List.sortBy (fun (p,n,b) -> (float (b+p*n))/(float n)) // sort by cost-performance
|> List.rev
|> rfn G 0
|> printfn "%d"