#[allow(unused_macros)]
macro_rules ! read_value {($ next : expr , ($ ($ t : tt ) ,* ) ) => {($ (read_value ! ($ next , $ t ) ) ,* ) } ; ($ next : expr , [$ t : tt ; $ len : expr ] ) => {(0 ..$ len ) . map (| _ | read_value ! ($ next , $ t ) ) . collect ::< Vec < _ >> () } ; ($ next : expr , chars ) => {read_value ! ($ next , String ) . chars () . collect ::< Vec < char >> () } ; ($ next : expr , usize1 ) => {read_value ! ($ next , usize ) - 1 } ; ($ next : expr , $ t : ty ) => {$ next () . parse ::<$ t > () . expect ("Parse error" ) } ; }
#[allow(unused_macros)]
macro_rules ! input_inner {($ next : expr ) => {} ; ($ next : expr , ) => {} ; ($ next : expr , $ var : ident : $ t : tt $ ($ r : tt ) * ) => {let $ var = read_value ! ($ next , $ t ) ; input_inner ! {$ next $ ($ r ) * } } ; }
#[allow(unused_macros)]
macro_rules ! input {(source = $ s : expr , $ ($ r : tt ) * ) => {let mut iter = $ s . split_whitespace () ; let mut next = || {iter . next () . unwrap () } ; input_inner ! {next , $ ($ r ) * } } ; ($ ($ r : tt ) * ) => {let stdin = std :: io :: stdin () ; let mut bytes = std :: io :: Read :: bytes (std :: io :: BufReader :: new (stdin . lock () ) ) ; let mut next = move || -> String {bytes . by_ref () . map (| r | r . unwrap () as char ) . skip_while (| c | c . is_whitespace () ) . take_while (| c |! c . is_whitespace () ) . collect () } ; input_inner ! {next , $ ($ r ) * } } ; }

#[allow(dead_code)]
struct PowerPermutation {
    n: usize,
    m: usize,
    arr: Vec<usize>,
}
#[allow(dead_code)]
impl PowerPermutation {
    fn new(n: usize, m: usize) -> Self {
        let arr = vec![0; m];
        PowerPermutation { n, m, arr }
    }
}
#[allow(dead_code)]
impl Iterator for PowerPermutation {
    type Item = Vec<usize>;
    fn next(&mut self) -> Option<Vec<usize>> {
        if self.arr[self.m - 1] >= self.n {
            return None;
        }
        let r = self.arr.clone();
        self.arr[0] += 1;
        for i in 0..self.m - 1 {
            if self.arr[i] == self.n {
                self.arr[i] = 0;
                self.arr[i + 1] += 1;
            } else {
                break;
            }
        }
        Some(r)
    }
}

#[allow(unused_macros)]
macro_rules ! min {($ a : expr $ (, ) * ) => {{$ a } } ; ($ a : expr , $ b : expr , $ (, ) * ) => {{std :: cmp :: min ($ a , $ b ) } } ; ($ a : expr , $ ($ rest : expr ) ,+ $ (, ) * ) => {{std :: cmp :: min ($ a , min ! ($ ($ rest ) ,+ ) ) } } ; }
#[allow(unused_macros)]
macro_rules ! chmin {($ base : expr , $ ($ cmps : expr ) ,+ $ (, ) * ) => {{let cmp_min = min ! ($ ($ cmps ) ,+ ) ; if $ base > cmp_min {$ base = cmp_min ; true } else {false } } } ; }

fn main() {
    input! {
        d: usize,
        g: i64,
        pc: [(i64, i64); d],
    }

    let mut ret = std::i64::MAX;
    for pp in PowerPermutation::new(2, d) {
        let mut sum = 0;
        let mut cnt = 0;
        for i in 0..d {
            if pp[i] == 1{
                sum += pc[i].1 + pc[i].0 * 100 * (i as i64 + 1);
                cnt += pc[i].0;
            }
        }
        if sum >= g {
            chmin!(ret, cnt);
            continue;
        }

        for i in (0..d).rev() {
            if pp[i] == 1 {
                continue;
            }
            let price = 100 * (i as i64 + 1);
            let tmp = (g - sum + price - 1) / price;
            if tmp < pc[i].0 {
                cnt += tmp;
                chmin!(ret, cnt);
            }
            break;
        }
    }

    println!("{}", ret);

}


Measured memory_bytes: 2096