Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range(1,n):
    m=0
    for j in range(i,0,-1):
       
        if arr[j-1]>m:
            m=arr[j-1]
        
    if arr[i]<m:
        c+=m-arr[i]
    
print(c)

Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range(1,n):
    if arr[i]<arr[i-1]:
        c+=arr[i-1]-arr[i]
        arr[i]+=arr[i-1]-arr[i]
        
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
arr=list(map(int,input().split()))
ans=0
for i in range(1,n):
    m=0
    c=0
    for j in range(i,0,-1):
       
        if arr[j-1]>m:
            m=arr[j-1]
        
    if arr[i]<m:
        c+=m-arr[i]
    ans+=c
print(ans)

Fixed submission:
n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range(1,n):
    if arr[i]<arr[i-1]:
        c+=arr[i-1]-arr[i]
        arr[i]+=arr[i-1]-arr[i]
        
print(c)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]


def get_output():
    result = 0
    for i, x1y1 in enumerate(xy):
        for j, x2y2 in enumerate(xy[i+1:]):
            result = max(result, abs(x1y1[0] - x2y2[0]) + abs(x1y1[1] - x2y2[1]))
    return result


print(get_output())


Fixed submission:
N = int(input())
xy = [map(int, input().split()) for _ in range(N)]


def get_output():
    dist = [0 for _ in range(N)]
    X, Y = [], []

    for i, (x, y) in enumerate(xy):
        x, y = x-y, x+y
        X.append(x)
        Y.append(y)

    a = max(X) - min(X)
    b = max(Y)-min(Y)
    return max(a, b)


print(get_output())
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,(input().split())
x,y=0,0
if a>b:
    x=a
else:
    x=b
if c>d:
    y=c
else:
    y=d
print(x*y)

Fixed submission:
a,b,c,d=map(int,input().split())
'''
if a>b:
  x=a
else:
  x=b
if c>d:
  y=c
else:
  y=d
print(x*y)
'''
print(max(a*c,a*d,b*c,b*d))
Buggy python submission (verdict: Runtime Error):
arr = [int(x) for x in input().split()]
for i, a in enumerate(arr, 1):
    if a == 0:
        return i

Fixed submission:
arr = [int(x) for x in input().split()]
for i, a in enumerate(arr, 1):
    if a == 0:
        print(i)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())

if a >= 0 and c >= 0:
    ans = b * d
elif  b < 0 and d < 0:
    ans = a * c
elif a >= 0 and d <= 0:
    if a == 0 or b == 0 or c == 0 or d == 0:
        ans = 0
    else:
        ans = a * d
elif b <= 0 and c >= 0:
    if a == 0 or b == 0 or c == 0 or d == 0:
        ans = 0
    else:
        ans = b * c
        
print(ans)

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

ans = []

ans.append(a * c)
ans.append(b * c)
ans.append(a * d)
ans.append(b * d)

print(max(ans))

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

if a > 0 and c > 0:
    ans = b * d
elif  b < 0 and d < 0:
    ans = a * c
elif a >= 0 and d <= 0:
    ans = a * d
elif b <= 0 and c >= 0:
    ans = b * c

    
print(ans)


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

ans = []

ans.append(a * c)
ans.append(b * c)
ans.append(a * d)
ans.append(b * d)

print(max(ans))

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

if a >= 0 and c >= 0:
    ans = b * d
elif  b <= 0 and d <= 0:
    ans = a * c
elif a >= 0 and d <= 0:
    ans = a * d
elif b <= 0 and c >= 0:
    ans = b * c

    
print(ans)


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

ans = []

ans.append(a * c)
ans.append(b * c)
ans.append(a * d)
ans.append(b * d)

print(max(ans))
Buggy python submission (verdict: Runtime Error):
N = input()

ans = int(N[1:4])

ans = 1000 - ans

if ans == 1000:
    print(0)
else:
    print(ans)

Fixed submission:
N = input()


ans = int(N[-3:])

ans = 1000 - ans

if ans == 1000:
    print(0)
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + "...")

Fixed submission:
K = int(input())
S = input()

if len(S) <= K:
    print(S)
else:
    print(S[0:K] + "...")
Buggy python submission (verdict: Runtime Error):
, B, C, K = map(int, input().split())

ans = 0
for i in range(K):
    if A > 0:
        ans += 1
        A -= 1
    elif B > 0:
        B -= 1
    elif C > 0:
        ans -= 1
        C -= 1
        
        
print(ans)

Fixed submission:
A, B, C, K = map(int, input().split())

ans = 0
if K <= A:
    ans = K
elif K <= A + B:
    ans = A
else:
    ans = A  - (K - A - B) 
    
#rest = K - A - B    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math

K = int(input())

ans = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for l in range(1,K+1):
           ab = math.gcd(i,j)
           abc = math.gcd(ab,l)
           ans += abc


print(ans)


Fixed submission:
import math

K = int(input())

ans = 0
'''
for i in range(1,K+1):
    for j in range(1,K+1):
        for l in range(1,K+1):
           ab = math.gcd(i,j)
           abc = math.gcd(ab,l)
           print(i,j,l)
           ans += abc
'''
           
for i in range(1,K+1):
    for j in range(i,K+1):
        for l in range(j,K+1):
           ab = math.gcd(i,j)
           abc = math.gcd(ab,l)
           #print(i,j,l)
           if i == j and j == l:#３つすべて同じ数字のとき
               abc = abc
               #print('abc',abc)
           elif i == j or j == l or i == l:#２つの数字が同じ時
               abc = 3*abc
               #print('abc',abc)
           elif i != j and i != l and j != l:#３つの数字がすべて違うとき
               abc = 6*abc
               #print('abc',abc)
           
           ans += abc
           #print(ans,abc)


print(ans)
Buggy python submission (verdict: Runtime Error):
H,W = map(int, input().split())


h = 0
w = 0
w1 = w2 = 0
if W % 2 == 1:#横が奇数
    w = int(W /2) + 1
    if H % 2 == 1:#縦が奇数
        h = int(H / 2) + 1
        w1 = h * w
        w2 = (w-1) * (h-1)
        print(w1 + w2)
    else:#縦が偶数
        h = int(H / 2)
        w1 = w * h
        w2 = (w-1) * h
        print(w1 + w2)
        
        
else:#横が偶数
    w = int(W / 2)
    print(w * H)


Fixed submission:

K = int(input())


S = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(S[K-1])
Buggy python submission (verdict: Runtime Error):
import math

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


C_multiple = B // C - A // C
D_multiple = B // D - A // D 

if A % C == 0:
    C_multiple += 1
if A % D == 0:
    D_multiple += 1
        

CD_gcd = C * D / math.gcd(C,D) 
CD_multiple = B // CD_gcd - A// CD_gcd 
if A % CD_gcd == 0:
    CD_multiple += 1
***
print(C_multiple)
print(D_multiple)
print(CD_gcd)
print(CD_multiple)
***
ans = ( B - A + 1 ) - (C_multiple + D_multiple - CD_multiple)
print(int(ans))

Fixed submission:
import math

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


C_multiple = B // C - A // C
D_multiple = B // D - A // D 

if A % C == 0:
    C_multiple += 1
if A % D == 0:
    D_multiple += 1
        

CD_gcd = C * D // math.gcd(C,D) 
CD_multiple = B // CD_gcd - A// CD_gcd 
if A % CD_gcd == 0:
    CD_multiple += 1



ans = ( B - A + 1 ) - (C_multiple + D_multiple - CD_multiple)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
import numpy as np

N, Q = map(int, input().split())

S = input()

ac = np.zeros(N-1)

for i in range(Q):
	l, r = map(int, input().split())
    print(S.count('AC'))
	#print(int(sum(ac[l-1:r-2])))

Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
	t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
	l, r = map(int, input().split())
	print(t[r-1] - t[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N, Q = map(int, input().split())

S = input()


for _ in range(Q):
    l, r = map(int, input().split())
    count = 0
    for j in range(l,r):
        if S[j-1:j+1] == 'AC':
            count += 1
            #print(S[j-1:j+1])
    print(count)


Fixed submission:
N, Q = map(int, input().split())
S = input()
t = [0] * (N + 1)
for i in range(N):
	t[i + 1] = t[i] + (1 if S[i : i + 2] == 'AC' else 0)
for i in range(Q):
	l, r = map(int, input().split())
	print(t[r-1] - t[l-1])
Buggy python submission (verdict: Runtime Error):
N,k = map(int,input().split())

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


flag = N - 1
count = 0
if N == k:
    flag = -1
    count = 1
while flag >= 0:
    flag -= k-1
    count += 1
    
print(count)

Fixed submission:
S = list(input())

plus = S.count('+')
minas = S.count('-')

ans = plus - minas
print(ans)
Buggy python submission (verdict: Runtime Error):
N = list(input())
n = 0

S = 0
for i in range(len(N)):
    S = S + int(N[i])
    n = (int(N[i])999999999 * (10 ** (len(N) - i - 1))) + n
    
if n % S == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
N = list(input())
n = 0

S = 0
for i in range(len(N)):
    S = S + int(N[i])
    n = (int(N[i]) * (10 ** (len(N) - i - 1))) + n
    
if n % S == 0:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = list(input())
n = 0

S = 0
for i in range(len(N)):
    S = S + int(N[i])
    n = (int(N[i])999999999 * (10 ** (len(N) - i - 1))) + n
    
if n % S == 0:
    print('Yes')
else:
    print('No')

Fixed submission:
N = list(input())
n = 0

S = 0
for i in range(len(N)):
    S = S + int(N[i])
    n = (int(N[i]) * (10 ** (len(N) - i - 1))) + n
    
if n % S == 0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
prod_sum = 0
for i in range(n-1):
    for j in range(i+1, n):
        prod_sum += a[i]*a[j]
print(prod_sum%(10**9+7))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
prod_sum = 0
sum_arr = [0]*n
sum_arr[n-1] = a[n-1]
for i in range(n-2, -1, -1):
    sum_arr[i] = sum_arr[i+1] + a[i]
for i in range(n-1):
        prod_sum += a[i]*sum_arr[i+1]
print(prod_sum%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = int(input())
A = input().split()

sum = 0
for i in range(N):
    count = 0
    for j in range(i+1, N):
        count += int(A[j])
    sum += int(A[i]) * count

print(sum % (10**9 + 7))


Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
A = input().split()

B = [0]
for i in range(N):
    B.append(B[i] + int(A[i]))

sum = 0
for i in range(N):
    sum += int(A[i]) * (B[N] - B[i+1])

print(sum % (10**9 + 7))

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
N = int(input())
A = input().split()

sum = 0
for i in range(N):
    for j in range(i+1, N):
        sum += int(A[i]) * int(A[j])

print(sum % (10**9 +7))

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
A = input().split()

B = [0]
for i in range(N):
    B.append(B[i] + int(A[i]))

sum = 0
for i in range(N):
    sum += int(A[i]) * (B[N] - B[i+1])

print(sum % (10**9 + 7))
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
N = int(input())
A = map(int, input().split())

success =
for a in A:
    if a % 2  == 0 and (a % 3 == 0 or a % 5 ==0):
        print("DENIED")

print("APPROVED")

Fixed submission:
# -*- coding: utf-8 -*-
N = int(input())
A = map(int, input().split())

for a in A:
    if a % 2 == 0:
        if a % 3 == 0 or a % 5 == 0:
            continue
        print("DENIED")
        exit()
print("APPROVED")
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
if N!=0:
    p=list(map(int,input().split()))
    checkNum=[0 for j in range(101)]
    for i in range(len(p)):
        checkNum[p[i]]=1
    i=0
    while(X-i>=0 or X+1<101):
        if checkNum[X-i]==0:
            print(X-i)
            break
        if checkNum[X+i]==0:
            print(X+i)
            break
        i+=1
else:
    print(X)

Fixed submission:
X, N = map(int, input().split())
if N!=0:
    p=list(map(int,input().split()))
    checkNum=[0 for j in range(102)]
    for i in range(len(p)):
        checkNum[p[i]]=1
    i=0
    while(X-i>=0 or X+i<=101):
        if X-i>=0:
            if checkNum[X-i]==0:
                print(X-i)
                break
        if X+i<=101:
            if checkNum[X+i]==0:
                print(X+i)
                break
        i+=1
else:
    print(X)
Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
S=[[0 for i in range(4)] for j in range(Q)]
for i in range(Q):
    inputS=list(map(int,input().split()))
    S[i][0]=inputS[0]
    S[i][1]=inputS[1]
    S[i][2]=inputS[2]
    S[i][3]=inputS[3]
S2=[]
maxNum=0
for a in range(11):
    for b in range(a,11):
        for c in range(b,11):
            for d in range(c,11):
                for e in range(d,11):
                    for f in range(e,11):
                        for g in range(f,11):
                            for h in range(g,11):
                                for i in range(h,11):
                                    for j in range(i,11):
                                        S2.append([a,b,c,d,e,f,g,h,i,j])
                                        
                                        count=0
                                        for k in range(Q):
                                            if S2[len(S2)-1][S[k][1]-1]-S2[len(S2)-1][S[k][0]-1]==S[k][2]:
                                                count+=S[k][3]
                                        maxNum=max(maxNum,count)

print(maxNum)


Fixed submission:
N, M, Q = map(int, input().split())
S=[[0 for i in range(4)] for j in range(Q)]
for i in range(Q):
    inputS=list(map(int,input().split()))
    S[i][0]=inputS[0]
    S[i][1]=inputS[1]
    S[i][2]=inputS[2]
    S[i][3]=inputS[3]
S2=[]
maxNum=0
for a in range(1,M+1):
    for b in range(a,M+1):
        for c in range(b,M+1):
            for d in range(c,M+1):
                for e in range(d,M+1):
                    for f in range(e,M+1):
                        for g in range(f,M+1):
                            for h in range(g,M+1):
                                for i in range(h,M+1):
                                    for j in range(i,M+1):
                                        S2=[a,b,c,d,e,f,g,h,i,j]
                                        count=0
                                        for k in range(Q):
                                            if S2[S[k][1]-1]-S2[S[k][0]-1]==S[k][2]:
                                                count+=S[k][3]
                                        maxNum=max(maxNum,count)
                                       
    
print(maxNum)
Buggy python submission (verdict: Runtime Error):
import math
A, B, N = map(int, input().split())
if math.floor(N/B)>math.floor(N/(B-1)):
    print(math.floor(A*N/B)-A*math.floor(N/(B-1)))
else:
    print(math.floor(A*N/B)-A*math.floor(N/B))

Fixed submission:
import math
A, B, N = map(int, input().split())
x=N
if N>B-1:
    x=B-1
print(math.floor(A*x/B)-A*math.floor(x/B))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[""]
for i in range(N):
    inpu=input()
    if not inpu in S:
        S.append(inpu)
        
print(len(S)-1)

Fixed submission:
N=int(input())
S=["" for j in range(N)]
for i in range(N):
    S[i]=input()
S.sort()
count=1
for i in range(1,N):
    if S[i]!=S[i-1]:
        count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
41 59 31

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, M = map(int, input().split())
lenzi=list(map(int,input().split()))
zouko=list(map(int,input().split()))
mPrice = 200000
for i in range(A):
  for j in range(B):
    if lenzi[i]+zouko[j]<mPrice:
      mPrice=lenzi[i]+zouko[j]
for i in range(M):
  x, y, c = map(int, input().split())
  if lenzi[x-1]+zouko[y-1]-c<mPrice:
    mPrice=lenzi[x-1]+zouko[y-1]-c
print(mPrice)

Fixed submission:
A, B, M = map(int, input().split())
lenzi=list(map(int,input().split()))
zouko=list(map(int,input().split()))
mlenzi=100000
mzouko=100000
mPrice = 200000
for i in range(A):
  if lenzi[i]<mlenzi:
    for j in range(B):
      if zouko[j]<mzouko:
        if lenzi[i]+zouko[j]<mPrice:
          mPrice=lenzi[i]+zouko[j]
        mzouko=zouko[j]
    mlenzi=lenzi[i]
for i in range(M):
  x, y, c = map(int, input().split())
  if lenzi[x-1]+zouko[y-1]-c<mPrice:
    mPrice=lenzi[x-1]+zouko[y-1]-c
print(mPrice)
Buggy python submission (verdict: Runtime Error):
Query=list(input())
Q=int(input())
flag = True
strF=[]
strB=[]
for i in range(Q):
  S2=input()
  if S2=="1":
    flag = not flag
  else:
    x=S2.split()
    if flag:
      if x[1]=="1":
        strF.append(x[2])
      else:
        strB.append(x[2])
    else:
      if x[1]=="1":
        strB.append(x[2])
      else:
        strF.append(x[2])

if flag:
  strF.reverse()
  Query=strF+Query+strB
else:
  strB.reverse()
  Query=strB+Query.reverse()+strF
 
print("".join(Query))

Fixed submission:
Query=list(input())
Q=int(input())
flag = True
strF=[]
strB=[]
for i in range(Q):
  S2=input()
  if S2=="1":
    flag = not flag
  else:
    x=S2.split()
    if flag:
      if x[1]=="1":
        strF.append(x[2])
      else:
        strB.append(x[2])
    else:
      if x[1]=="1":
        strB.append(x[2])
      else:
        strF.append(x[2])

if flag:
  strF.reverse()
  Query=strF+Query+strB
else:
  strB.reverse()
  Query.reverse()
  Query=strB+Query+strF
 
print("".join(Query))

Buggy python submission (verdict: Runtime Error):
S = input()
Q=int(input())
Query=[S]
flag = True
strF=[]
strB=[]
for i in range(Q):
  S2=input()
  if S2=="1":
    flag = not flag
  else:
    x=S2.split()
    if flag:
      if x[1]=="1":
        strF.append(x[2])
      else:
        strB.append(x[2])
    else:
      if x[1]=="1":
        strB.append(x[2])
      else:
        strF.append(x[2])

if flag:
  strF.reverse()
  Query=strF+Query+strB
else:
  strB.reverse()
  Query=strB+Query.reverse()+strF
 
print("".join(Query))

Fixed submission:
Query=list(input())
Q=int(input())
flag = True
strF=[]
strB=[]
for i in range(Q):
  S2=input()
  if S2=="1":
    flag = not flag
  else:
    x=S2.split()
    if flag:
      if x[1]=="1":
        strF.append(x[2])
      else:
        strB.append(x[2])
    else:
      if x[1]=="1":
        strB.append(x[2])
      else:
        strF.append(x[2])

if flag:
  strF.reverse()
  Query=strF+Query+strB
else:
  strB.reverse()
  Query.reverse()
  Query=strB+Query+strF
 
print("".join(Query))

Buggy python submission (verdict: Runtime Error):
S = input()
Q=int(input())
Query=S
flag = True
for i in range(Q):
  S2=input()
  if S2=="1":
    flag = not flag
  else:
    x=S2.split()
    if flag:
      if x[1]=="1":
        Query=x[2]+Query
      else:
        Query=Query+x[2]
    else:
      if x[1]=="1":
        Query=Query+x[2]
      else:
        Query=x[2]+Query
if flag==False:
  Query.reverse()

print(Query)

Fixed submission:
Query=list(input())
Q=int(input())
flag = True
strF=[]
strB=[]
for i in range(Q):
  S2=input()
  if S2=="1":
    flag = not flag
  else:
    x=S2.split()
    if flag:
      if x[1]=="1":
        strF.append(x[2])
      else:
        strB.append(x[2])
    else:
      if x[1]=="1":
        strB.append(x[2])
      else:
        strF.append(x[2])

if flag:
  strF.reverse()
  Query=strF+Query+strB
else:
  strB.reverse()
  Query.reverse()
  Query=strB+Query+strF
 
print("".join(Query))
Buggy python submission (verdict: Runtime Error):
A, B, C = map(int, input().split())
if A==B==C:
  print("No")
elif A!=B!=C:
  print("No")
else:
  print("Yes")


Fixed submission:
N=int(input())
A=list(map(int,input().split()))
flag=True
for i in range(N):
    if A[i]%2==0:
        if (A[i]%3==0 or A[i]%5==0)==False:
            flag=False
if flag:
    print("APPROVED")
else:
    print("DENIED")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
S=[[0, ""] for j in range(M)]
ACcheck=[False for j in range(N)]
AC=0
WA=[0 for j in range(N)]
WA2 = 0
for i in range(M):
  ps = input().split()
  S[i][0]=int(ps[0])
  S[i][1]=ps[1]
for i in range(M):
  if S[i][1]=="AC":
    if ACcheck[S[i][0]-1]==False:
      AC+=1
      ACcheck[S[i][0]-1]=True
      WA2+=WA[S[i][0]]
  else:
    if ACcheck[S[i][0]-1]==False:
      WA[S[i][0]]+=1

print(AC, WA2)

Fixed submission:
N, M = map(int, input().split())
S=[[0, ""] for j in range(M)]
ACcheck=[False for j in range(N)]
AC=0
WA=[0 for j in range(N)]
WA2 = 0
for i in range(M):
  ps = input().split()
  S[i][0]=int(ps[0])
  S[i][1]=ps[1]
for i in range(M):
  if S[i][1]=="AC":
    if ACcheck[S[i][0]-1]==False:
      AC+=1
      ACcheck[S[i][0]-1]=True
      WA2+=WA[S[i][0]-1]
  else:
    if ACcheck[S[i][0]-1]==False:
      WA[S[i][0]-1]+=1

print(AC, WA2)
Buggy python submission (verdict: Time Limit Exceeded):
import math
L, R = map(int, input().split())
R=min(R,L+2019*2)
m=2018
for i in range(L,R+1):
  for j in range(i,R+1):
    if i==j:
      continue
    if (i*j)%2019<m:
      m=(i*j)%2019
print(m)

Fixed submission:
import math
L, R = map(int, input().split())
R=min(R,L+2019)
m=2018
for i in range(L,R+1):
  for j in range(i,R+1):
    if i==j:
      continue
    if (i*j)%2019<m:
      m=(i*j)%2019
print(m)

Buggy python submission (verdict: Time Limit Exceeded):
import math
L, R = map(int, input().split())
#R=min(R,(L+2019)*2)
m=2018
for i in range(L,R+1):
  for j in range(i,R+1):
    if i==j:
      continue
    if (i*j)%2019<m:
      m=(i*j)%2019
print(m)

Fixed submission:
import math
L, R = map(int, input().split())
R=min(R,L+2019)
m=2018
for i in range(L,R+1):
  for j in range(i,R+1):
    if i==j:
      continue
    if (i*j)%2019<m:
      m=(i*j)%2019
print(m)

Buggy python submission (verdict: Time Limit Exceeded):
import math
L, R = map(int, input().split())
R=min(R,(L+2019)*2)
m=2018
for i in range(L,R+1):
  for j in range(i,R+1):
    if i==j:
      continue
    if (i*j)%2019<m:
      m=(i*j)%2019
print(m)

Fixed submission:
import math
L, R = map(int, input().split())
R=min(R,L+2019)
m=2018
for i in range(L,R+1):
  for j in range(i,R+1):
    if i==j:
      continue
    if (i*j)%2019<m:
      m=(i*j)%2019
print(m)
Buggy python submission (verdict: Runtime Error):
a=list()
for i in range(5):
  a.append(int(input()))
max=10
count=0
for i in range(5):
  if a[i]%10<max and a[i]%10!=0:
    max=a[i]%10
    maxI=i
for i in range(5):
  if i!=maxI:
    count+=a[i]
    if a[i]%10!=0:
      count+=(10-a[i]%10)
count+=a[maxI]
print(count)

Fixed submission:
a=list()
for i in range(5):
  a.append(int(input()))
flag=True
count2=0
for i in range(5):
  if a[i]%10==0:
    count2+=a[i]
  else:
    flag=False
if flag==False:
  max=10
  count=0
  for i in range(5):
    if a[i]%10<max and a[i]%10!=0:
      max=a[i]%10
      maxI=i
  for i in range(5):
    if i!=maxI:
      count+=a[i]
      if a[i]%10!=0:
        count+=(10-a[i]%10)
  count+=a[maxI]
  print(count)
else:
  print(count2)