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

Fixed submission:
from  fractions import gcd
N=int(input())
A=list(map(int,input().split()))
L=[0]
R=[0]
ans=1
for i in range(N-1):
    R.append(gcd(R[-1], A[-1-i]))
    L.append(gcd(L[-1], A[i]))
print(max(gcd(l,r)for l,r in zip(L,R[::-1])))

Buggy submission (verdict: Runtime Error):
import fractions
from functools import reduce
N=int(input())
A=set(map(int,input().split()))
l=[]
for i in A:
    if A-{i}!={}:
        l.append(reduce(fractions.gcd,A-{i}))
    else:
        l.append(i)
print(max(l))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
N=int(input())
A=set(map(int,input().split()))
l=[]
for i in A:
    l.append(reduce(math.gcd,A-{i},0))
print(max(l))

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce
N=int(input())
A=set(map(int,input().split()))
l=[]
for i in A:
    l.append(reduce(math.gcd,A-{i},0))
print(max(l))
Problem p03076 (python)

Fixed submission:
import math
lists=list(int(input()) for i in range(5))
modlists=list(lists[j]%10 for j in range(5))
x=set(modlists)
if 0 in x :
      x.remove(0)

      
else:
      x=set(modlists)
            
#a=list(set(modlists).remove(0) if 0 in modlists else set(modlists))
k=modlists.index(min(x)) if x else 0


b=0
for m in range(5):
      b+=math.ceil(lists[m]/10)*10
print(b-math.ceil(lists[k]/10)*10+lists[k])

Buggy submission (verdict: Runtime Error):
import math
lists=list(int(input()) for i in range(5))
modlists=list(lists[j]%10 for j in range(5))
x=set(modlists)
if 0 in x:
      x.remove(0)
else:
      x=set(modlists)
            
#a=list(set(modlists).remove(0) if 0 in modlists else set(modlists))
k=modlists.index(min(x))

b=0
for m in range(5):
      b+=math.ceil(lists[m]/10)*10
print(b-math.ceil(lists[k]/10)*10+lists[k])

Buggy submission (verdict: Runtime Error):
import math
lists=list(int(input()) for i in range(5))
modlists=list(lists[j]%10 for j in range(5))
a=set(modlists)
if 0 in modlists:
      a.remove(0)
else:
      a=set(modlists)
            
#a=list(set(modlists).remove(0) if 0 in modlists else set(modlists))
k=modlists.index(min(a))

b=0
for m in range(5):
      b+=math.ceil(lists[m]/10)*10
print(b-math.ceil(lists[k]/10)*10+lists[k])

Buggy submission (verdict: Runtime Error):
import math
lists=list(int(input()) for i in range(5))
modlists=list(lists[j]%10 for j in range(5))
a=set(modlists)
if 0 in modlists:
      a.remove(0)
            
#a=list(set(modlists).remove(0) if 0 in modlists else set(modlists))
k=modlists.index(min(a))

b=0
for m in range(5):
      b+=math.ceil(lists[m]/10)*10
print(b-math.ceil(lists[k]/10)*10+lists[k])
Problem p03087 (python)

Fixed submission:
N,Q=map(int,input().split())
S=input()
Sum=[0,0]
for i in range(1,N):
    if S[i-1]=='A'and S[i]=='C':
        Sum.append(Sum[-1]+1)
    else:
        Sum.append(Sum[-1])
for i in range(Q):
    l,r=map(int,input().split())
    print(Sum[r]-Sum[l])

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
Sum=[0,0]
for i in range(1,N+1):
    if S[i-1]=='A'and S[i]=='C':
        Sum.append(Sum[-1]+1)
    else:
        Sum.append(Sum[-1])
for i in range(Q):
    l,r=map(int,input().split())
    print(Sum[r]-Sum[l])

Buggy submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()
Sum=['']
for i in range(N):
    g=0 if i==0 else 1
    Sum.append(Sum[i]+S[i])
for i in range(Q):
    l,r=map(int,input().split())
    print(Sum[-1][l-1:r].count('AC'))
Problem p03161 (python)

Fixed submission:
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[0]*n
for i,I in enumerate(h):
    if i !=0:
        j=0 if i<k else i-k
        dp[i]=min(abs(I-p)+q for p,q in zip(h[j:i],dp[j:i]))
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
dp = [0] * n
a = list(map(int, input().split()))
for i, h in enumerate(a):
    if i != 0:
        g = 0 if i - k < 0 else i - k
        dp[i] = min([abs(h - d) + p for d, p in zip(a[g:i], s[g:i])])
print(s[-1])
Problem p03163 (python)

Fixed submission:
from numpy import *
N,W=map(int,input().split())
dp=zeros(W+1)
for i in range(N):
    w,v=map(int,input().split())
    dp[w:]=maximum(dp[w:],dp[:-w]+v)
print(int(max(dp)))

Buggy submission (verdict: Runtime Error):
from numpy import *
N,W=map(int,input().split())
dp=zeros(W+1)
for i in range(N):
    w,v=map(int,input().split())
    dp[w:]=maximum(dp[w:],dp[:-w]+v)
print(int(max(dp)))

Buggy submission (verdict: Runtime Error):
from numpy import *
N,W=map(int,input().split())
dp=zeros(W+1)
for i in range(N):
    w,v=map(int,input().split())
    dp[w:]=maximum(dp[w:],dp[:-w]+v)
print(int(max(dp)))
Problem p03417 (python)

Fixed submission:
N,M=map(int,input().split())
if N>=2 and M>=2:
    print((N-2)*(M-2))
elif max(N,M)>=2 and min(N,M)==1:
    print(max(N,M)-2)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split())
L=list([0]*M for _ in range(N))
if N>=2 and M>=2:
    print((N-2)*(M-2))
elif max(N,M)>=2:
    print(max(N,M)-2)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
from itertools  import product
N,M=map(int,input().split())
L=list([0]*M for _ in range(N))
if N>=2 and M>=2:
    print((N-2)*(M-2))
elif max(N,M)>=2:
    print(max(N,M)-2)
else:
    print(1)

Buggy submission (verdict: Runtime Error):
from itertools  import product
N,M=map(int,input().split())
L=list([0]*M for _ in range(N))
ans=0
for x in range(N):
    for y in range(M):
        count=0
        for dx,dy in list(product([-1,0,1],repeat=2)):
            if 0<=x+dx<=N-1 and 0<=y+dy<=M-1:
                count+=1
        if count%2==1:
            ans+=1
print(ans)
Problem p03495 (python)

Fixed submission:
from collections import Counter
N,K=map(int,input().split())
A=input().split()
B=Counter(A)
C=sorted(B.values(),reverse=True)
print(sum(C[K:]))

Buggy submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=collections.Counter(A).most_common()

print(sum(B[::-1][:K][i][1] for i in range(len(B[K:]))))

Buggy submission (verdict: Runtime Error):
import collections
N,K=map(int,input().split())
A=list(map(int,input().split()))
B=collections.Counter(A).most_common()

print(sum(B[::-1][:K][i][1] for i in range(len(B)-K)))
Problem p03680 (python)

Fixed submission:
N=int(input())
a=list(int(input()) for _ in range(N))
ans=1
c=0
for i in range(N):
    if ans != 2:
        ans=a[ans-1]
        c+=1
    else:
        print(c)
        exit()
print(-1)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(int(input()) for _ in range(n))
i=1
c=1
i=a[a.index(i)-1]
while  c!=n or i == 2:
    i=a[a.index(i)-1]
    print(i)
    c+=1
print(-1 if c==n+1 else c)
print(c)
Problem p03854 (python)

Fixed submission:
S=list(input())
i=0
while i!=len(S):
    if i+6<=len(S) and S[i:i + 6] == ['e', 'r', 'a', 's', 'e', 'r']:
        i += 6
    elif i+5<=len(S) and S[i:i+5]==['e','r','a','s','e']:
        i+=5
    elif i+7<=len(S) and S[i:i+7]==['d','r','e','a','m','e','r'] and (len(S[i:])==7 or (S[i+7]!='a')):
        i+=7
    elif i+5<=len(S) and S[i:i+5]==['d','r','e','a','m']:
        i+=5
    else:
        print('NO')
        exit()
print('YES')

Buggy submission (verdict: Runtime Error):
S=list(input())
i=0
while i!=len(S):
    if i+6<=len(S) and S[i:i + 6] == ['e', 'r', 'a', 's', 'e', 'r']:
        i += 6
    elif i+5<=len(S) and S[i:i+5]==['e','r','a','s','e']:
        i+=5
    elif i+7<=len(S) and S[i:i+7]==['d','r','e','a','m','e','r'] and (len(S[i+7:])==7 or S[i+7]!='a'):
        i+=7
    elif i+5<=len(S) and S[i:i+5]==['d','r','e','a','m']:
        i+=5
    else:
        print('NO')
        exit()
print('YES')

Buggy submission (verdict: Runtime Error):
S=list(input())
i=0
while i!=len(S):
    if S[i:i + 6] == ['e', 'r', 'a', 's', 'e', 'r']:
        i += 6
    elif S[i:i+5]==['e','r','a','s','e']:
        i+=5
    elif S[i:i+7]==['d','r','e','a','m','e','r'] and (len(S[i+7:])==7 or S[i+7]!='a'):
        i+=7
    elif S[i:i+5]==['d','r','e','a','m']:
        i+=5
    else:
        print('NO')
        exit()
print('YES')
Problem p03060 (python)

Fixed submission:
n = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i+1]):
    s = sum(l[0:i+1])
print(s)

Buggy submission (verdict: Runtime Error):
 = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i+1]):
    s = sum(l[0:i+1])
print(s)
Problem p03069 (python)

Fixed submission:
n = int(input())
s = input()
m = s.count('.')
ans = m
for i in range(n):
  if s[i] == '#':
    m = m + 1
  else:
    m = m - 1
  ans=min(m,ans)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
c = 0
sl = list(s)
sl2 = sl
k = 0
for i in range(n-2):
   if sl[i]=="#" and sl[i+1]==".":
      if sl[i+2]=="." and sl[i-1]==".":
        sl[i]='.'
        c = c + 1
      if sl[i+2]=="." and sl[i-1]=="#":
        sl[i+1]='#'
        sl[i+2]='#'
        c = c + 2
      elif sl[i+2]=='#':
        sl[i+1]='#'
        c = c + 1
if sl[n-2]=="#" and sl[n-1]==".":
  sl[i+1]='#'
  c=c+1
print(c)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
c = 0
sl = list(s)
sl2 = sl
k = 0
for i in range(n-2):
   if sl[i]=="#" and sl[i+1]==".":
      if sl[i+2]==".":
        sl[i]='.'
        c = c + 1
      elif sl[i+2]=='#':
        sl[i+1]='#'
        c = c + 1
      #if c == 1:
       # k = i
if sl[n-2]=="#" and sl[n-1]==".":
  sl[i+1]='#'
  c=c+1
print(c)
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().strip().split(' '))
i = 1
l = []
while i<=a or i<=b:
    if a%i==0 and b%i==0:
        l.append(i)
    else:
        pass
    i=i+1
print(l[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().strip().split(''))
i = 1
l = []
while len(l)<k:
    if (a%i==0 and b%i==0) or i%2==0 or i%5==0:
        l.append(i)
    else:
        pass
    i=i+1
print(l[-1])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().strip().split(' '))
i = 1
l = []
while len(l)<k:
    if a%i=0 and b%i=0 or i%2=0:
        l.append(i)
    else:
        pass
    i=i+1
print(l[-1])
Problem p02995 (python)

Fixed submission:
import fractions

def calc(v):
    ta = v // C
    tb = v // D
    tc = v // ((C * D) // fractions.gcd(C, D))
    return v-(ta+tb-tc)


A, B, C, D = list(map(int, input().split()))

count = 0
i = A
a = calc(A-1)
b = calc(B)
print(abs(a-b))

Buggy submission (verdict: Runtime Error):
import math

A, B, C, D = list(map(int, input().split()))

count = 0
i = A
d = B - A

ta = d // C
tb = d // D
tc = d//(C * D // math.gcd(C, D))

print(d-(ta+tb-tc))
Problem p02999 (python)

Fixed submission:

X, A = list(map(int, input().split()))
if X < A:
    print(0)
else:
    print(10)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
As = list(map(int, input().split()))

count = 0
for i in range(N):
    sumv = 0
    for k in range(i, N):
        sumv += As[k]
        if sumv >= K:
            count += N - k
            break

print(count)
Problem p03032 (python)

Fixed submission:
N, K = list(map(int, input().split()))
Vs = list(map(int, input().split()))
Length = len(Vs)
maxv = 0
for i in range(K + 1):
    count = K - i
    left = count
    right = 0
    for m in range(count + 1):
        if 0 <= left <= Length and 0 <= right <= Length:
            for p in range(i + 1):
                temp = sorted(Vs[:left] + Vs[Length - right:])
                for o in range(p):
                    if temp:
                        temp.pop(0)
                    else:
                        break
                sumv = sum(temp)
                if sumv > maxv:
                    maxv = sumv
            left -= 1
            right += 1

print(maxv)

Buggy submission (verdict: Runtime Error):
N, K = list(map(int, input().split()))
Vs = list(map(int, input().split()))
Length = len(Vs)

maxv = 0

for i in range(K):
    if K // 2 >= i:
        count = K - i
        for hoge in range(count):
            left = count
            right = 0
            for m in range(count):
                temp = sorted(Vs[:left] + Vs[Length - right:])
                for o in range(i):
                    temp.pop(0)
                sumv = sum(temp)
                left -= 1
                right += 1
                if sumv > maxv:
                    maxv = sumv

print(maxv)
Problem p03486 (python)

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

s.sort()
t.sort()
t.reverse()

size = min(len(s), len(t))
result = ""

for i in range(size):
    if s[i] < t[i]:
        result = "Yes"
        break

if result == "":
    if s[0:size] == t[0:size]:
        if len(s) < len(t):
            result = "Yes"
        else:
            result = "No"
    else:
        result = "No"

print(result)

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

s.sort()
t.sort()
t.reverse()

result = ""
for i in range(len(s)):
    if s[i] < t[i]:
        result = "Yes"
        break

if result == "":
    result = "No"

print(result)
Problem p03844 (python)

Fixed submission:
argv=input().split()


if argv[1] == "+":
    print(int(argv[0]) + int(argv[2]))
elif argv[1] =="-":
    print(int(argv[0]) - int(argv[2]))

Buggy submission (verdict: Runtime Error):
import sys



argv=sys.argv

if argv[2] == "+":
    print(int(argv[1]) + int(argv[3]))
elif argv[2] =="-":
    print(int(argv[1]) - int(argv[3]))
Problem p03633 (python)

Fixed submission:
#from math import gcd
from fractions import gcd

n=int(input())

res=1
for _ in range(n):
    x=int(input())
    res=res//gcd(res,x)*x
print(res)

Buggy submission (verdict: Runtime Error):
import math

n=int(input())

res=1
for _ in range(n):
    x=int(input())
    res=res//math.gcd(res,x)*x
print(res)
Problem p03837 (python)

Fixed submission:
def used(dp,u,v,w):
    n=len(dp)
    for i in range(n):
        for j in range(i+1,n):
            if dp[i][j]==dp[i][u]+w+dp[v][j] or dp[i][j]==dp[i][v]+w+dp[u][j]:
                return True
    return False

while 1:
    try:
        n,m=map(int,input().split())
        es=[]
        for _ in range(m):
            u,v,w=map(int,input().split())
            es.append((u-1,v-1,w))
    except: break

    dp=[[float('inf')]*n for _ in range(n)]
    for i in range(n):
        dp[i][i]=0
    for u,v,w in es:
        dp[u][v]=dp[v][u]=w
    for k in range(n):
        for i in range(n):
            for j in range(n):
                dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j])
    print(sum(int(not used(dp,u,v,w)) for u,v,w in es))

Buggy submission (verdict: Runtime Error):
import numpy
import random

def used(dp,u,v,w):
    n=len(dp)
    for i in range(n):
        for j in range(i+1,n):
            if dp[i][j]==dp[i][u]+w+dp[v][j] or dp[i][j]==dp[i][v]+w+dp[u][j]:
                return True
    return False

while 1:
    try:
        n,m=map(int,input().split())
        es=[]
        for _ in range(m):
            u,v,w=map(int,input().split())
            es.append((u-1,v-1,w))
    except: break

    random.shuffle(es)

    dp=[[float('inf')]*n for _ in range(n)]
    for i in range(n):
        dp[i][i]=0
    for u,v,w in es:
        dp[u][v]=dp[v][u]=w
    for k in range(n):
        for i in range(n):
            for j in range(n):
                dp[i][j]=min(dp[i][j],dp[i][k]+dp[k][j])
    print(sum(int(not used(dp,u,v,w)) for u,v,w in es))
Problem p03888 (python)

Fixed submission:
a, b = map(int, input().split())
print((a * b / (a + b)))

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print((a * b / (a + b)))
Problem p03359 (python)

Fixed submission:
a, b = map(int, input().split())
if (a <= b):
    print(a)
else:
    print(a-1)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if (a <= b):
    print(a)
else:
    print(a-1

Buggy submission (verdict: Runtime Error):
a, b = input().split()
if (a <= b):
    print(a)
else:
    print(a-1)

Buggy submission (verdict: Runtime Error):
a, b = (map(int, input().split()))
if (a <= b):
    print(a)
else:
    print(a-1
Problem p03455 (python)

Fixed submission:
a,b= map(int, (input()).split())
if (a*b)%2==0:
  print("Even")
else :
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b= map(int(input()).split())
if (a*b)%2==0:
  print("Even")
else :
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b= int(input( )).split()
if (a*b)%2=0:
  print("Even")
else :
  print("Odd")

Buggy submission (verdict: Runtime Error):
a,b= int(input()).split()
if (a*b)%2=0:
  print("Even")
else :
  print("Odd")
Problem p02934 (python)

Fixed submission:
n = int(input())

a=[int(x) for x in input().split()]

b=0
for i in range(n):
   b = b + 1/a[i]
b=1/b
print(b)

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

a=[int(x) for x in input().split()]

b=0
for i in range(n):
   b = b + 1/a[i]
b=1/b
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a=[]
for i in range(n):
    a.append(int(input()))
b=0
for i in range(n):
   b = b + 1/a[i]
b=1/b
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a=[]
for i in range(n):
    a.append(int(input()))
b=0
for i in range(n):
   b = b + 1/a[i]
b=1/b
print(b)

Buggy submission (verdict: Runtime Error):
n = int(input())
a=[]
for i in range(n):
    a.append(int(input()))
b=0
for i in range(n):
   b = b + 1/a[i]
b=1/b
print(b)
Problem p03145 (python)

Fixed submission:
AB,BC,CA = map(int,input().split())
print(int(AB*BC/2))

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()

print(int(a)*int(b)/2)

Buggy submission (verdict: Runtime Error):
a = input()
b = input()
c = input()

print(int(a)*int(b)/2)

Buggy submission (verdict: Runtime Error):
a = input("a:")
b = input("b:")
c = input("c:")

print(int(int(a)*int(b)/2))

Buggy submission (verdict: Runtime Error):
a = input("a:")
b = input("b:")
c = input("c:")

print(int(int(a)*int(b)/2))

Buggy submission (verdict: Runtime Error):
a = input("a:")
b = input("b:")
c = input("c:")

print(int(int(a)*int(b)/2))
Problem p03359 (python)

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

if a > b:
    a -= 1
print(a)

Buggy submission (verdict: Runtime Error):

n=int(input())
a=[]
a.append(2)
k=2
for i in range(55):
    while k < 55555 :
        k += 1
        b=k
        for j in a:
            if k%j==0:
                b=0
    
        if b==k:
            a.append(k)
            break
 
ans=[]
for j in range(len(a)):
    if len(ans) < n:
        if a[j] % 5 == 1:
            ans.append(a[j])
            
            
print(*ans)

Buggy submission (verdict: Runtime Error):

a,b=map(int,input().split())
x=[0,0,-1,1]
y=[-1,1,0,0]
d=[[0]*a for x in range(b)]
for i in range(b):
    d[i]=list(input())
    
result="Yes"

for i in range(b):
    for j in range(a):
        if d[i][j] == '#':
            check=0
            for xv,yv in zip(x,y):
                if 0 <= xv + j < a  and 0 <= yv + i < b:
                    if d[i+yv][j+xv] == '#':
                        check=1
                        #break
        
            if check==0:
                result="No"
                #break
            
                        
print(result)
Problem p03362 (python)

Fixed submission:
def main():
    n=int(input())
    a=[]
    s=[]
    t=0
    for k in range(3,55556):
        b=k
        for j in s:
            if k%j==0:
                b=0
        if b==k:
            s.append(k)
            if k % 5 == 1:
                if t < n:
                    a.append(k)
                    t += 1
                else:
                    break
     
    print(*a)
    
    
    
main()

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
a.append(2)
k=2
for i in range(55):
	while k < 55555 :
    	k += 1
    	b = k
		for j in a:
            if k % j == 0:
                b = 0
        if b == k:
            a.append(k)
            break
anss=[]
for j in range(len(a)):
    if len(anss) < n:
        if a[j] % 5 == 1:
            anss.append(a[j])   
print(*anss)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[]
k=2
for i in range(55):
    while k < 55555 :
        k += 1
        b=k
        for j in a:
            if k%j==0:
                b=0
    
        if b==k:
            a.append(k)
            break
 
ans=[]
for j in range(len(a)):
    if len(ans) < n:
        if a[j] % 5 == 1:
            ans.append(a[j])
            
            
print(*ans)

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

k=2
for i in range(55):
	while k < 55555 :
        k += 1
        b=k
        for j in a:
            if k%j==0:
                b=0
    
        if b==k:
            a.append(k)
            break

ans=[]
for j in range(len(a)):
	if len(ans) <= n:
    	if a[j] % 5 == 1:
        	ans.append(a[j])
 
 print(*ans)

Buggy submission (verdict: Runtime Error):
def func(k):
    
    while k < 55555 :
        k += 1
        b=k
        for j in a:
            if k%j==0:
                b=0
    
        if b==k:
            return k
            break
            
        
n=int(input())
a=[]

k=2
for i in range(55):
    a.append(func(k))

ans=[]
for j in range(len(a)):
    if len(ans) <= n:
        if a[j] % 5 == 1:
            ans.append(a[j])
 
 print(*ans)
Problem p03106 (python)

Fixed submission:
a,b,k = (int(x) for x in input().split())
m = 0
o = 0


for n in range(0,100):
    if a%(100-n) == b%(100-n) == 0:
        m += 1
        o = 100-n
    if m == k:
        break


print(o)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
k = int(input())
m = 0
o = 0


for n in range(0,100):
    if a%(100-n) == b%(100-n) == 0:
        m += 1
        o = 100-n
    if m == k:
        break


print(o)
Problem p02981 (python)

Fixed submission:
n, a, b = map(int, input().split())
print(min(a*n, b))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())
l, r = l%2019, r%2019
mi = 9999
if r*(r-1)<2019:
    print(l*(l+1))
elif r==0 or l==0:
    print(0)
else:
    for i in range(l, r-1):
        for j in range(i+1, r):
            if (i/3).is_integer() and (j/673).is_integer():
                mi = (i/3)*((i/3)+1)
            elif (i/673).is_integer() and (j/3).is_integer():
                mi = (i/673)*((i/673)+1)
            else:
                mi = min(mi, (i*j)%2019)
    print(mi)

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())
l, r = l%2019, r%2019
mi = 9999
if r*(r-1)<2019:
    print(l*(l+1))
elif r==0 or l==0:
    print(0)
else:
    for i in range(l, r-1):
        for j in range(i+1, r):
            if (i/3).is_integer() and (j/673).is_integer():
                print((i/3)*((i/3)+1))
            elif (i/673).is_integer() and (j/3).is_integer():
                print((i/673)*((i/673)+1))
            else:
                mi = min(mi, (i*j)%2019)
    print(mi)
Problem p02995 (python)

Fixed submission:
from fractions import gcd
a, b, c, d = map(int, input().split())
cd = c*d//gcd(c, d)

print(b-(b//c+b//d-b//cd) - ((a-1)-((a-1)//c+(a-1)//d-(a-1)//cd)))

Buggy submission (verdict: Runtime Error):
import math
a, b, c, d = map(int, input().split())
cd = c*d//math.gcd(c, d)

print(b-(b//c+b//d-b//cd) - ((a-1)-((a-1)//c+(a-1)//d-(a-1)//cd)))
Problem p02999 (python)

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

if x < a:
  print(0)
else:
  print(10)

Buggy submission (verdict: Runtime Error):
n,x = map(int, input().split())
l = list(map(int, input().split()))
cnt = 1

for i in range(2,n+2):
  if sum(l[:i-1]) <= x:
    cnt += 1
    
print(cnt)
Problem p03161 (python)

Fixed submission:
n,k = map(int, input().split())
h = list(map(int, input().split()))

dp = [0]*(n)
dp[0] = 0

for i in range(1, n):
  j = max(0, i-k)
  dp[i] = min([dpk + abs(h[i]-hk) for dpk, hk in zip(dp[j:i], h[j:i])])
  
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
n,k = map(int, input().split())
h = list(map(int, input().split()))

dp = [10**10]*(n+1)
dp[0] = 0

for i in range(n):
  for j in range(1,k+1):
    if i+j==n:
      break
    dp[i+j] = min(dp[i+j], dp[i] + abs(h[i]-h[i+j]))
  print(dp)
  
print(dp[n-1])