import Control.Monad
import Data.List
import Data.Ord
import Data.Maybe

main=do
    [d,go]<-map read.words<$>getLine::IO[Int]
    pcs<-replicateM d $ map read.words<$>getLine:: IO [[Int]]
    -- 全完時のボーナス付きの得点
    let cmps = map f $ zip [1..] pcs
    --
    print.minimum.mapMaybe (g go cmps).flip (!!) d.iterate fts $ [[]]

fts s = concatMap (\x->map (x:) s) [True,False]

-- i問目の全完時の得点
f :: (Int,[Int]) -> (Int, Int)
f (i, (p:c:_)) = (p, p*i*100 + c)

-- (問題数, 全完得点) -> 使う -> 得点加算, 問題数加算
--                    -> 使わない -> 問題番号を更新
g go cmps ftx = g' go (zip [1..] cmps) ftx 0 0 0 0

g' :: Int -> [(Int,(Int,Int))] -> [Bool] -> Int -> Int -> Int -> Int -> Maybe Int -- 得点に達した場合の問題数
g' go [] [] pn psum lt lp
    | go <= psum = Just pn
    | go <= psum + (lt*lp*100) = Just (pn + ((go-psum+((lt*100-1)))`div`(lt*100)))
    | otherwise = Nothing
g' go ((i,(p,cp)):cmps) (ft:ftx) pn psum lt lp
    | ft = g' go cmps ftx (pn+p) (psum+cp) lt lp
    | otherwise = g' go cmps ftx pn psum i p
