Problem:
 Score : 300 points    Problem Statement A programming competition site AtCode provides algorithmic problems.
Each problem is allocated a score based on its difficulty.
Currently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.
These p_1 + … + p_D problems are all of the problems available on AtCode.  A user of AtCode has a value called total score .
The total score of a user is the sum of the following two elements:   Base score: the sum of the scores of all problems solved by the user.  Perfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D) .   Takahashi, who is the new user of AtCode, has not solved any problem.
His objective is to have a total score of G or more points.
At least how many problems does he need to solve for this objective?      Constraints  1 ≤ D ≤ 10  1 ≤ p_i ≤ 100  100 ≤ c_i ≤ 10^6  100 ≤ G  All values in input are integers.  c_i and G are all multiples of 100 .  It is possible to have a total score of G or more points.         Input Input is given from Standard Input in the following format:  D  G  p_1  c_1  :  p_D  c_D       Output Print the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).        Sample Input 1 2 700
3 500
5 800      Sample Output 1 3  In this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100 -point problems is 500 points, and the perfect bonus for solving all the 200 -point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.  One way to achieve this objective is to solve four 200 -point problems and earn a base score of 800 points. However, if we solve three 100 -point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.       Sample Input 2 2 2000
3 500
5 800      Sample Output 2 7  This case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200 -point problems, and by solving two 100 -point problems additionally we have the total score of 2000 points.       Sample Input 3 2 400
3 500
5 800      Sample Output 3 2  This case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200 -point problems to achieve the objective.       Sample Input 4 5 25000
20 1000
40 1000
50 1000
30 1000
1 1000      Sample Output 4 66  There is only one 500 -point problem, but the perfect bonus can be earned even in such a case.

Solution (Python):
d,g = map(int,input().split())
P = [0]*d
C = [0]*d
for i in range(d):
    P[i],C[i] = map(int,input().split())

ans = float('inf')
bit_n = d
for i in range(2**d):
    tmp = 0
    solved = 0
    for j in range(d):
        if ((i>>j)&1):
            tmp+=C[j]
            tmp+=(j+1)*100*P[j]
            solved+=P[j]
    if tmp>=g:
        ans = min(ans,solved)
    else:
        for j in range(d-1,-1,-1):
            if tmp>=g:
                ans = min(ans,solved)
                break
            if not ((i>>j)&1):
                for k in range(P[j]):                 
                    if tmp>=g:
                        ans = min(ans,solved)
                        break
                    solved+=1
                    tmp+=(j+1)*100
print(ans)

Solution (Python):
import math

D, G = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(D)]

ret = 1000 ** 10
for i in range(2 ** D):
    total = 0
    cnt = 0
    for p in range(D):
        if (i >> p) & 1:
            cnt += lst[p][0]
            total += lst[p][0] * (p + 1) * 100 + lst[p][1]

    for p in range(D)[::-1]:
        delta = G - total
        if delta <= 0:
            break
        if not ((i >> p) & 1):
            n = min(math.ceil(delta / ((p + 1) * 100)), lst[p][0])
            cnt += n
            total += n * (p + 1) * 100
    ret = min(ret, cnt)
print(ret)

Solution (Python):
import math

d, g = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(d)]
ans = float('inf')

for i in range(2 ** d):
    sum = 0
    count = 0
    s = set(_ for _ in range(1, d + 1))
    for j in range(d):
        if (i >> j) & 1 == 1:
            sum += l[j][0] * (j + 1) * 100 + l[j][1]
            count += l[j][0]
            s.discard(j + 1)
    if sum < g:
        t = max(s)
        n = min(l[t - 1][0], math.ceil((g - sum) / (t * 100)))
        count += n
        sum += n * t * 100
    if sum >= g:
        ans = min(ans, count)
print(ans)

Solution (Python):
import math

D, G = map(int, input().split())
lst = [list(map(int, input().split())) for _ in range(D)]

ret = 1000 ** 10
for i in range(2 ** D):
    total = 0
    cnt = 0
    digit = 1
    for p in range(D):
        if (digit << p) & i:
            cnt += lst[p][0]
            total += lst[p][0] * (p + 1) * 100 + lst[p][1]

    for p in range(D)[::-1]:
        if not ((digit << p) & i):
            delta = max(0, G - total)
            n = min(math.ceil(delta / ((p + 1) * 100)), lst[p][0])
            cnt += n
            total += n * (p + 1) * 100
    ret = min(ret, cnt)
print(ret)

Solution (Python):
D,G=map(int,input().split())
PC=[list(map(int,input().split())) for i in range(D)]
ans=10**18
import math
for i in range(2**D):
  _i=i
  j=0
  s=[]
  _ans=0
  g=0
  while i>0:
    if i%2==1:
      _ans+=PC[j][0]
      g+=(PC[j][0]*100*(j+1)+PC[j][1])
      s.append(j)
    j+=1
    i=i//2
  if g>=G:
    ans=min(ans,_ans)
  else:
    j=D-1
    while j in s:
      j-=1
    if j>-1 and G-g<=(PC[j][0]-1)*100*(j+1):
      _ans+=math.ceil((G-g)/100/(j+1))
      ans=min(ans,_ans)
print(ans)

Solution (Python):
d, g = map(int,input().split())
data = [list(map(int,input().split())) for _ in range(d)]

def dfs(d, rest): 
    if d <= 0: return 10**9
    num, bonus = data[d-1] 
    
    use = min(rest//(d*100), num) 
    score = use * d * 100 
    if use == num: score += bonus 
    if rest - score > 0: 
        use += dfs(d-1, rest - score) 
    not_use = dfs(d-1, rest) 
    return min(use, not_use)

print(dfs(d, g))

Solution (Python):
def main():
    from itertools import product

    D, G = map(int, input().split())

    prob = []
    for j in range(1, D + 1):
        p, c = map(int, input().split())
        prob.append((j * 100, p, c))  

    ans = -1
    for prd in product([0, 1], repeat=D):
        cnt = 0
        g = 0
        for j, (score, amount, bonus) in zip(prd, prob):
            if j:
                cnt += amount
                g += score * amount + bonus

        if g < G:
            for j, (score, amount, bonus) in reversed(tuple(zip(prd, prob))):
                if (not j) and (score * amount >= G - g):
                    use = (G - g + score - 1) // score
                    cnt += use
                    g += score * use
                    break

        if (g < G) or (~ans and ans <= cnt): continue
        ans = cnt

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from collections import deque
d,g=map(int,input().split())
pc=[list(map(int,input().split())) for _ in range(d)]
ans=10**7
for i in range(2**d):
  cnt=0
  c=0
  l=deque([])
  for j in range(d):
    if (i>>j)&1:
      cnt+=(j+1)*100*pc[j][0]+pc[j][1]
      c+=pc[j][0]
      l.appendleft([1,j])
    else:
      l.appendleft([0,j])
  if cnt<g:
    for n,m in l:
      if n==0:
        if g-(cnt+pc[m][0]*(m+1)*100)<=0:
          if (g-cnt)%((m+1)*100)==0:     
            c+=(g-cnt)//((m+1)*100)
            cnt=g
          else:
            c+=(g-cnt)//((m+1)*100)+1
            cnt=g
        break
  if cnt>=g:
    ans=min(ans,c)
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [0]*d,[0]*d
for i in range(d): P[i],C[i] = map(int,input().split())
ans = 10**9
for bin in range(1<<d):
    cnt = tot = rest_max_bit = 0
    for i in range(d):
        if bin & 1<<i:
            t = (i + 1)*100
            tot += P[i]*t + C[i]
            cnt += P[i]
        else: rest_max_bit = i
    if tot < g:
        t = (rest_max_bit + 1)*100
        p = (g - tot + t - 1)//t
        if p >= P[rest_max_bit]: continue
        cnt += p
    ans = min(ans, cnt)
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [0]*d,[0]*d
for i in range(d): P[i],C[i] = map(int,input().split())
ans = 10**9
for bin in range(0, 1<<d):
    cnt = tot = 0
    rest_max_bit = -1
    for i in range(d):
        if bin & 1<<i:
            t = (i+1)*100
            tot += P[i]*t + C[i]
            cnt += P[i]
        else: rest_max_bit = i
    if tot < g:
        t = (rest_max_bit + 1)*100
        p = (g - tot + t - 1)//t
        if p >= P[rest_max_bit]: continue
        cnt += p
    ans = min(ans, cnt)
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [0]*d,[0]*d
for i in range(d): P[i],C[i] = map(int,input().split())
ans = 10**9
for bin in range(0, 1<<d):
    cnt = tot = 0
    rest_max_bit = -1
    for i in range(d):
        if bin & 1<<i:
            t = (i+1)*100
            tot += P[i]*t + C[i]
            cnt += P[i]
        else: rest_max_bit = i
    if tot >= g:
        ans = min(ans, cnt)
        continue
    if rest_max_bit < 0: continue
    t = (rest_max_bit+1)*100
    p = (g+t-tot-1)//t
    if p < P[rest_max_bit]: ans = min(ans, cnt + p)
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [0]*d,[0]*d
for i in range(d): P[i],C[i] = map(int,input().split())
ans = 10**9
for bin in range(0, 1<<d):
    cnt = tot = 0
    rest_max_bit = -1
    for i in range(d):
        if bin & 1<<i:
            t = (i+1)*100
            tot += P[i]*t + C[i]
            cnt += P[i]
        else: rest_max_bit = i
    if tot >= g:
        ans = min(ans, cnt)
        continue
    if rest_max_bit < 0: continue
    t = (rest_max_bit+1)*100
    rest_g = g - tot
    p = min(P[rest_max_bit]-1, (rest_g+t-1)//t) 
    if p*t >= rest_g: ans = min(ans, cnt + p)
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [0]*d,[0]*d
for i in range(d): P[i],C[i] = map(int,input().split())
ans = 10**9
for bin in range(1, 1<<d):
    cnt = tot = 0
    for i in range(d):
        if bin & 1<<i:
            cnt += P[i]
            tot += P[i]*(i+1)*100 + C[i]
    if tot < g: continue
    ans = min(ans, cnt)
    for i in range(d):
        if bin & 1<<i:
            t = (i+1)*100
            rest_g = g - (tot - P[i]*t - C[i])
            p = max(0, (rest_g+t-1)//t) 
            ans = min(ans, cnt - (P[i] - p))
print(ans)

Solution (Python):
d,g = map(int,input().split())
g //= 100
P,C = [0]*d,[0]*d
for i in range(d):
    P[i],C[i] = map(int,input().split())
    C[i] //= 100
ans = 10**9
for bin in range(1, 1<<d):
    cnt = tot = 0
    for i in range(d):
        if bin & 1<<i:
            cnt += P[i]
            tot += P[i]*(i+1) + C[i]
    if tot < g: continue
    ans = min(ans, cnt)
    for i in range(d):
        if bin & 1<<i:
            rest_g = g - (tot - P[i]*(i+1) - C[i])
            p = max(0, (rest_g+i)//(i+1)) 
            ans = min(ans, cnt - (P[i] - p))
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [0]*d,[0]*d
for i in range(d): P[i],C[i] = map(int,input().split())
ans = 10**9
for bin in range(1, 1<<d):
    cnt = tot = 0
    for i in range(d):
        if bin & 1<<i:
            cnt += P[i]
            tot += P[i]*(i+1)*100 + C[i]
    if tot < g: continue
    ans = min(ans, cnt)
    for i in range(d):
        if bin & 1<<i:
            now_cnt = cnt
            now_tot = tot - C[i]
            for k in range(P[i]-1):
                now_cnt -= 1
                now_tot -= (i+1)*100
                if now_tot >= g: ans = min(ans, now_cnt)
print(ans)

Solution (Python):
d,g = map(int,input().split())
g //= 100
P,C = [],[]
for i in range(1, d+1):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c//100)
ans = 10**9
for bin in range(1, 1<<d):
    cnt = tot = 0
    for i in range(d):
        if bin & 1<<i:
            cnt += P[i]
            tot += P[i]*(i+1) + C[i]
    if tot < g: continue
    ans = min(ans, cnt)
    for i in range(d):
        if bin & 1<<i:
            rest_g = g - (tot - P[i]*(i+1) - C[i])
            p = max(0, (rest_g+i)//(i+1)) 
            ans = min(ans, cnt - (P[i] - p))
print(ans)

Solution (Python):
d,g = map(int,input().split())
g //= 100
P,C = [],[]
for i in range(1, d+1):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c//100)
ans = 10**9
for bin in range(1, 1<<d):
    cnt = tot = 0
    for j in range(d):
        if bin & 1<<j:
            cnt += P[j]
            tot += P[j]*(j+1) + C[j]
    if tot < g: continue
    ans = min(ans, cnt)
    for j in range(d):
        if bin & 1<<j:
            rest_g = g - (tot - P[j]*(j+1) - C[j])
            p = max(0, (rest_g+j)//(j+1)) 
            ans = min(ans, (cnt - P[j]) + min(p, P[j]))
print(ans)

Solution (Python):
d,g = map(int,input().split())
g //= 100
P,C = [],[]
for i in range(1, d+1):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c//100)
ans = 10**9


for bin in range(1, 1<<d):
    cnt = tot = 0
    for j in range(d):
        if bin & 1<<j:
            cnt += P[j]
            tot += P[j]*(j+1) + C[j]
    if tot < g: continue
    ans = min(ans, cnt)
    
    
    for j in range(d):
        if bin & 1<<j:
            init_cnt = cnt - P[j]
            init_tot = tot - (P[j]*(j+1) + C[j])
            rest_g = g - init_tot
            k = max(0, (rest_g+j)//(j+1)) 
            
            
            
            
            
            
            if k < P[j]:
                
                ans = min(ans, init_cnt + k)
                
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [],[]
for i in range(1, d+1):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c)
ans = 10**9
for bin in range(1, 1<<d):
    cnt = tot = 0
    for j in range(d):
        if bin & 1<<j:
            cnt += P[j]
            tot += P[j]*(j+1)*100 + C[j]
    if tot < g: continue
    ans = min(ans, cnt)
    for j in range(d):
        if bin & 1<<j:
            now_cnt = cnt
            now_tot = tot - C[j]
            for k in range(P[j]-1):
                now_cnt -= 1
                now_tot -= (j+1)*100
                if now_tot >= g: ans = min(ans, now_cnt)
print(ans)

Solution (Python):
d,g = map(int,input().split())
P,C = [],[]
for i in range(1, d+1):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c)
ans = 10**9
for bin in range(1, 1<<d):
    cnt = tot = 0
    for j in range(d):
        if bin & 1<<j:
            cnt += P[j]
            tot += P[j]*(j+1)*100 + C[j]
    if tot >= g: ans = min(ans, cnt)
    for j in range(d):
        if bin & 1<<j:
            now_cnt = cnt
            now_tot = tot - C[j]
            for k in range(P[j]-1):
                now_cnt -= 1
                now_tot -= (j+1)*100
                if now_tot >= g: ans = min(ans, now_cnt)
print(ans)

Solution (Python):
d, g = map(int, input().split())

p = []
c = []
for _ in range(d):
    P, C = map(int, input().split())
    p.append(P)
    c.append(C)

ans = 1e9
for i in range(2 ** d):
    sum_ = 0
    num = 0
    rest_max = -1
    for j in range(d):
        if ((i >> j) & 1):
            sum_ += 100 * (j + 1) * p[j] + c[j]
            num += p[j]
        else:
            rest_max = j
    if (sum_ < g):
        s1 = 100 * (rest_max + 1)
        need = (g - sum_ + s1 - 1) // s1
        if need >= p[rest_max]:
            continue
        num += need
    ans = min(ans, num)
print(ans)

Solution (Python):
import math

n, k = map(int, input().split())
pn = []
bp = []

for i in range(n):
    p, b = map(int, input().split())
    pn.append(p)
    bp.append(b)

res = 10**9

for i in range(1 << n):
    pnt = 0
    num = 0
    x = i ^ (2 ** n - 1)
    for j in range(n):
        if (i >> j) & 1 == 1:
            pnt += (j+1) * 100 * pn[j] + bp[j]
            num += pn[j]
    if pnt >= k:
        res = min(res, num)
    else:
        for l in range(n - 1, -1, -1):
            if (x >> l) & 1 == 1:
                d = min(pn[l], math.ceil((k - pnt)//100/(l + 1)))
                
                pnt += (l+1) * 100 * d
                num += d
                break
        if pnt >= k:
            res = min(res, num)
print(res)

Solution (Python):
d, g =map(int,input().split())
a = []
b = []
for i in range(d):
    p,c = map(int,input().split())
    a.append(p)
    b.append(c)
ans = float('inf')
for i in range(2**d):
    ten = 0
    mon = 0
    for j in range(d):
        if i>>j&1:
            ten += a[j]*((j+1)*100)+b[j]
            mon += a[j]
    if ten < g:
        for j in range(d):
            tenp = ten
            monp = mon
            if i>>j&1 == 0:
                for k in range(a[j]-1):
                    tenp += (j+1)*100
                    monp += 1
                    if tenp >= g:
                        ans = min(ans,monp)
    else:

        ans = min(ans,mon)
print(ans)

Solution (Python):
from itertools import product
import numpy as np

d, g = map(int, input().split())
p = np.empty(d, dtype=np.int64)
c = np.empty(d, dtype=np.int64)
for i in range(d):
    p[i], c[i] = map(int, input().split())

scores = np.array([p[i] * 100 * (i + 1) + c[i] for i in range(d)], dtype=np.int64)

ans = 10 ** 9
for permutation in product([0, 1], repeat=d):
    permutation = np.array(permutation, dtype=np.int64)
    score = np.inner(scores, permutation)
    problems = np.inner(p, permutation)
    if score >= g:
        ans = min(ans, problems)
    else:
        to_solve = np.max(np.where(permutation == 0))
        extra = -(-(g - score) // (100 * (to_solve + 1)))
        if extra < p[to_solve]:
            ans = min(ans, problems + extra)
print(ans)

Solution (Python):
D,G=map(int,input().split())
li=[list(map(int,input().split())) for _ in range(D)][::-1]
ans=float("inf")
for i in range(2**D):
  S=0
  cnt=0
  q="{:0>10b}".format(i)[::-1]
  ads=q.find("0")
  for j in range(D):
    if int(q[j])&1:
      S+=(D-j)*100*li[j][0]+li[j][1]
      cnt+=li[j][0]
  if S<G and (D-ads)*100*(li[ads][0]-1)>=G-S:
    for k in range(li[ads][0]):
      S+=(D-ads)*100
      cnt+=1
      if S>=G:
        break
  if S>=G:
    ans=min(ans,cnt)
print(ans)

Solution (Python):
d, g = map(int, input().split())
pc = [tuple(map(int, input().split())) for _ in range(d)]

ans = 10 ** 18
import itertools
for i in itertools.product([0, 1], repeat=d):
    point = 0
    num = 0
    
    for j in range(d):
        if i[j] == 1:
            num += pc[j][0]
            point += pc[j][1] + 100 * (j+1) * pc[j][0]
    
    
    for j in reversed(range(d)):
        if g <= point:
            break
        if i[j] == 0:
            c = (g - point) // (100 * (j+1))
            if c < pc[j][0]:
                num += c
                point += 100 * (j+1) * c
            else:
                num += pc[j][0] - 1
                point += 100 * (j+1) * (pc[j][0] - 1)
        
    
    if g <= point:
        ans = min(ans, num)
print(ans)

Solution (Python):
d, g = map(int, input().split())
pc = [tuple(map(int, input().split())) for _ in range(d)]

ans = 10 ** 18
import itertools
for i in itertools.product([0, 1], repeat=d):
    point = 0
    num = 0
    for j in range(d):
        if i[j] == 1:
            num += pc[j][0]
            point += pc[j][1] + 100 * (j+1) * pc[j][0]
    
    for j in reversed(range(d)):
        if g <= point:
            continue
        if i[j] == 0:
            c = (g - point) // (100 * (j+1))
            if c < pc[j][0]:
                num += c
                point += 100 * (j+1) * c
            else:
                num += pc[j][0] - 1
                point += 100 * (j+1) * (pc[j][0] - 1)
        
    
    if g <= point:
        ans = min(ans, num)
print(ans)

Solution (Python):
"""
i=7
bin_i=format(i,'b')
bin_i='0'+bin_i
print(bin_i)
"""
d,g=map(int,input().split())


p=[0]*d
c=[0]*d
res=pow(10,7)
"""
初期化パターン
p=[0]*d
"""
for i in range(d):
    p[i],c[i]=map(int,input().split())
    
    

for bit in range(1<<d):
    
    score=0
    num=0
    for i in range(d):
        if(bit & (1<<i)):
            score+=c[i]+p[i]*100*(i+1)
            num+=p[i]
    if(score>=g):
        res=min(res,num)
    else:
        for i in range(d-1,-1,-1):               
            if(bit & (1<<i)):
                continue
            for j in range(0,p[i]):
                if(score>=g):
                    break                    
                score+= 100*(i+1)
                num+=1
        res=min(res,num)
print(res)

Solution (Python):
D,G=map(int,input().split())
p=[]
c=[]
for i in range(D):
  p1,c1=map(int,input().split())
  p.append(p1)
  c.append(c1)
ans=sum(p)
for i in range(2**D):
  num=0
  point=0
  flag=[0]*D
  for j in range(D):
    if(i>>j&1):
      num+=p[j]
      flag[j]=1
      point+=(j+1)*100*p[j]+c[j]
  if(point<G):
    sitt=flag[::-1]
    loc=D-1-sitt.index(0)
    k=0
    while(point<G):
      num+=1
      k+=1
      point+=(loc+1)*100
    if(k<p[loc]):
      ans=min(ans,num)
  else:
    ans=min(ans,num)
  
print(ans)

Solution (Python):
d,g = map(int,input().split())
P = [0]*d
C = [0]*d
for i in range(d):
    P[i],C[i] = map(int,input().split())

ans = float('inf')
for i in range(2**d):
    tmp = 0
    res = 0
    for j in range(d):
        if ((i>>j)&1):
            tmp+=C[j]+(j+1)*100*P[j]
            res+=P[j]
    if tmp<g:
        for j in range(d-1,-1,-1):
            if not ((i>>j)&1):
                if tmp>=g:
                    break
                if tmp+(j+1)*100*P[j]<=g:
                    tmp+=(j+1)*100*P[j]
                    res+=P[j]
                else:
                    for p in range(P[j]):
                        if tmp>=g:
                            break
                        tmp+=(j+1)*100
                        res+=1
    ans = min(ans,res)
print(ans)

Solution (Python):
D,G = map(int,input().split())
questions = [list(map(int,input().split())) for _ in range(D)]
ans = float('inf')
for bit in range(1 << D):
  count = 0
  score = 0
  max_zero_index = 0
  for i in range(D):
    if (bit >> i) & 1:
      score += questions[i][0]*100*(i+1)+questions[i][1]
      count += questions[i][0]
    else:
      max_zero_index = i
  if score >= G:
    ans = min(count,ans)
  else:
    for _ in range(1,questions[max_zero_index][0]):
      count +=1
      score += 100*(max_zero_index+1)
      if score >= G:
        ans = min(count,ans)
print(ans)

Solution (Python):
D, G = map(int, input().split())
P = [0] * D
C = [0] * D
ans = float("inf")

for i in range(D):
    P[i], C[i] = map(int, input().split())

for bit in range(1 << D):
    score = 0
    cnt = 0
    unused = set(range(1, D+1))
    for i in range(D):
        if (bit >> i) & 1 == 1:
            cnt += P[i]
            score += 100 * (i + 1) * P[i] + C[i]
            unused.discard(i + 1)

    if score < G:
        use = max(unused)
        num = min(P[use - 1], -(-(G - score) // (use * 100)))
        cnt += num
        score += use * 100 * num

    if score >= G:
        ans = min(ans, cnt)

print(ans)

Solution (Python):
d,g=map(int,input().split())
pc=[list(map(int,input().split())) for i in range(d)]
ans=10**18
for i in range(2**d):
  t_point,t_solved=0,0
  for j in range(d):
    if i&(1<<j):
      t_solved+=pc[j][0]
      t_point+=pc[j][0]*(j+1)*100+pc[j][1]
  if t_point>=g:
    ans=min(ans,t_solved)
    continue
  
  j=d-1
  while j>=0:
    if i&(1<<j):
      j-=1
      continue
    p,c=pc[j]
    point=(j+1)*100
    if t_point+(p-1)*point<g:
      t_point+=(p-1)*point
      t_solved+=p-1
    else:
      husoku=g-t_point
      count=-(-husoku//point)
      t_point+=count*point
      t_solved+=count
    if t_point>=g:
      break
    j-=1
  else:
    continue
  if t_point>=g:
    ans=min(ans,t_solved)
print(ans)

Solution (Python):
d,g=map(int,input().split())
p=[0]*d
c=[0]*d

ans=10**9
for i in range(d):
    p[i],c[i]=map(int,input().split())
    
for i in range(2**d):
    score=0
    cnt=0
    com=-1
    for j in range(d):
        if ((i >> j) & 1):
            score+=100*(j+1)*p[j]+c[j]
            cnt+=p[j]
        else:
            com=j
 
    flg=0
    if score<g and com>=0:
        while p[com]>flg:
            score+=100*(com+1)
            flg+=1
            if score>=g:
                break
    if score>=g:
        cnt+=flg
        if ans>cnt:
            ans=cnt

print(ans)

Solution (Python):
d,g = map(int, input().split())

pc = [list(map(int, input().split())) for _ in range(d)]

ans=float('inf')
for bit in range(2**d):
    b = 0
    score = 0
    num = 0
    
    
    for i in range(d):
        if (bit >> i) & 1:
            
            score += pc[i][0] * (i+1) * 100 + pc[i][1]
            
            num += pc[i][0]
        else:
            
            
            b = i

    
    for j in range(pc[b][0]):
        if score>=g and num<ans:
            ans=num
        score+=(b+1)*100
        num+=1

print(ans)

Solution (Python):
import sys
from itertools import product

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    d, g = map(int, input().split())
    PC = []
    for i in range(d):
        p, c = map(int, input().split())
        PC.append([(i + 1) * 100, p, c])

    res = f_inf
    for pattern in product([0, 1], repeat=d):
        score = 0
        cnt = 0
        remain = []
        for idx, p in enumerate(pattern):
            if p == 1:
                point, num, bonus = PC[idx]
                score += point * num + bonus
                cnt += num
            else:
                remain.append(PC[idx])

        if score >= g:
            res = min(res, cnt)
        else:
            remain = sorted(remain, key=lambda x: x[0], reverse=True)
            diff = g - score
            for point, num, bonus in remain:
                if diff <= point * (num - 1):
                    cnt += diff // point + (1 if diff % point else 0)
                    res = min(res, cnt)
                    break
                else:
                    cnt += num - 1
                    score += point * (num - 1)

    print(res)


if __name__ == '__main__':
    resolve()

Solution (Python):
D,G=map(int, input().split())

L=[]
for i in range(D):
    p,c=map(int, input().split())
    L.append((p,c))

from itertools import permutations
from math import ceil
ans=float("INF")
for t in permutations(range(1,D+1)):
    
    t=list(t)
    now=G
    sub=0
    for x in t:
        p,c=L[x-1]
        if now/(x*100)<=p:
            sub+=ceil(now/(x*100))
            break
        elif x*p*100+c>=now:
            sub+=p
            break
        else:
            now-=x*p*100+c
            sub+=p

    
    ans=min(ans, sub)
    
print(ans)

Solution (Python):
from itertools import groupby, accumulate, product, permutations, combinations
def solve():
    ans = float('inf')
    D, G = map(int, input().split())
    P = [0]*D
    C = [0]*D
    for i in range(D):
        P[i],C[i] = map(int, input().split())
    for p in product([0,1],repeat=D):
        cnt = 0
        num = 0
        for i in range(D):
            if p[i]==1:
                cnt += 100*(i+1)*P[i]+C[i]
                num += P[i]
        if cnt<G:
            for i in range(D-1,-1,-1):
                if p[i]==0:
                    if (G-cnt+100*i)//(100*(i+1))<P[i]:
                        num += (G-cnt+100*i)//(100*(i+1))
                        break
            else:
                continue
        ans = min(ans,num)
    return ans
print(solve())

Solution (Python):
D, G = map(int, input().split())

PC = [tuple(map(int, input().split())) for _ in range(D)]

ans = 10 ** 9
for i in range(2 ** D): 
    score = 0
    problem = 0
    for j in range(D):
        if (i >> j) & 1:
            score += 100 * (j + 1) * PC[j][0] + PC[j][1]
            problem += PC[j][0]
    if score > G:
        continue
    left = G - score 
    for j in range(D):
        if (i >> j) & 1:
            continue
        if left > 100 * (j + 1) * PC[j][0] + PC[j][1]: 
            pass
        else:
            tmp = (left + (100 * (j + 1)) - 1) // (100 * (j + 1))
            ans = min(ans, problem + min(tmp, PC[j][0]))

print (ans)

Solution (Python):
import math
D,G = map(int,input().split())
p = []
c = []
for i in range(D):
  P,C = map(int,input().split())
  p.append(P)
  c.append(C)

res = float("inf")        
for i in range(2**D):
  bs = format(i,"0{}b".format(D))
  ans = 0
  cnt = 0
  
  for j in range(D):
    if bs[j] == "1":
      ans += (j+1)*100*p[j] + c[j]
      cnt += p[j]
  if ans >= G:
    res = min(cnt,res)
    continue

  
  for j in range(D-1,-1,-1):
    if bs[j] == "0":
      ans += (j+1)*100*(p[j]-1)
      cnt += (p[j]-1)
      if ans >= G:
        cnt -= (ans-G)//((j+1)*100)
        res = min(res,cnt)
        break
print(res)

Solution (Python):
D,G = map(int, input().split())
INF = 10**10

n = 2*10**5
dp = [INF] * n
dp[0] = 0
for i in range(1,D+1):
    p,c = map(int, input().split())
    c //= 100
    tmp = dp[:]
    for j in range(G//100+1):
        if tmp[j] == INF: continue
        for k in range(1,p+1):
            dp[j+i*k] = min(tmp[j]+k, dp[j+i*k])
        dp[j+i*p+c] = min(tmp[j]+p, dp[j+i*p+c])
ans = INF
for score in dp[G//100:]:
    if score == INF: continue
    ans = min(score, ans)
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():

    D, G = map(int, input().split())
    P, C = [0] * D, [0] * D
    for i in range(D):
        P[i], C[i] = map(int, input().split())
    ans = 10**10

    
    for i in range(2 ** D):
        checked = [False]*D
        pnt = 0
        cnt = 0

        for j in range(D):  
            if ((i >> j) & 1):  
                pnt += C[j]
                pnt += P[j]*(j+1)*100
                checked[j] = True
                cnt += P[j]
        if pnt < G:
            for k in reversed(range(D)):
                if not checked[k]:
                    prob_cnt = 0
                    br_fl = False

                    while prob_cnt < P[k]-1:
                        pnt += (k+1)*100
                        cnt += 1
                        prob_cnt += 1
                        if pnt >= G:
                            br_fl = True
                            break
                    if br_fl:
                        break
        if pnt >= G:
            ans = min(ans, cnt)

    print(ans)


resolve()

Solution (Python):
D, G = [int(s) for s in input().split()]
problems = [[int(s) for s in input().split()] for _ in range(D)]

result = 10 ** 8

for i in range(2 ** D):
    cnt_problem = 0
    cnt_score = 0
    for j in range(D):
        if i >> j & 1:
            cnt_score += problems[j][1] + 100 * (j + 1) * problems[j][0]
            cnt_problem += problems[j][0]

    for j in reversed(range(D)):
        if not i >> j & 1:
            for _ in range(problems[j][0]):
                if cnt_score >= G:
                    break
                else:
                    cnt_score += 100 * (j + 1)
                    cnt_problem += 1
    result = min(cnt_problem, result)

print(result)