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())
g = G//100
plist = [list() for _ in range(d)]
pp = []
pe = []
for i in range(d):
    p,C = map(int,input().split())
    c = C//100
    pp += [p]
    if p==1:
        pe += [i]
    plist[i] += [i+1]*(p-1)
    plist[i] += [i+1+c]

poli = [list() for _ in range(d)]
for i in range(d):
    poli[i] += [plist[i][0]]
    for j in range(pp[i]-1):
        poli[i] += [poli[i][j]+plist[i][j+1]]

import math
numli = []
for i in range(2**d):
    kari = 0
    nkanli = []
    karimon = 0
    for j in range(d):
        if (i>>j)&1 == 1:
            kari += poli[j][-1]
            karimon += pp[j]
        else:
            nkanli +=[j]
    if kari>=g:
        numli += [karimon]
    else:
        if nkanli == []:
            continue
        else:
            for k in range(len(nkanli)-1,-1,-1):
                if nkanli[k] in pe:
                    continue
                else:
                    if kari + poli[nkanli[k]][-2]>=g:
                        karimon += math.ceil((g-kari)/(nkanli[k]+1))
                        numli += [karimon]
                        break
                    else:
                        break
    

print(min(numli))

Solution (Python):
import itertools
D, G = map(int, input().split())
ans = 10000000000
list_pro = [list(map(int, input().split())) for _ in range(D)]
for ptr in itertools.product([0,1], repeat=D):
  cnt_pro = 0
  res = 0
  for i,k in enumerate(ptr):
    if k == 1:
      cnt_pro += list_pro[i][0]
      res += 100 * (i+1) * list_pro[i][0] + list_pro[i][1]
  if res < G:
    for j, l in enumerate(reversed(ptr)):
      if l == 0:
        for _ in range(list_pro[D-1-j][0]):
          if res >= G:
            break
          res += 100 * (D-j)
          cnt_pro += 1      
  if res >= G:
    ans = min(ans, cnt_pro)
print(ans)

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


d,g = list(map(int, input().split()))
pc = [None]*d
for i in range(d):
    pc[i] = tuple(map(int, input().split()))
pc = pc[::-1]
ans = float("inf")
for b in range(1<<d):
    nokori = g
    val = 0
    for i in range(d):
        if b>>i&1:
            nokori -= (pc[i][0]*100*(d-i) + pc[i][1])
            val += pc[i][0]
    
    if nokori>0:
        for j in range(d):
            if b>>j&1:
                continue
            if pc[j][0]*100*(j+1)>=nokori:
                tmp = nokori//(100*(d-j)) + int(nokori%(100*(d-j))>0)
                val += tmp
                nokori -= tmp*(100*(d-j))                    
            else:
                nokori -= (pc[j][0]*100*(d-j) + pc[j][1])
                val += pc[j][0]
            if nokori<=0:
                break
    ans = min(ans, val)
print(ans)

Solution (Python):
import sys
from itertools import *
from math import *
input=sys.stdin.readline
D, G = map(int, input().split())
probs = [list(map(int, input().split())) for _ in range(D)]
G2 = G
seq = tuple(range(D))
x=[]
for i in range(0,D+1):
    l=combinations(seq,i)
    for j in l:
        x.append(j)
x=tuple(x)

infty=100000

ans = infty
for cand in x:
    cnt = 0
    G=G2
    l=[0]*D
    for ind in cand:
        probpoint = (ind + 1) * 100
        G=G-(probpoint * probs[ind][0]+probs[ind][1])
        cnt = cnt + probs[ind][0]
        l[ind]=1
    
    for i in range(D-1,-1,-1):
        if G<=0:
            break
        elif l[i]==0:
            probpoint = (i + 1) * 100
            num=ceil(G/probpoint)
            if num<probs[i][0]:
                G=G-num*probpoint
                cnt=cnt+num
            
            break
    if G<=0:
        ans=min(ans,cnt)
print(ans)

Solution (Python):
d,g = map(int, input().split())
ps = []
cs = []
for i in range(d):
    p,c = map(int, input().split())
    ps.append(p)
    cs.append(c)
INF = 1 << 50
dp = [INF]*110000
dp[0] = 0
for k,(p,c) in enumerate(zip(ps,cs)):
    tmp = dp[:]
    for i in range(p+1):
        for j in range(g//100+1):
            if dp[j] == INF:continue
            if i < p:
                tmp[j+(k+1)*i] = min(dp[j+(k+1)*i], dp[j]+i)
            else:
                tmp[j+(k+1)*i+c//100] = min(dp[j+(k+1)*i+c//100], dp[j]+i)
    dp = tmp[:]
print(min(dp[g//100:]))

Solution (Python):
from itertools import product
import math
D, G = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(D)]

ans = []

for lst in product([0, 1], repeat=D):
    temp = 0
    cnt = 0
    max0 = -1
    p = 0
    for i, j in enumerate(lst):
        temp += (pc[i][0] * 100 * (i+1) + pc[i][1]) * j
        cnt += pc[i][0] * j
        if j == 0 and max0 < i: max0 = i
    if temp < G and max0 != -1:
        p = math.ceil((G - temp)/(100 * (max0 + 1)))
        if p < pc[max0][0]:
            cnt += p
            temp += p * 100 * (max0 + 1)
    if temp >= G: ans.append(cnt)

print(min(ans))

Solution (Python):
import sys,math,collections,itertools,copy
input = sys.stdin.readline

D,G=list(map(int,input().split()))
score = []
maxScore = []
maxS = []
for d in range(D):
    p,c=map(int,input().split())
    tmp = [(d+1)*100]*p
    tmp[-1]+=c
    score.append(tmp)
    maxScore.append(sum(tmp))
    maxS.append([p,sum(tmp)])


maxScore.sort()
tmp = 0
for idx,mS in enumerate(maxScore):
    tmp += mS
    if tmp >= G:
        max_num = idx+1
        break

choice = set(range(1,D+1))
ans = float('inf')
for ch in itertools.permutations(choice,max_num):
    times = 0
    total = 0
    flag = 0
    for ci in ch:
        if total + maxS[ci-1][1] <G:
            total += maxS[ci-1][1]
            times += maxS[ci-1][0]
        else:
            for sc in score[ci-1]:
                total += sc
                times += 1
                if total >= G:
                    ans = min(ans,times)
                    falg = 1
                    break
    if flag ==1:
        break
print(ans)

Solution (Python):
import sys,math,collections,itertools,copy
input = sys.stdin.readline

D,G=list(map(int,input().split()))
score = []
maxScore = []
cos_per = []
maxS = []
for d in range(D):
    p,c=map(int,input().split())
    tmp = [(d+1)*100]*p
    tmp[-1]+=c
    score.append(tmp)
    maxScore.append(sum(tmp))
    maxS.append([p,sum(tmp)])
    
    cos_per.append([d+1,d+1])

maxScore.sort()
tmp = 0
for idx,mS in enumerate(maxScore):
    tmp += mS
    if tmp >= G:
        max_num = idx+1
        break

tmp = 0
j=0
for i in range(len(maxScore)-1,-1,-1):
    j+=1
    tmp += maxScore[i]
    if tmp >= G:
        min_num = j
        break


choice = set(range(1,D+1))


 
 
 
 


ans = float('inf')
for ch in itertools.permutations(choice,max_num):
    times = 0
    total = 0
    flag = 0
    for ci in ch:
        if total + maxS[ci-1][1] <G:
            total += maxS[ci-1][1]
            times += maxS[ci-1][0]
        else:
            for sc in score[ci-1]:
                total += sc
                times += 1
                if total >= G:
                    ans = min(ans,times)
                    falg = 1
                    break
    if flag ==1:
        break
print(ans)

Solution (Python):
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


def main():
    D, G = read_values()
    P = [0] * D
    C = [0] * D
    for i in range(D):
        P[i], C[i] = read_values()
        
    dp = [0] * (sum(P) + 1)
    for i in range(2 ** D):
        A = [0 if (i >> k) & 1 else P[k] - 1 for k in range(D)]
        r = sum(P[k] if (i >> k) & 1 else 0 for k in range(D))
        t = sum(C[k] + P[k] * (k + 1) * 100 if (i >> k) & 1 else 0 for k in range(D))
        dp[r] = max(dp[r], t)
        for j in range(D - 1, - 1, -1):
            for k in range(1, A[j] + 1):
                r += 1
                t += (j + 1) * 100
                dp[r] = max(dp[r], t)
    for i in range(len(dp) - 1):
        dp[i + 1] = max(dp[i +1], dp[i])
    
    print(bisect.bisect_left(dp, G))


if __name__ == "__main__":
    main()

Solution (Python):
def dfs(i, sum, count, nokori):
    global ans
    if i == d:
        if sum < g:
            use = max(nokori)

            n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count)
            
    else:
        dfs(i+1, sum, count, nokori)
        dfs(i+1, sum + pc[i][0] * (i+1) * 100 + pc[i][1], count + pc[i][0], nokori - {i + 1})


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

ans = float("inf")

dfs(0, 0, 0, set(range(1, d+1)))
print(ans)

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

point = point[::-1]

ans = float("inf")
for bit in range(1<<d):
  total=0
  cnt=0
  for i in range(d):
    if (bit>>i)&1:
      total += (100*(d-i)*point[i][0]+point[i][1])
      cnt += point[i][0]
  if total >= g:
    ans = min(ans,cnt)
    continue
  for j in range(d):
    if (bit>>j)&1 == False:
      for k in range(point[j][0]):
        total += 100*(d-j)
        cnt += 1
        if total >= g:
          ans=min(ans,cnt)
          break
      break
print(ans)

Solution (Python):
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    D, G = NMI()
    pc = [NLI() for _ in range(D)]
    ans = 1000
    
    bit_len = D
    for i in range(2**bit_len):
        ls = [0 for _ in range(bit_len)]
        for j in range(bit_len):
            if (i >> j) & 1:
                ls[j] = 1
        
        point = 0
        solved = 0
        half_way = ""
        
        for n in range(D):
            if ls[n] == 1:
                solved += pc[n][0]
                point += pc[n][0]*100*(n+1) +pc[n][1]
            else:
                half_way = n
        
        if G > point:
            if half_way != "":
                remain = int(math.ceil((G-point)/((half_way+1)*100)))
                if remain <pc[half_way][0]:
                    solved += remain
                    ans = min(ans,solved)
        else:
            ans = min(ans,solved)
        
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    D, G, *PC = map(int, read().split())
    P = PC[::2]
    C = PC[1::2]

    ans = INF
    for mask in range(1 << D):
        problems = score = 0
        for i in range(D):
            if mask & (1 << i):
                problems += P[i]
                score += 100 * (i + 1) * P[i] + C[i]
            else:
                idx_max = i

        if score >= G:
            if ans > problems:
                ans = problems
            continue

        if score + 100 * (idx_max + 1) * (P[idx_max] - 1) >= G:
            problems += (G - score + 100 * (idx_max + 1) - 1) // (100 * (idx_max + 1))
            if ans > problems:
                ans = problems

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    D, G, *PC = map(int, read().split())
    P = PC[::2]
    C = PC[1::2]

    ans = INF
    for mask in range(1 << D):
        problems = score = 0
        available = [False] * D
        for i in range(D):
            if mask & (1 << i):
                problems += P[i]
                score += 100 * (i + 1) * P[i] + C[i]
            else:
                available[i] = True

        if score >= G:
            if ans > problems:
                ans = problems
            continue

        for i in range(D - 1, -1, -1):
            if not available[i]:
                continue
            if score + 100 * (i + 1) * P[i] + C[i] < G:
                problems += P[i]
                score += 100 * (i + 1) * P[i] + C[i]
            else:
                n = (G - score + 100 * (i + 1) - 1) // (100 * (i + 1))
                problems += n
                score += 100 * (i + 1) * n
                break

        if score >= G and ans > problems:
            ans = problems

    print(ans)
    return


if __name__ == '__main__':
    main()

Solution (Python):
D,G=map(int,input().split())
G/=100
P=[]
C=[]
for _ in range(D):
    x,y=map(int,input().split())
    P.append(x)
    C.append(y//100)

ans=10**9
for x in range(2**D):
    cost=0
    value=0
    for i in range(D):
        if (x>>i)%2==1:
            value += P[i]*(i+1) + C[i]
            cost += P[i]
    for i in range(D-1,-1,-1):
        if value >= G:
            break
        elif (x>>i)%2==0:
            for _ in range(P[i]-1):
                value += i+1
                cost += 1
                if value>=G:
                    break
    if value>=G:
        ans=min(ans,cost)
print(ans)

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

p = [0] * d
a = [0] * d
for i in range(d):
    q, c = map(int, input().split())
    a[i] = q * (i + 1) * 100 + c
    p[i] = q

n = len(a)

min_val = sum(p)
for i in range(1 << n):
    score = 0
    val = 0
    k = -1
    for j in range(n):
        if i >> j & 1:
            score += a[j]
            val += p[j]
        else:
            k = j
    r = g - score
    if r > 0:
        if r >= a[k]:
            continue
        else:
            l = math.ceil(r / ((k + 1) * 100))
            if l >= p[k]:
                continue
            val += l
    min_val = min(min_val, val)
print(min_val)

Solution (Python):


import math

d, g = map(int, input().split())

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

for i in range(2**d):
    ts = [False]*d
    score = 0
    tmp_sn = 0
    flg = True
    for j in range(d):
        if (i>>j)&1:
            ts[j] = True
            score += data[j][0]*100*(j+1)+data[j][1]
            tmp_sn += data[j][0]


    if score < g:
        for k in reversed(range(len(ts))):
            if  ts[k] == False:
                need = g - score
                s1 = (k+1) * 100
                nnum = math.ceil(need / s1)
                if nnum < data[k][0]:
                    tmp_sn += nnum
                    break
                else:
                    flg = False
                    break

    if flg == True and sn > tmp_sn:
        sn = tmp_sn

print(sn)

Solution (Python):
from collections import defaultdict

def main():
    D, G = map(int, input().split())
    problem = []
    for _ in range(D):
        p, c = map(int, input().split())
        problem.append([p,c])
    ans = float('inf')
    for i in range(2**D):
        all_solve = []
        others = []
        score = 0
        cnt = 0
        for j in range(D):
            if (i >> j) & 1:
                all_solve.append(j)
                cnt += problem[j][0]
                score += 100 * (j+1) * problem[j][0] + problem[j][1]
            else:
                others.append(j)
        if score >= G:
            ans = min(cnt,ans)
            continue

        others.sort(reverse=True)
        for k in others:
            for m in range(problem[k][0]):
                score += 100*(k+1)
                cnt += 1
                if score >= G:
                    ans = min(ans, cnt)
                    break
            else:
                score += problem[k][1]
                if score >= G:
                    ans = min(ans, cnt)
            if score >= G:
                break
        
        if score >= G:
            ans = min(ans, cnt)

        
    print(ans)    

if __name__ == "__main__":
    main()

Solution (Python):

D, G = map(int, input().split())
data = [list(map(int, input().split())) for i in range(D)]
ps, cs = zip(*data)
clear_cnt = D
min_prb = 1000
for i in range(1 << D):
    result = 0
    num_prb = 0
    not_selected_list = list()
    for j in range(D):
        if (i >> j & 1):
            result += ps[j] * 100 * (j+1) + cs[j]
            num_prb += ps[j]
        else:
            not_selected_list.append(j)
    if result < G:
        not_selected = max(not_selected_list)
        add_num_prb = min(ps[not_selected], -(-(G - result)//(100*(not_selected+1))) )
        num_prb += add_num_prb
        result += add_num_prb * (not_selected+1) * 100
    if result >= G:
        min_prb = min(min_prb, num_prb)
print(int(min_prb))

Solution (Python):
def min2(x,y):
    return x if x < y else y

from math import ceil
D, G = map(int, input().split())
P = []
C = []
for _ in range(D):
    p, c = map(int, input().split())
    P.append(p)
    C.append(c)
res = float("inf")
for bit in range(1<<D):
    temp = 0
    cnt = 0
    for i in range(D):
        if (bit>>i)&1:
            temp += 100*(i+1)*P[i]+C[i]
            cnt += P[i]
    if temp >= G:
        res = min2(res, cnt)
        continue
    for i in reversed(range(D)):
        if not (bit>>i)&1:
            k = ceil((G-temp)/(100*(i+1)))
            if k >= P[i]:
                temp += 100*(i+1)*(P[i]-1)
                cnt += P[i]-1
            else:
                cnt += k
                res = min2(res, cnt)
                break
print(res)

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

ans = float('inf')

for i in range(1 << d):
  count = 0
  sum = 0
  nokori = set(range(1, d+1))
  
  for j in range(d):
    if i & (1<<j):
      sum += pc[j][0] * (j+1) * 100 + pc[j][1]
      count += pc[j][0]
      nokori.discard(j+1)
      
  if sum < g:
    use = max(nokori)
    n = min(pc[use-1][0], -(-(g-sum)//(use*100)))
    count += n
    sum += n*use*100
    
  if sum >= g:
    ans = min(ans, count)

print(ans)

Solution (Python):
from itertools import product
max2 = lambda x,y: x if x > y else y
min2 = lambda x,y: x if x < y else y

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

pc = [tuple(map(int,input().split())) for _ in range(D)]
pc = [(p,c,100*i) for i,(p,c) in enumerate(pc, start=1)]
res = sum(p for p,c,k in pc)
for choice in product((True,False),repeat=D):
    t = sum(c+p*k for (p,c,k),f in zip(pc,choice) if f)
    steps = sum(p for (p,c,k),f in zip(pc,choice) if f)

    if t >= G:
        res = min2(res,steps)
        continue

    for (p,c,k),f in zip(reversed(pc), reversed(choice)):
        if not f:
            break

    if p*k+t >= G:
        steps += (G-t-1)//k + 1
        res = min2(res,steps)

print(res)

Solution (Python):
import itertools as itr

D,G=map(int, input().split())
p=[list(map(int, input().split()))  for _ in range(D)]
b=list(itr.product(range(2),repeat=D))

ans=float('INF')

for i in range(len(b)):
    temp=0
    pnt=0
    for j in range(D):
        if b[i][j]==1:
            temp+=p[j][0]
            pnt+=(j+1)*100*p[j][0]
            pnt+=p[j][1]

    if pnt>=G:
        ans=min(ans,temp)
        
    else:
        for j in range(D):
            if b[i][-j-1]==0:
                for k in range(p[-j-1][0]-1):
                    temp+=1
                    pnt+=(D-j)*100
                    if pnt>=G:  
                        ans=min(ans,temp)
                        break
                break
                
print(int(ans))

Solution (Python):
[D,G],*li = [list(map(int,i.split())) for i in open(0)]

ans = float('inf')

def dfs(i,ten,num,p):
    global ans
    if i==D:
        if ten >= G:
            ans = min(ans,num)
        else:
            for q in p:
                for r in range(li[q][0]):
                    ten += (q+1)*100
                    num += 1
                    if r==li[q][0]:
                        ten += li[q][1]
                    if ten >= G:
                        ans = min(ans,num)
                        break
                else:continue
                break
    else:
        dfs(i+1,ten+(i+1)*100*li[i][0]+li[i][1],num+li[i][0],p)
        dfs(i+1,ten,num,[i]+p)
dfs(0,0,0,[])
print(ans)

Solution (Python):
def ForBaseConvert(Roop,MaxD,Base):
    if all(type(TT) is int for TT in [Roop,MaxD,Base]):
        if Base>=2 and MaxD>=1:
            ConvertN = []
            while Roop>0:
                ConvertN.append(Roop%Base)
                Roop = Roop//Base

            BaseConv = [0]*(MaxD-len(ConvertN))+ConvertN[::-1]
            BaseSInd = [[] for TB in range(0,Base)]
            for TB in range(0,Base):
                BaseSInd[TB] = [SInd for SInd,SNum in enumerate(BaseConv) if SNum==TB]
            return BaseConv,BaseSInd
        else:
            return []
    else:
        return []

import math
D,G = (int(T) for T in input().split())
PCList = [[] for TD in range(0,D)]
MINSolve = 1000
for TD in range(0,D):
    PCList[TD] = [int(T) for T in input().split()]

for Roop in range(0,2**D):
    Failed = False
    BaseConv,BaseSInd = ForBaseConvert(Roop,D,2)
    Solve = 0
    Point = 0
    for TD in range(0,D):
        if BaseConv[TD]==1:
            Solve += PCList[TD][0]
            Point += (100*(TD+1)*PCList[TD][0])+PCList[TD][1]
    
    if len(BaseSInd[0])>0:
        Add = BaseSInd[0][-1]
        Ned = math.ceil(max(G-Point,0)/(100*(Add+1)))
        if Ned<=(PCList[Add][0]-1):
            Solve += Ned
            Point += 100*(Add+1)*Ned
     
    if Point>=G and Solve<MINSolve:
        MINSolve = Solve
print(MINSolve)

Solution (Python):
d,g=map(int,input().split())
g//=100
A=[]
for i in range(d):
    p,c=map(int,input().split())
    c//=100
    A.append([i+1, p, c])
ans=float("inf")

for bit in range(1<<d):
    now=0 ; mon=0
    for i in range(d):
        if bit>>i &1:
            now+=A[i][0]*A[i][1]+A[i][2]
            mon+=A[i][1]
    
    if now>=g:
        ans=min(ans,mon)
        continue
        
    for i in range(d-1,-1,-1):
        if bit>>i &1==0:
            for j in range(A[i][1]): 
                now+=A[i][0] ; mon+=1
                if now>=g:
                    ans=min(ans,mon)
                    continue
                else:
                    continue
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=sum(p)
for i in range(1<<d):
  a=[]
  cnt=0
  pt=0
  for j in range(d):
    if (i>>j)&1:
      pt+=p[j]*(j+1)*100+c[j]
      cnt+=p[j]
    else:a+=[(p[j],j+1)]
  if pt<g:
    j,k=a[-1]
    cnt+=(g-pt+k*100-1)//(k*100)
    pt+=k*100*j
  if pt>=g:ans=min(ans,cnt)
print(ans)

Solution (Python):
D,G = list(map(int,input().split()))
pc = []
for i in range(D):
    pc.append(list(map(int,input().split())))

scoreList = [0 for i in range(D)]

for i in range(D):
    scoreList[i] = (i + 1) * 100 * pc[i][0] + pc[i][1]

choiceList = [[] for i in range(2 ** D)]
for i in range(2 ** D):
    for j in range(D):
        choiceList[i].append(i // (2 ** j) % 2)

minCount = 10 ** 8
for choice in choiceList:
    score = 0
    count = 0
    for i in range(len(choice)):
        if choice[i] == 1:
            score += scoreList[i]
            count += pc[i][0]
    for j in range(D):
        countTmp = count
        extraScore = (j + 1) * 100 * pc[j][0]
        delta = G - score
        if delta < 0:
            countTmp = count
        elif delta == 0:
            countTmp = count
        elif delta > 0:
            if delta <= extraScore and choice[j] == 0:
                countTmp += delta // ((j + 1) * 100)
                if delta % ((j + 1) * 100) > 0:
                    countTmp += 1
            else:
                countTmp = 10 ** 8
        if countTmp < minCount:
            minCount = countTmp
print(minCount)

Solution (Python):
d, g = map(int, input().split())
point = [[int(x) for x in input().split()] for i in range(d)]

ans = 100000000
for i in range(2**d):
  sub = 0
  count = 0
  complete = [False]*d
  for j in range(d):
    if (i>>j)&1:
      complete[j] = True
      sub += 100*(j+1)*point[j][0]+point[j][1]
      count += point[j][0]
  for j in range(d-1, -1, -1):
    if sub >= g:
      break
    if complete[j]:
      continue
    c = min((g-sub-1)//(100*(j+1))+1, point[j][0])
    count += c
    sub += c*100*(j+1)
    if c == point[j][0]:
      sub += point[j][1]
  if ans > count:
    ans = count

print(ans)

Solution (Python):

import itertools
import math

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


ans = 100*d*100
for d in itertools.product([0, 1], repeat=d):
    ans_tmp = 0
    value = 0

    for i, j in enumerate(d):
        if j == 0:
            continue
        ans_tmp += pc[i][0]
        value += (i+1)*100*pc[i][0] + pc[i][1]

    iter_ = [[i, j] for i, j in enumerate(d)]
    
    for i, j in reversed(iter_):
        if j == 1:
            continue
        base = (i+1)*100

        shortage = g-value
        if g-value <= 0:
            break

        num = min(math.ceil(shortage/base), pc[i][0]-1)
        ans_tmp += num
        value += base*num
    
    
    if value >= g:
        ans = min(ans, ans_tmp)

print(ans)

Solution (Python):
import math

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

ans = float("inf")

for bit in range(1 << D):
    count = 0
    sum = 0
    rest = list(range(1, D+1))

    for i in range(D):
        if bit & (1 << i):
            sum += (i + 1) * pc[i][0] * 100 + pc[i][1]
            count += pc[i][0]
            rest.remove(i + 1)

    if sum < G:
        max_num = max(rest)
        n = min(pc[max_num - 1][0], math.ceil((G - sum) / (max_num * 100)))
        count += n
        sum += n * max_num * 100

    if sum >= G:
        ans = min(ans, count)

print(ans)

Solution (Python):
D, G = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(D)]

ans = float("inf")

for bit in range(1 << D):
    count = 0
    sum = 0
    rest = list(range(1, D+1))

    for i in range(D):
        if bit & (1 << i):
            sum += (i + 1) * pc[i][0] * 100 + pc[i][1]
            count += pc[i][0]
            rest.remove(i + 1)

    if sum < G:
        max_num = max(rest)
        n = min(pc[max_num - 1][0], -(-(G - sum) // (max_num * 100)))
        count += n
        sum += n * max_num * 100

    if sum >= G:
        ans = min(ans, count)

print(ans)

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

ans = float("inf")

for bit in range(1 << d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))

    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            nokori.discard(i + 1)

    
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100

    if sum >= g:
        ans = min(ans, count)

print(ans)

Solution (Python):
D, G = map(int, input().split())
PC = [list(map(int, input().split())) for i in range(D)]


points = []
patterns = []
    
def flagfun(flag):
    if len(flag) == D:
        patterns.append(flag)
        return
    
    flagfun(flag+'0')
    flagfun(flag+'1')
    
def index_pattern():
    flagfun('')
    idxes = []
    for pattern in patterns:
        tmp_idx = []
        for idx, flag in enumerate(pattern):
            if flag == '1':
                tmp_idx.append(idx)
        idxes.append(tmp_idx)
    return idxes

def culc_points():
    for i, scores in enumerate(PC):
        max_score = (i+1)*scores[0]*100 + scores[1]
        points.append([scores[0], max_score])

culc_points()

idxes = index_pattern()
count = 1000000

for idx in idxes:
    tmp_count = 0
    tmp_score = 0
    remain_idx = [i for i in range(D)]
    for i in idx:
        tmp_count += points[i][0]
        tmp_score += points[i][1]
        num_index = remain_idx.index(i)
        remain_idx.pop(num_index)
           
    if tmp_count >= count:
        continue
    
    if tmp_score >= G:
        count = tmp_count
        continue
    
    max_idx = remain_idx.pop(-1)
    for i in range(1, points[max_idx][0]):
        tmp_count += 1
        tmp_score +=(max_idx+1)*100
        if tmp_count >= count:
            break
            
        if tmp_score >= G:
            count = tmp_count
            break

print(count)