Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02607 (python)

Fixed submission:
n=int(input())
L=[int(i) for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2!=0):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input)
L=[int(i) for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2==0):
    count+=1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input)
L=[i for i in input().split()]
count=0
for i in range(1,n+1,2):
  if(L[i-1]%2==0):
    count+=1
print(count)
Problem p02639 (python)

Fixed submission:
L=[int(x) for x in input().split(" ")]
print(L.index(0)+1)

Buggy submission (verdict: Runtime Error):
L=[int(x) for x in input().split(" ")
print(L.index(0)+1)
Problem p02639 (python)

Fixed submission:
line = list(map(int, input().split()))
cnt = 1
for num in line:
    if num == 0:
        print(cnt)
        exit()

    cnt+=1

Buggy submission (verdict: Runtime Error):
for num in range(0, 5, 1):
    x = int(input())
    if x == 0:
        print(num + 1)
        exit()
Problem p02675 (python)

Fixed submission:
N = input()

N = int(N[-1])

if N == 0 or N == 1  or N == 6  or N == 8 :
    print("pon")
elif N == 3:
    print("bon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
zzz

Buggy submission (verdict: Runtime Error):
N = int(input())

N = int(N[-1])

if N == 0 or N == 1  or N == 6  or N == 8 :
    print("pon")
elif N == 3:
    print("bon")
else:
    print("hon")
Problem p02830 (python)

Fixed submission:
n = int(input())
s,t = input().split()

# n = int(2)
# s,t = "ip cc".split()

out = ""

for i in range(n):
    out += s[i]
    out += t[i]

print(out)

Buggy submission (verdict: Runtime Error):
n = int(input())
s,t = input().split()

out = ""

for i in range(2):
    out += s[i]
    out += t[i]

print(out)

Buggy submission (verdict: Runtime Error):
n = input()
s,t = input().split()

out = ""

for i in range(2):
    out += s[i]
    out += t[i]

print(out)
Problem p03029 (python)

Fixed submission:
a,p = map(int, input().split())

# a,p = map(int, "1 3".split())


cnt = a * 3 + p

print(int(cnt/2))

Buggy submission (verdict: Runtime Error):
a,p = map(int, input().split())

cnt = a * 3

print(int(cnt/p))
Problem p03109 (python)

Fixed submission:
s = input()

# s = "2019/11/01"
yyyy = int(s[0:4])
mm = int(s[5:7])
dd = int(s[8:10])


if yyyy >= 2019 and mm >= 5:
    print("TBD")
else:
    print("Heisei")

Buggy submission (verdict: Runtime Error):
s = int(input())

# s = "2019/11/01"
yyyy = int(s[0:4])
mm = int(s[5:7])
dd = int(s[8:10])


if yyyy >= 2019 and mm >= 5:
    print("TBD")
else:
    print("Heisei")
Problem p03145 (python)

Fixed submission:
a,b,c = map(int, input().split())

print(int(a*b/2))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())

print(int(a*B/2))
Problem p03264 (python)

Fixed submission:
k = int(input())


if k%2 ==0:
    print(int((k/2)*(k/2)))
else:
    print(int(((k-1)/2)*((k+1)/2)))

Buggy submission (verdict: Runtime Error):
k = input()

if k%2 ==0:
    print((k/2)*(k/2))
else:
    print(((k-1)/2)*((k+1)/2))

Buggy submission (verdict: Runtime Error):
k = input()

if k%2 ==0:
    print((k/2)**2)
else:
    print(((k-1)/2)*((k+1)/2))
Problem p03280 (python)

Fixed submission:
a,b = map(int, input().split())

print(a*b-a-b +1)

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())

print(a*b a-b)
Problem p03292 (python)

Fixed submission:
lines = list(map(int, input().split()))

# lines = list(map(int, "1 6 3".split()))
lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(lines[2]-lines[1] + lines[1]-lines[0]  )

Buggy submission (verdict: Runtime Error):
lines = map(int, input().split())

# lines = list(map(int, "1 6 3".split()))
lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(lines[2]-lines[1] + lines[1]-lines[0]  )

Buggy submission (verdict: Runtime Error):
lines = map(int, input().split())
lines.sort()

cnt =0
for i in range(len(lines)):
    cnt += lines[2-i]

print(cnt)
Problem p03369 (python)

Fixed submission:
s = input()

cnt = s.count('o')

print(700 + 100 * cnt)

Buggy submission (verdict: Runtime Error):
s = input()

cnt = s.count('o')

print(s + 100 * cnt)
Problem p03385 (python)

Fixed submission:
s = input()
s = sorted(s)

if ''.join(s) == "abc":
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()

s = sorted()

if s == "abc":
    print("Yes")
else:
    print("No")
Problem p03469 (python)

Fixed submission:
s = input()


print(s[0:3] + '8' +s[4:10] )

Buggy submission (verdict: Runtime Error):
s = int(input())

print(s[0:3] + '8' +s[4:10] )
Problem p03485 (python)

Fixed submission:
import math
a, b = map(int, input().split())

print(math.ceil((a+b)/2))

Buggy submission (verdict: Runtime Error):
import pip._internal.models.target_python

a, b = map(int, input().split())

print(math.ceil((a+b)/2))
Problem p03547 (python)

Fixed submission:
a,b = input().split()

if ord(a) < ord(b):
    print("<")
elif ord(a) > ord(b):
    print(">")
else:
    print("=")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())

if ord(a) < ord(b):
    print("<")
elif ord(a) > ord(b):
    print(">")
else:
    print("=")
Problem p03671 (python)

Fixed submission:
line = list(map(int,input().split()))
line.sort()

print(line[0] + line[1])

Buggy submission (verdict: Runtime Error):
line = list(map(int,intput().split()))
line.sort()

print(line[0] + line[1])

Buggy submission (verdict: Runtime Error):
line = map(int, input().split())
line.sort()

print(line[0] + line[1])
Problem p03455 (python)

Fixed submission:
n = [int(i) for i in input().split()]

a = n[0]
b = n[1]

if (a % 2 == 0) or (b % 2 == 0):
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
N = int(input())

t = [0]
x = [0]
y = [0]
for i in range(N):
    l = [int(c) for c in input().split()]
    t.append(l[0])
    x.append(l[1])
    y.append(l[2])

for i in range(N-1):
    move = x[i+1]-x[i] + y[i+1]-y[i]
    time = t[i+1]-t[i]
    if time%2 ^ move%2 == 1 or time < move:
        print("No")
        exit()

print("Yes")
Problem p03238 (python)

Fixed submission:
n=int(input())
if n==1:
  print('Hello World')
else:
  A=int(input())
  B=int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
N=int(input())
list1=[]
for i in range(N):
  x1=list(map(int,input().split()))
  list1.append(x1)
flag=0
for i in range(101):
  for j in range(101):
    list2=[]
    for k in range(N):
      Hx=list1[k][2]+abs(list1[k][0]-i)+abs(list1[k][1]-j)
      list2.append(Hx)
    if len(set(list2))==1:
      list3=[0]
      for l in range(N):
         d=Hx-abs(list1[l][0]-i)-abs(list1[l][1]-j)
         list3.append(d)
      if min(list3)>=0:
         print(i,j,Hx)
         flag=1
      else:
        pass
    else:
      pass
    if flag==1:
      break
  if flag==1:
    break
Problem p03485 (python)

Fixed submission:
a,b=map(int,input().split())
x=(a+b)/2
if int(x)==x:
   print(int(x))
else :
   print(int(x)+1)

Buggy submission (verdict: Runtime Error):
import random
s=list(input())
t=list(input())
random.shuffle(s)
random.shuffle(t)
S=''.join(s)
T=''.join(t)
L=[S,T]
L.sort()
if T==S:
  print('No')
elif L[0]==S:
  print('Yes')
elif L[0]==T:
  print('No')
Problem p03486 (python)

Fixed submission:
s=list(input())
t=list(input())
S=''.join(sorted(s))
T=''.join(sorted(t)[::-1])
L=sorted([S,T])

if S==T:
  print('No')
else:
  if L[0]==S:
    print('Yes')
  else:
    print('No')

Buggy submission (verdict: Runtime Error):
s=input()
t=input()
s.sort()
T=t.sort()[::-1]
L=sort([s,T])

if s==T:
  print('No')
else:
  if L[0]==s:
    print('Yes')
  else:
    print('No')
Problem p03493 (python)

Fixed submission:
S1,S2,S3=map(int,input())
print(S1+S2+S3)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1]:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
flag=0

for x in range(100):
  for y in range(N):
    if  A[y]%2==0:
      A[y]=A[y]/2    
    else:
      print(x)
      flag=1
      break
  if flag==1:
    break

Buggy submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
flag=0

for x in range(100):
  for y in range(N):
    if  A[y]%2==0:
      A[y]=A[y]/2    
    else:
      print(x)
      flag=1
      break
  if flag==1:
    break
Problem p03494 (python)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
flag=0

for x in range(30):
  for y in range(N):
    if  A[y]%2==0:
      A[y]=A[y]/2    
    else:
      print(x)
      flag=1
      break
  if flag==1:
    break

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1]:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)
Problem p03495 (python)

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(len(l)):
  s+=l[i][1]
  
print(N-s)

Buggy submission (verdict: Runtime Error):
from collections import Counter
N,K=map(int,input().split())
A=list(map(int,input().split()))
x=Counter(A)
l=x.most_common(K)
s=0
for i in range(K):
  s+=l[i][1]
  
print(N-s)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
B=set(A)
for i in B:
  x=A.count(i)
  L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1]:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=list(map(int,input().split()))
L=[]
A.sort()
A.append(200001)
for i in range(N):
  if A[i]==A[i+1] or i==N-1:
    continue
  else:
    x=A.count(A[i])
    L.append(x)
L.sort(reverse=True)
S=0
for i in range(K):
  S+=L[i]
print(N-S)
Problem p03944 (python)

Fixed submission:
w,h,n=map(int,input().split())
xa=[0]
xb=[w]
ya=[0]
yb=[h]
for i in range(n):
  x1,y1,a1=map(int,input().split())
  if a1==1:
    xa.append(x1)
  elif a1==2:
    xb.append(x1)
  elif a1==3:
    ya.append(y1)
  elif a1==4:
    yb.append(y1)

if min(xb)<=max(xa) or min(yb)<=max(ya):
  print(0)
else:
  print((min(xb)-max(xa))*(min(yb)-max(ya)))

Buggy submission (verdict: Runtime Error):
w,h,n=map(int,input().split())
xa=[]
xb=[]
ya=[]
yb=[]
for i in range(n):
  x1,y1,a1=map(int,input().split())
  if a1==1:
    xa.append(x1)
  elif a1==2:
    xb.append(x1)
  elif a1==3:
    ya.append(y1)
  elif a1==4:
    yb.append(y1)

if min(xb)<=max(xa) or min(yb)<=max(ya):
  print(0)
else:
  print((min(xb)-max(xa))*(min(yb)-max(ya)))

Buggy submission (verdict: Runtime Error):
w,h,n=map(int,input().split())
xa=[]
xb=[]
ya=[]
yb=[]
for i in range(n):
  x1,y1,a1=map(int,input().split())
  if a1==1:
    xa.append(x1)
  elif a1==2:
    xb.append(x1)
  elif a1==3:
    ya.append(y1)
  elif a1==4:
    yb.append(y1)

if max(xb)<=max(xa) or max(yb)<=max(ya):
  print(0)
else:
  print((max(xb)-max(xa))*(max(yb)-max(ya)))
Problem p04044 (python)

Fixed submission:
N,L=map(int,input().split())
l=[]
for i in range(N):
  l.append(input())
  
l.sort()
print(''.join(l))

Buggy submission (verdict: Runtime Error):
L,N=map(int,input().split())
l=[]
for i in range(N):
  l.append(input())
  
l.sort()
print(''.join(l))

Buggy submission (verdict: Runtime Error):
L,N=map(int,input().split())
l=[]
for i in range(N):
  s=list(input())
  s.sort()
  a=''.join(s)
  l.append(a)
  
l.sort()
print(''.join(l))
Problem p03161 (python)

Fixed submission:
n,k = list(map(int, input().strip().split()))
step_array = list(map(int, input().strip().split()))
score_array = [0]
for i in range(0, n+1):
	for j in range(1, k+1):
		if i+j > n-1:
			break
		cost = abs(step_array[i] - step_array[i+j]) + score_array[i]
		if len(score_array) <= i+j:
			score_array.append(cost)
		elif(score_array[i+j]>cost):
			score_array[i+j] = cost
print(score_array[n-1])

Buggy submission (verdict: Runtime Error):
n,k = list(map(int, input().split()))
step_array = list(map(int, input().split()))
score_array = [0 for _ in range(10)]
for i in range(0, n+1):
	for j in range(1, k+1):
		if i+j > n-1:
			break
		cost = abs(step_array[i] - step_array[i+j]) + score_array[i]
		if( score_array[i+j] == 0 or score_array[i+j]>cost):
			score_array[i+j] = cost
print(score_array[n-1])

Buggy submission (verdict: Runtime Error):
n,k = list(map(int, input().split()))
step_array = list(map(int, input().split()))
score_array = [0 for _ in range(10)]
for i in range(0, n+1):
	for j in range(1, k+1):
		if i+j > n-1:
			break
		cost = abs(step_array[i] - step_array[i+j]) + score_array[i]
		if( score_array[i+j] == 0 or score_array[i+j]>cost):
			score_array[i+j] = cost
print(score_array[n-1])

Buggy submission (verdict: Runtime Error):
input = sys.stdin.readline
n,k = list(map(int, input().strip().split()))
step_array = list(map(int, input().strip().split()))
score_array = [0]
for i in range(0, n+1):
	for j in range(1, k+1):
		if i+j > n-1:
			break
		cost = abs(step_array[i] - step_array[i+j]) + score_array[i]
		if len(score_array) <= i+j:
			score_array.append(cost)
		elif(score_array[i+j]>cost):
			score_array[i+j] = cost
print(score_array[n-1])
Problem p02640 (python)

Fixed submission:
x,y = map(int,input().split())
flag = 0
for i in range (100):
  for j in range (100):
    if ((i+j == x) and(2*i+4*j == y)):
      print("Yes")
      flag = 1
if (flag == 0):
    print("No")

Buggy submission (verdict: Runtime Error):
x,y = map(int,input().split())
flag = 0
for i in range (100):
  for j in range (100):
    if ((i+j == x) and(2*i+4*j == y))  :
      print("Yes")
      flag = 1
if flag == 0:
print("No")
Problem p02664 (python)

Fixed submission:
t=input()
s = list(t)

# maemozi=''
# for i in range(len(t)):
#     if s[i]=='?':
#         if maemozi=='P':
#             s[i]='D'
#         else:
#             if i==len(t)-1:
#                 s[i]='D'
#             elif i==0:
#                 if s[i+1]=='D'or s[i+1]=='?':
#                     s[i]='P'
#                 else:
#                     s[i]='D'
#             else:
#                 if s[i+1]=='P':
#                     s[i]='D'
#                 else:
#                     s[i]='P'
#     maemozi=s[i]
for i in range(len(t)):
    if s[i]=='?':
        s[i]='D'

print("".join(s))

Buggy submission (verdict: Runtime Error):
t=input()
s = list(t)


for i in range(len(t)):
    if s[i]=='?':
        if maemozi=='P':
            s[i]='D'
        else:
            s[i]='P'
    maemozi=s[i]


print("".join(s))
Problem p02702 (python)

Fixed submission:
from collections import Counter
S = input()[::-1]
MOD = 2019

X = [0]
for i, s in enumerate(S):
    X.append((X[-1] + int(s) * pow(10, i, MOD)) % MOD)

C = Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
import sys
S = input()[::-1]
    
MOD=2019
X = [0]
for i, s in enumerate(S):
    X.append((X[-1]+int(s)*pow(10,i,MOD))%MOD)
    
c = collections.Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)

Buggy submission (verdict: Runtime Error):
import collections
import sys
S = input()[::-1]
if len(S)<=4:
    print(0)
    sys.exit()
    
MOD=2019
X = [0]
for i, s in enumerate(S):
    X.append((X[-1]+int(s)*pow(10,i,MOD))%MOD)
    
c = collections.Counter(X)
ans = 0
for v in C.values():
    ans += v * (v - 1) // 2
print(ans)
Problem p02780 (python)

Fixed submission:
n,k = map(int,input().split())
 
p = list(map(int,input().split()))
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (p[i] + 1)/2
 
res = 0
 
for i in range(n-k+1):
    res = max(res, s[i+k] - s[i])
    
print("{:.10f}".format(res))

Buggy submission (verdict: Runtime Error):
n, k= map(int,input().split())
ps = list(map(int, input().split()))
    
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (ps[i] + 1)/2
 
    
tmp=0
for i in range(len(res)-k):
    tmp=max(tmp, s[i+k] - s[i])

print("{:.10f}".format(tmp))

Buggy submission (verdict: Runtime Error):
import numpy
n, k= map(int,input().split())
ps = list(map(int, input().split()))
    
 
s = [0]*(n+1)
 
for i in range(n):
    s[i+1] = s[i] + (ps[i] + 1)/2
 
    
#res = numpy.cumsum(data2)
tmp=0
for i in range(len(res)-k):
    tmp=max(tmp, s[i+k] - s[i])

print("{:.10f}".format(tmp))

Buggy submission (verdict: Runtime Error):
import numpy
n, k= map(int,input().split())
ps = list(map(int, input().split()))
if k==1:
    ans=(1+pon[pon.index(max(pon))])/2
    print(ans)
    sys.exit()
    
# 数値を倍にする関数
def calc_double(n):
    return (n +1)/2
 
data2 = list(map(calc_double, ps))
res = numpy.cumsum(data2)
tmp=0
for i in range(len(res)-k):
    if res[i+k]-res[i] >=tmp:
        tmp=res[i+k]-res[i]

print(tmp)

Buggy submission (verdict: Runtime Error):
import numpy
n, k= map(int,input().split())
ps = list(map(int, input().split()))
pon=ps
i=1
for a in range(k-1):
    ps1 = numpy.roll(pon, -i)  # = np.ndarray([ x[1], x[2], ..., x[n-1], x[0] ])
    ps = ps + ps1
    i+=1

    
if not k==1:num=ps.tolist().index(ps[:-(k-1)].max())
ans=0
for a in range(k):
    ans+=sum(range(1,pon[num+a]+1))/pon[num+a]
    
print(ans)
Problem p02658 (python)

Fixed submission:
n = int(input())

a = list(map(int,input().split()))

if 0 in a:
    print(0)
    exit()

ans = 1
for i in range(n):
    ans = ans * a[i]

    if ans > 10 ** 18:
        print(-1)
        exit()
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())

a = list(map(int,input().split()))

ans = 1
for _ in range(n):
    if ans >= 10 ** 18:
        print(-1)
        exit()
    ans = ans * a[i]

print(ans)
Problem p02675 (python)

Fixed submission:
n = input()

if n[-1] == "3":
    print("bon")
elif n[-1] == "0" or n[-1] == "1" or n[-1] == "6" or n[-1] == "8":
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
n = int(input())

if n[-1] == 3:
    print("bon")
elif n[-1] == 0 or n[-1] == 1 or n[-1] == 6 or n[-1] == 8:
    print("pon")
else:
    print("hon")

Buggy submission (verdict: Runtime Error):
n = int(input())

if n[-1] == 3:
    print("bon")
elif n[-1] == 0 or n[-1] == 1 n[-1] == 6 n[-1] == 8:
    print("pon")
else:
    print("hon")
Problem p02678 (python)

Fixed submission:
from collections import deque
n,m = map(int,input().split())

b = [[] for i in range(n)]
for i in range(m):
    a=list(map(int,input().split()))
    b[a[1]-1].append(a[0])
    b[a[0]-1].append(a[1])
    
c = [-1 for i in range(n)]
c[0] = 0
q = deque([1])
now = 0
count = 0
while q:
    #print(c,q, now)
    count = count + 1
    if count > n:
        print("No")
        exit()
    now = q.popleft() - 1
    for i in range(len(b[now])):
        #count = count + 1
        #print(now+1, "=>", b[now][i])
        if c[b[now][i] - 1] == -1:
            q.append(b[now][i])
            c[q[-1] - 1] = now + 1
            #print(c)
            
#print(count)
print("Yes")
for i in range(1,len(c)):
    print(c[i])

Buggy submission (verdict: Runtime Error):
from collections import deque
n,m = map(int,input().split())

b = [[] for i in range(n)]
for i in range(m):
    a=list(map(int,input().split()))
    b[a[1]-1].append(a[0])
    b[a[0]-1].append(a[1])
    
c = [-1 for i in range(n)]
c[0] = 0
q = deque([1])
now = 0
count = 0
while q:
    print(c,q, now)
    count = count + 1
    if count > n:
        print("No")
        exit()
    now = q.popleft() - 1
    for i in range(len(b[now])):
        #count = count + 1
        #print(now+1, "=>", b[now][i])
        if c[b[now][i] - 1] == -1:
            q.append(b[now][i])
            c[q[-1] - 1] = now + 1
            #print(c)
            
#print(count)
print("Yes")
for i in range(1,len(c)):
    print(c[i])
Problem p02683 (python)

Fixed submission:
n,m,x =map(int,input().split())

a = []
c = []
for _ in range(n):
    a.append(list(map(int,input().split())))
    c.append(a[-1].pop(0))

#print(a,c)

ans = 10 ** 8

for i in range(1 << n):
    cost = 0
    check = True
    d = [0 for i in range(m)]
    for j in range(n):
        if i >> j & 1:
            cost += c[j]
            for i2 in range(m):
                d[i2] += a[j][i2]
            #print(i >> j,d)
    for k in range(m):
        if d[k] < x:
            check = False
    if check:
        ans = min(ans, cost)
    #print(d,cost,check)
    
if ans == 10 ** 8:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n,m,x =map(int,input().split())

a = []
c = []
for _ in range(n):
    a.append(list(map(int,input().split())))
    c.append(a[-1].pop(0))

#print(a,c)

ans = 10 ** 8

for i in range(1 << n):
    cost = 0
    check = True
    d = [0 for i in range(n)]
    for j in range(n):
        if i >> j & 1:
            cost += c[j]
            for i2 in range(n):
                d[i2] += a[j][i2]
            #print(i >> j,d)
    for k in range(n):
        if d[k] < x:
            check = False
    if check:
        ans = min(ans, cost)
    #print(d,cost,check)
    
if ans == 10 ** 8:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n,m,x =map(int,input().split())

a = []
c = []
for _ in range(n):
    a.append(list(map(int,input().split())))
    c.append(a[-1].pop(0))

#print(a,c)

ans = 10 ** 8

for i in range(1 << n):
    cost = 0
    check = True
    d = [0 for i in range(n)]
    for j in range(n):
        if i >> j & 1:
            cost += c[j]
            for i2 in range(n):
                d[i2] += a[j][i2]
            #print(i >> j,d)
    for k in range(n):
        if d[k] < x:
            check = False
    if check:
        ans = min(ans, cost)
    #print(d,cost,check)
    
if ans == 10 ** 8:
    print(-1)
else:
    print(ans)

Buggy submission (verdict: Runtime Error):
n,m,x =map(int,input().split())

a = []
c = []
for _ in range(n):
    a.append(list(map(int,input().split())))
    c.append(a[-1].pop(0))

#print(a,c)

ans = 10 ** 8

for i in range(1 << n):
    cost = 0
    check = True
    d = [0 for i in range(n)]
    for j in range(n):
        if i >> j & 1:
            cost += c[j]
            for i2 in range(n):
                d[i2] += a[j][i2]
            #print(i >> j,d)
    for k in range(n):
        if d[k] < x:
            check = False
    if check:
        ans = min(ans, cost)
    #print(d,cost,check)
    
if ans == 10 ** 8:
    print(-1)
else:
    print(ans)