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

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 cmps
    print $ bf (g 66 cmps) [d,d-1..1] 66 0
    --
    let a = bsearch (\m -> (bf (g m cmps) [d,d-1..1] m 0) < go) (0,1001)
    print (a+1)
    return ()

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

-- n問以内で全完できる問題の得点を得点の大きい順で
g :: Int -> [((Int,Int),Int)] -> [((Int,Int),Int)]
g n cmps = sortBy (\((ia,pa),ca) ((ib,pb),cb)->compare ((fromIntegral cb) / (fromIntegral pb)) ((fromIntegral ca) / (fromIntegral pa)) ) $ filter ((<=n).snd.fst) cmps

-- n問で取れる最大の得点
bf :: [((Int,Int),Int)] -> [Int] -> Int -> Int -> Int
bf _ _ 0 a = a
bf [] is n a = bf2 is n a
bf (((i,p),cp):cmps) is n a = bf (g (n-p) cmps) (filter (/=i) is) (n-p) (a+cp)

bf2 [] _ a = a
bf2 (i:_) n a = a + n*100*i

-- [a,b) -> a .. f aがTrueとなる最大のa, f bはFalse
-- aとbは評価しないので、範囲が0..(n-1)のとき、(a,b)=(-1,n)で呼んで良い
bsearch bf (a,b)
    | a+1 == b = a
    | bf m  = bsearch bf (m,b)
    | True = bsearch bf (a,m)
    where m = (a + (b-a)`div`2)