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. 



Sample input:
2 700
3 500
5 800


Sample output:
3

Submission status: Wrong Answer

Solution code:
d, g = map(int,input().split())
p = []
c = []
ans = float('inf')
cnt = 0
tmp = 0
for i in range(d):
  a,b=map(int,input().split())
  p.append(a)
  c.append(b)
p = p[::-1]
c = c[::-1]

for j in range(d):
  for k in range(p[j]):
    if k==p[j]-1:
      tmp+=c[j]
    tmp+=100*(d-j)
    cnt+=1
    if tmp>=g and ans>cnt:
      ans = cnt
      tmp = 0
      cnt = 0
      break
print(ans)

Submission status: Wrong Answer

Solution code:
d, g = map(int, input().split())
pc=[list(map(int, input().split())) for i in range(d)]
def S(x):
    score=0
    cost=0
    no_use=0
    
    b=str(format(x, '010b'))
    for i in range(1, d+1):
        if b[-i]=='1':
            score+=100*i*pc[i-1][0]+pc[i-1][1]
            cost+=pc[i-1][0]
        else:
            no_use=i-1
    if score<g:
        tmp=(g-score)//((no_use+1)*100)
        if tmp<pc[no_use][0]:
            if (g-score)%(no_use+1)==0:
                cost+=tmp
            else:
                cost+=tmp+1
        else:
            cost=10**9
   
    return cost    
ans=10**9
for x in range(1, 2**d+1):
        s=S(x)
        ans=min(ans, s)
print(ans)

Submission status: Wrong Answer

Solution code:
d, g = map(int, input().split())
pc=[list(map(int, input().split())) for i in range(d)]
def S(x):
    score=0
    cost=0
    no_use=0
    
    b=str(format(x, '010b'))
    for i in range(1, d+1):
        if b[-i]=='1':
            score+=100*i*pc[i-1][0]+pc[i-1][1]
            cost+=pc[i-1][0]
        else:
            no_use=i-1
    print(score)
    if score<g:
        tmp=(g-score)//((no_use+1)*100)
        if tmp<pc[no_use][0]:
            if (g-score)%(no_use+1)==0:
                cost+=tmp
            else:
                cost+=tmp+1
        else:
            cost=10**9
   
    return cost    
ans=10**9
for x in range(1, 2**d+1):
        s=S(x)
        ans=min(ans, s)
print(ans)

Submission status: Wrong Answer

Solution code:
D,G = map(int,input().split())
P = [0]
C = [0]

for x in range(0,D):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c)

answer = sum(P)

for x in range(1<<D):
    score = 0
    number = 0
    for i in range(1,D+1):
        if x & (1<<(i-1)) > 0:
            score += P[i]*i*100 + C[i]
            number += P[i]
    
    if score >= G:
        answer = min(answer,number)

    for i in range(D,0,-1):
        if x & (1<<(i-1)) == 0:
            n = (G-score)//(100*i)
            if n <= P[i]:
                score += 100*i*n
                number += n
            else:
                score += 100*i*P[i]
                number += P[i]
        if score >= G:
            answer = min(answer,number)
            break

print(answer)

Submission status: Wrong Answer

Solution code:
def solve():
    inf = 1 << 60
    D, G = map(int, input().split())
    p = [0]
    c = [0]
    for i in range(D):
        pi, ci = map(int, input().split())
        p.append(pi)
        c.append(ci)
    sump = sum(p)
    # dp[i][j] = 100i点の問題までで、j問解いて得られる最大の点数
    dp = [[-inf for j in range(sump+1)] for i in range(D+1)]
    dp[0][0] = 0
    for d in range(1,D+1):
        for i in range(sump+1):
            for j in range(p[d]+1):
                if i - j >= 0:
                    dp[d][i] = max(dp[d][i], dp[d-1][i])
                    if dp[d-1][i-j] >= 0:
                        if j != p[d]:
                            dp[d][i] = max(dp[d][i], dp[d-1][i-j] + 100*d*j)
                        else:
                            dp[d][i] = max(dp[d][i], dp[d-1][i-j] + 100*d*j+c[d])
        #print(dp)
    for i in range(sump):
        if dp[D][i] >= G:
            return i

print(solve())

Submission status: Wrong Answer

Solution code:
def solve():
    inf = 1 << 60
    D, G = map(int, input().split())
    p = [0]
    c = [0]
    for i in range(D):
        pi, ci = map(int, input().split())
        p.append(pi)
        c.append(ci)
    sump = sum(p)
    # dp[i][j] = 100i点の問題までで、j問解いて得られる最大の点数
    dp = [[-inf for j in range(sump+1)] for i in range(D+1)]
    dp[0][0] = 0
    for d in range(1,D+1):
        for i in range(sump+1):
            for j in range(p[d]+1):
                if i - j >= 0:
                    dp[d][i] = max(dp[d][i], dp[d-1][i])
                    if j != p[d]:
                        dp[d][i] = max(dp[d][i], dp[d-1][i-j] + 100*d*j)
                    else:
                        dp[d][i] = max(dp[d][i], dp[d-1][i-j] + 100*d*j+c[d])
        #print(dp)
    for i in range(sump):
        if dp[D][i] >= G:
            return i

print(solve())

Submission status: Wrong Answer

Solution code:
D, G = map(int, input().split())
prob = [list(map(int, input().split())) for i in range(D)]
tmp = 1e10

for i in range(1<<D):
    grade = 0
    cnt = 0
    judge = list(range(1, D+1))

    for j in range(D):
        if (i>>j & 1):
            grade += (100*(j+1)*prob[j][0] + prob[j][1])
            cnt += prob[j][0]
            judge[j] = 0

    if grade >= G and tmp > cnt:
        tmp = cnt

    num = prob[(max(judge))-1][0]

    if G > grade and num > int((G - grade)/(max(judge)*100)):
        cnt += int((G - grade)/(max(judge)*100))
        grade += (max(judge)*100)*int((G - grade)/(max(judge)*100))
        if tmp > cnt and grade >= G:
            tmp = cnt

print(tmp)

Submission status: Wrong Answer

Solution code:
D, G = map(int, input().split())
prob = [list(map(int, input().split())) for i in range(D)]
tmp = 100*10

for i in range(1<<D):
    grade = 0
    cnt = 0
    judge = list(range(1, D+1))

    for j in range(D):
        if (i>>j & 1):
            grade += (100*(j+1)*prob[j][0] + prob[j][1])
            cnt += prob[j][0]
            judge[j] = 0

    if grade >= G and tmp > cnt:
        tmp = cnt

    num = prob[(max(judge))-1][0]

    if G > grade and num > int((G - grade)/(max(judge)*100)):
        cnt += int((G - grade)/(max(judge)*100))
        grade += (max(judge)*100)*int((G - grade)/(max(judge)*100))
        if tmp > cnt and grade >= G:
            tmp = cnt

print(tmp)

Submission status: Wrong Answer

Solution code:
D, G = map(int, input().split())
prob = [list(map(int, input().split())) for i in range(D)]
tmp = 100*10

for i in range(1<<D):
    grade = 0
    cnt = 0
    judge = list(range(1, D+1))

    for j in range(D):
        if (i>>j & 1):
            grade += (100*(j+1)*prob[j][0] + prob[j][1])
            cnt += prob[j][0]
            judge[j] = 0

    if grade >= G and tmp > cnt:
        tmp = cnt

    num = prob[(max(judge))-1][0]

    if G > grade and num > int((G - grade) // (max(judge)*100)) - 1:
        cnt += int((G - grade) // (max(judge)*100)) - 1 
        if tmp > cnt:
            tmp = cnt

print(tmp)

Submission status: Wrong Answer

Solution code:
D, G = map(int, input().split())
prob = [list(map(int, input().split())) for i in range(D)]
tmp = 100*10

for i in range(1<<D):
    grade = 0
    cnt = 0
    judge = list(range(1, D+1))

    for j in range(D):
        if (i>>j & 1):
            grade += (100*(j+1)*prob[j][0] + prob[j][1])
            cnt += prob[j][0]
            judge[j] = 0

    if grade >= G and tmp > cnt:
        tmp = cnt

    num = prob[(max(judge))-1][0]

    if G > grade and num > int((G - grade)/(max(judge)*100)):
        cnt += int((G - grade) / (max(judge)*100))
        if tmp > cnt:
            tmp = cnt

print(tmp)

Submission status: Wrong Answer

Solution code:
d,g = map(int,input().split())
num = [list(map(int,input().split())) for i in range(d)]
lis = []
for i in range(1<<d):
    ind = [l for l in range(d)]
    cntT = 0
    cntA = 0
    for j in range(d):
        if (i>>j) & 1 == 1:
            cntT += num[j][0]
            cntA += num[j][0]*(j+1)* 100 + num[j][1]
            ind[j] = -1
    if cntA < g:
        s = min((g-cntA)//(100*(max(ind)+1)),num[max(ind)][0])
        cntA += s*(max(ind)+1)*100
        cntT += s
    if cntA >= g:
        lis.append(cntT)

print(min(lis))

Submission status: Wrong Answer

Solution code:
import math
D,G = map(int,input().split())
L = []
for i in range(D):
  L.append(list(map(int,input().split())))
n = 2
ans = float('inf')
def Base_10_to_n(X, n):
  if (int(X/n)):
      return Base_10_to_n(int(X/n),n)+str(X%n)
  return str(X%n)
for i in range(2**D):
  K = Base_10_to_n(i, n).zfill(D)
  S = 0
  sub = 0
  for j in range(D):
    if K[j] == '1':
      S += L[j][0]*100*(j+1)+L[j][1]
      sub += L[j][0]
  if S >= G:
    if sub <= ans:
      ans = sub
  else:
    cnt = 0
    for l in range(D):
      if cnt == 0:  
        if K[D-l-1] == '0':
          cnt = 1
          if G-S <= L[D-l-1][0]*100*(D-l)+L[D-l-1][1]:
            if G-S > L[D-l-1][0]*100*(D-l):
              if ans >= sub+L[D-l-1][0]:
                ans = sub+L[D-l-1][0]
            else:
              if ans >= sub+math.ceil((G-S)//(100*(D-l))):
                ans = sub+math.ceil((G-S)//(100*(D-l)))
print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

c = []

for i in range(a):
	c.append(list(map(int,input().split())))

ans = float('inf')

for i in range(1<<a):
	sc = 0
	co = 0
	for j in range(a):
		if i & (1<<j):
			sc += c[j][0]*(j+1)*100 + c[j][1]
			co += c[j][0]
	if sc >= b:
		ans = min(ans,co)
	else:
		for j in range(a)[::-1]:
			if i &(1<<j):
				continue
			else:
				for k in range(c[j][0]):
					sc += 100*(j+1)
					co += 1
					if sc >= b:
						break
				if sc >= b:
					break
		ans = min(ans,sc)

print(ans)

Submission status: Wrong Answer

Solution code:
a,b = map(int,input().split())

c = []

for i in range(a):
	c.append(list(map(int,input().split())))

ans = float('inf')

for i in range(1<<a):
	sc = 0
	co = 0
	for j in range(a):
		if i &(1<<j):
			sc += c[j][0]*(j+1)*100 + c[j][1]
			co += c[j][0]
	if sc >= b:
		ans = min(ans,co)

	else:
		for j in range(a)[::-1]:
			if i &(1<<j):
				continue
			for k in range(c[j][0]):
				sc += 100*(j+1)
				co += 1
				if sc >= b:
					break
			if sc >= b:
				break
		ans = min(ans,sc)

print(ans)

Submission status: Wrong Answer

Solution code:
a,b = list(map(int,input().split()))

c = []

for i in range(a):
	c.append(list(map(int,input().split())))

ans = float('inf')

for i in range(1<<a):
	sc = 0
	co = 0
	for j in range(a):
		if i &(1<<j):
			sc += c[j][0]*(j+1)*100 + c[j][1]
			co += c[j][0]
	if sc >= b:
		ans = min(ans,co)

	else:
		for j in range(a)[::-1]:
			if i &(1<<j):
				continue
			for k in range(c[j][0]):
				sc += 100*(j+1)
				co += 1
				if sc >= b:
					break
			if sc >= b:
				break
		ans = min(ans,sc)

print(ans)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (1 << i)):
                if temp_score * (problems[i] - 1) + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    # print(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
        if temp_sum >= goal:
            answer = min(answer, temp_ans)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (1 << i)):
                if temp_score * (problems[i] - 1) + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    # print(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
        if temp_sum >= goal:
            answer = min(answer, temp_ans)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (1 << i)):
                if temp_score * (problems[i] - 1) + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    print(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
        if temp_sum >= goal:
            answer = min(answer, temp_ans)
print(answer)

Submission status: Wrong Answer

Solution code:
d, g = map(int, input().split())
pList=[]
cList=[]
index=0
while index < d:
    p, c = map(int, input().split())
    pList.append(p)
    cList.append(c)
    index+=1


statusL=[0]*d
minQ=10000
sumS=0

def wantS(statusL, pList, cList):
    sumS=0
    index=0
    while index < len(statusL):
        sumS+=statusL[index]*(index+1)*100
        if statusL[index] == pList[index]:
            sumS+=cList[index]
        index+=1
    return sumS

def zentan(n, statusL, pList, cList, g, minQ):
    if n >= d:
        return minQ
    else:
        index=0
        while index < pList[n]+1:
            statusL[n] = index
            sumS = wantS(statusL, pList, cList)
            if sumS >= g:
                if sum(statusL) <= minQ:
                    minQ = sum(statusL)
                if len(statusL)==2:
                    pass
                else:
                    break
            minQ = zentan(n+1, statusL, pList, cList, g, minQ)
            index+=1
        return minQ


minQ = zentan(0, statusL, pList, cList, g, minQ)
print(minQ)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if bit & (2 ** i):
                if temp_score * (problems[i] - 1) + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (2 ** i)):
                if temp_score * (problems[i] - 1) + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & i):
                if temp_score * (problems[i] - 1) + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (1 << i)):
                if temp_score * (problems[i] - 1) + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (1 << i)):
                if temp_score * problems[i] + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i] - 1
                    temp_sum += temp_score * (problems[i] - 1)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (1 << i)):
                if temp_score * problems[i] + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                    break
                else:
                    temp_ans += problems[i]
                    temp_sum += temp_score * (problems[i] - 1)
print(answer)

Submission status: Wrong Answer

Solution code:
import math
length, goal = map(int, input().split(" "))
problems, bonus = [], []
for i in range(length):
    a, b = map(int, input().split(" "))
    problems.append(a)
    bonus.append(b)
problems = problems[::-1]
bonus = bonus[::-1]
answer = float("inf")
for bit in range(length ** 2):
    temp_ans = 0
    temp_sum = 0
    for i in range(length):
        temp_score = (length - i) * 100
        if bit & (1 << i):
            temp_ans += problems[i]
            temp_sum += bonus[i] + temp_score * problems[i]
    # print(bit, temp_ans, temp_sum)
    if temp_sum >= goal:
        answer = min(answer, temp_ans)
    else:
        for i in range(length):
            temp_score = (length - i) * 100
            if not(bit & (1 << i)):
                if temp_score * problems[i] + temp_sum >= goal:
                    temp_ans += int(math.ceil((goal - temp_sum) / temp_score))
                    answer = min(answer, temp_ans)
                else:
                    temp_ans += problems[i]
                    temp_sum += temp_score * problems[i]
print(answer)

Submission status: Wrong Answer

Solution code:
import itertools
import math

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())

ls = []
for i in itertools.product([0, 1], repeat=D):
    sum = 0
    ans = 0
    for j, x in enumerate(i):
        if x == 1:
            sum += c[j] + (100*(j+1))*p[j]
            ans += p[j]
    if sum >= G:
        ls.append(ans)
    else:
        for j, x in enumerate(i[::-1]):
            if x != 1:
                if math.ceil((G-sum)/(100*(D-j))) <= p[D-1-j] - 1:
                    ans += math.ceil((G-sum)/(100*(D-j)))
                    ls.append(ans)
                    break
                else:
                    sum += (100*(D-j))*(p[D-1-j] - 1)
                    ans += p[D-1-j] - 1
print(ls)

Submission status: Wrong Answer

Solution code:
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
ans = 1000
for i in range(1 << d):
    score = 0
    num = 0
    rest = 0
    for j in range(d):
        if ((i >> j) & 1) == 1:
            score += pc[j][0]*100*(j+1) + pc[j][1]
            num += pc[j][0]
        else:
            rest = j
    if score < g:
        need = (g-score)//(100*(rest+1))
        if need > pc[rest][0]-1:
            continue
        else:
            num += need
    ans = min(ans, num)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
D, G = [int(i) for i in input().split()]
data_ls = list()
for i in range(D):
    data_ls.append([int(i) for i in input().split()])
ps, cs = zip(*data_ls)

def search(cnt, sum, flg, rest_max):
    if sum >= G:
        return cnt
    if flg == len(data_ls):
        if sum + (ps[rest_max] - 1) * 100 * (rest_max + 1) >= G:
            return cnt + math.floor((G - sum) / (100 * (rest_max+1)))
        else:
            return 1e9
    cnt = min(search(cnt + ps[flg], sum + (ps[flg] * 100 * (flg+1) + cs[flg]), flg + 1, rest_max),
              search(cnt, sum, flg + 1, flg))
    return cnt

print(search(0,0,0,0))

Submission status: Wrong Answer

Solution code:
import math
D, G = [int(i) for i in input().split()]
data_ls = list()
for i in range(D):
    data_ls.append([int(i) for i in input().split()])
ps, cs = zip(*data_ls)

def search(cnt, sum, flg, rest_max):
    if sum > G:
        return cnt
    if flg == len(data_ls):
        if sum + (ps[rest_max] - 1) * 100 * (rest_max + 1) >= G:
            return cnt + math.floor((G - sum) / (100 * (rest_max+1)))
        else:
            return 1e9
    cnt = min(search(cnt + ps[flg], sum + (ps[flg] * 100 * (flg+1) + cs[flg]), flg + 1, rest_max),
              search(cnt, sum, flg + 1, flg))
    return cnt

print(search(0,0,0,0))

Submission status: Wrong Answer

Solution code:
import math
D,G = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(D)]
perf = [(pc[i][0]*100*(i+1)+pc[i][1]) for i in range(D)]
bitD=2**D - 1
MIN=0
for i in range(D):
    MIN+=pc[i][0]
for i in range(bitD):
    b = bin(i)
    b = b.lstrip("0b")
    blen=len(b)
    j=0
    for j in range(D-blen):
        b="0"+b
    blist=list(b)
    k=0
    flag=0
    briflag=0
    count=0
    d=0
    for k in range(D):
        I=D-1-k
        if blist[k]=="1":
            d+=perf[I]
            count+=pc[I][0]
            if G < d:
                briflag=1
                break
        else:
            if flag == 0:
                flag+=1
                zanindex = I
            else:
                pass
    if briflag == 1:
        MIN=min(count,MIN)
    else:
        zan = math.ceil((G-d)/(100*(zanindex+1)))
        count+=zan
        MIN=min(count,MIN)
print(MIN)

Submission status: Wrong Answer

Solution code:
D,G = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(D)]
count=0
for i in range(D):
    I = D-1-i
    All = pc[I][0]*100*(I+1)+pc[I][1]
    if G > All:
        G-=All
        count+=pc[I][0]
    elif G >= pc[I][0]*100*(I+1):
        count+=pc[I][0]
        break
    else:
        bubun = int(G/(100*(I+1)))
        count+=bubun
        break
print(count)

Submission status: Wrong Answer

Solution code:
D,G = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(D)]
count=0
for i in range(D):
    I = D-1-i
    All = pc[I][0]*100*(I+1)+pc[I][1]
    if G > All:
        G-=All
        count+=pc[I][0]
    elif G == All:
        count+=pc[I][0]
        break
    else:
        bubun = int(G/(100*(I+1)))
        count+=bubun
        break
print(count)