Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


a,b = map(int,input().split())
if a==b:
    print("H")
else:
    print("D")

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


a,b = input().split()
if a==b:
    print("H")
else:
    print("D")
Buggy python submission (verdict: Runtime Error):
#n = int(input())
#n,k = map(int,input().split())
#x = list(map(int,input().split()))


N,M = map(int,input().split())
A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]

flg1 = 1
flg2 = 0
for i in range(N):
    if flg2:
        break
    for j in range(N):
        if flg2:
            break
        flg1 = 1
        
        for k in range(M):
            if not(flg1):
                break
            for l in range(M):
                if A[i+k][j+l]==B[k][l]:
                    continue
                else:
                    flg1 = 0
        else:
            print("Yes")
            flg2 = 1
else:
    print("No")

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


N,M = map(int,input().split())
A = [list(input()) for _ in range(N)]
B = [list(input()) for _ in range(M)]

flg1 = 1
flg2 = 0
for i in range(N-M+1):
    if flg2:
        break
    for j in range(N-M+1):
        if flg2:
            break
        flg1 = 1
        
        for k in range(M):
            if not(flg1):
                break
            for l in range(M):
                if A[i+k][j+l]==B[k][l]:
                    continue
                else:
                    flg1 = 0
        else:
            if flg1:
                print("Yes")
                flg2 = 1
else:
    if not(flg2):
        print("No")
Buggy python submission (verdict: Runtime Error):
#n,l = map(int,input().split())
#l = kist(input())

l = list(input())
cnt=0
ans=0

for i in range(n):
    if l[i]=='I':
        cnt+=1
    else:
        cnt-=1
    ans = max(ans,cnt)

print(ans)

Fixed submission:
#n,l = map(int,input().split())
#l = kist(input())

n = int(input())
l = list(input())
cnt=0
ans=0

for i in range(n):
    if l[i]=='I':
        cnt+=1
    else:
        cnt-=1
    ans = max(ans,cnt)

print(ans)

Buggy python submission (verdict: Runtime Error):
#n,l = map(int,input().split())
#l = kist(input())

l = kist(input())
cnt=0
ans=0

for i in range(n):
    if l[i]=='I':
        cnt+=1
    else:
        cnt-=1
    ans = max(ans,cnt)

print(ans)

Fixed submission:
#n,l = map(int,input().split())
#l = kist(input())

n = int(input())
l = list(input())
cnt=0
ans=0

for i in range(n):
    if l[i]=='I':
        cnt+=1
    else:
        cnt-=1
    ans = max(ans,cnt)

print(ans)
Buggy python submission (verdict: Runtime Error):
s = list(input())

a = int(s[0])
b = int(s[2])

op = a[1]

if op == "+":
    print(a+b)
else:
    print(a-b)



Fixed submission:
s = list(input().split())

a = int(s[0])
b = int(s[2])

op = s[1]

if op == "+":
    print(a+b)
else:
    print(a-b)
Buggy python submission (verdict: Runtime Error):
#n,l = map(int,input().split())
#l = kist(input())

n = int(input())
l = list(map(int,input()))

ttl = sum(l)

m = int(input())

for i in range(m):
    p,x = map(int,input().split())
    print(ttl-l[p-1]+x)

Fixed submission:
#n,l = map(int,input().split())
#l = kist(input())

n = int(input())
l = list(map(int,input().split()))

ttl = sum(l)

m = int(input())

for i in range(m):
    p,x = map(int,input().split())
    print(ttl-l[p-1]+x)
Buggy python submission (verdict: Runtime Error):
#n = int(input())
a = list(map(int,input().split()))

a.sort()

if a[0]+a[1]==a[2]:
    print("Yes")
elif:
    print("No")

Fixed submission:
#n = int(input())
a = list(map(int,input().split()))

a.sort()

if a[0]+a[1]==a[2]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
#n = int(input())
a,b,c = map(int,input().spkit())

if (a==b and b == c):
    print(1)
elif (a==b or b == c or a == c):
    print(2)

else:
    print(3)



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

if (a==b and b == c):
    print(1)
elif (a==b or b == c or a == c):
    print(2)

else:
    print(3)

Buggy python submission (verdict: Runtime Error):
#n = int(input())
a = int(input())
b = int(input())
c = int(input())

if (a==b and b == c):
    print(1)
elif (a==b or b == c or a == c):
    print(2)

else:
    print(3)



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

if (a==b and b == c):
    print(1)
elif (a==b or b == c or a == c):
    print(2)

else:
    print(3)
Buggy python submission (verdict: Runtime Error):

  a = list(map(int,input().split()))
  
a.sort()
  
ans = True
  
if a[0] != 5:
    ans = False
if a[1] != 5:
    ans = False
if a[2] != 7:
    ans = False

if(ans):
    print("Yes")
else:
    print("No")


Fixed submission:
a = list(map(int,input().split()))
  
a.sort()
  
ans = True
  
if a[0] != 5:
    ans = False
if a[1] != 5:
    ans = False
if a[2] != 7:
    ans = False

if(ans):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x) ; y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)
    
N,M=map(int,input().split())
uf=UnionFind(N)
for i in range(M):
    a,b=map(int,input().split(' '))
    uf.union(a,b)

ans=sum([1 for i in uf.parents if i==-1])
print(ans)

Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x) ; y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):
        return self.find(x) == self.find(y)
    
N,M=map(int,input().split())
uf=UnionFind(N)
for i in range(M):
    a,b=map(int,input().split(' '))
    uf.union(a-1,b-1)

ans=sum([1 for i in uf.parents if i<0])-1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sympy

N=int(input())
count=0
for i in range(1,N):
    count+=len(sympy.divisors(i))
    
print(count)

Fixed submission:
def ndt(n):
    table = [0] * (n + 1)
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    return table

N=int(input())
print(sum(ndt(N-1)))
Buggy python submission (verdict: Runtime Error):
K=int(input())

L=9*K/7 if K%7==0 else 9*K

if L%2==0 or L%5==0:
    print('-1')

else:
    surplus=1
    for i in range(1,L):
        surplus=(surplus*10)%L
        if surplus==1:
            print(i)
            break
    print('-1')

Fixed submission:
K=int(input())

L=9*K//7 if K%7==0 else 9*K

if L%2==0 or L%5==0:
    print('-1')

else:
    surplus=1
    for i in range(1,L):
        surplus=(surplus*10)%L
        if surplus==1:
            print(i)
            break

Buggy python submission (verdict: Runtime Error):
K=int(input())

L=9*K/7 if K%7==0 else 9*K

if L%2==0 or L%5==0:
    print('-1')

else:
    surplus=1

    for i in range(1,L+1):
        surplus=(surplus*10)%L
        if surplus==1:
            print(i)
            break

Fixed submission:
K=int(input())

L=9*K//7 if K%7==0 else 9*K

if L%2==0 or L%5==0:
    print('-1')

else:
    surplus=1
    for i in range(1,L):
        surplus=(surplus*10)%L
        if surplus==1:
            print(i)
            break
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
c=input().replace('W','1').replace('R','0')
c=[int(x) for x in c]
count=0

if sum(c)!=0 and sum(c)!=N:
    while True:
        w=c.index(1)
        r=N-c[::-1].index(0)-1
        if w>r:
            break
        count+=1
        c[w]=0 ; c[r]=1

print(count)

Fixed submission:
N=int(input())
c=input()
count=0

if 'WR' in c:
    x=c.count('R')
    y=c.count('R',0,x)
    count=x-y
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
c=list(input())
le=len(c)
count=0

while 'WR' in ''.join(c):
    count+=1
    w=c.index('W')
    r=le-c[::-1].index('R')-1
    c[w]='R' ; c[r]='W'

print(count)

Fixed submission:
N=int(input())
c=input()
count=0

if 'WR' in c:
    x=c.count('R')
    y=c.count('R',0,x)
    count=x-y
print(count)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(a*b)

Fixed submission:
a,b=map(int,input().split(' '))
print(a*b)
Buggy python submission (verdict: Runtime Error):
x=int(input())
div=make_divisors(x)
def depth_limited(x,div):
    depth=-50
    while True:
        depth+=50
        for t in div:
            for b in range(depth,depth+50):
                if x==t*(5*b**4+10*b**3*t+10*b**2*t**2+5*b*t**3+t**4):
                    return (b+t,b)
                b=-b
                if x==t*(5*b**4+10*b**3*t+10*b**2*t**2+5*b*t**3+t**4):
                    return (b+t,b)
ans=depth_limited(x,div)
print(str(ans[0])+' '+str(ans[1]))

Fixed submission:
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

x=int(input())
div=make_divisors(x)
def depth_limited(x,div):
    depth=-50
    while True:
        depth+=50
        for t in div:
            for b in range(depth,depth+50):
                if x==t*(5*b**4+10*b**3*t+10*b**2*t**2+5*b*t**3+t**4):
                    return (b+t,b)
                b=-b
                if x==t*(5*b**4+10*b**3*t+10*b**2*t**2+5*b*t**3+t**4):
                    return (b+t,b)
ans=depth_limited(x,div)
print(str(ans[0])+' '+str(ans[1]))
Buggy python submission (verdict: Time Limit Exceeded):
import math

a,b,n=map(int,input().split(' '))
ans=0
for x in range(1,n+1):
    q=math.trunc(a*x/b)-a*math.trunc(x/b)
    if ans<q:
        ans=q
print(int(ans))

Fixed submission:
import math

a,b,n=map(int,input().split(' '))
ans=0
x=min(n,b-1)
q=math.trunc(a*x/b)-a*math.trunc(x/b)
if ans<q:
    ans=q
print(int(ans))
Buggy python submission (verdict: Runtime Error):
n=input().split(' ')
a=int(n[0]);b=int(n[1])
import sympy
print(sympy.lcm(a,b))

Fixed submission:
n=input().split(' ')
a=int(n[0]);b=int(n[1])
def gcd(a,b):
    x=max(a,b);y=min(a,b)
    if x%y==0:
        return y
    while x%y!=0:
        z=x%y ; x=y ; y=z
    return z
print(int(a*b/gcd(a,b)))
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split(' '))
h=list(map(int,input().split(' ')))
node=[0]*n
for i in range(1,n):
    x=[abs(h[i]-h[i-m])+node[i-m] for m in range(1,min(i+1,k+1))]
    node[i]=min(x)
print(node[-1])

Fixed submission:
n,k=map(int,input().split(' '))
h=list(map(int,input().split(' ')))
node=[0]*n
for i in range(1,n):
    x=[abs(h[i]-h[i-m])+node[i-m] for m in range(1,min(i+1,k+1))]
    node[i]=min(x)
print(node[-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split(' '))
bag=[tuple(map(int,input().split(' '))) for _ in range(N)]
dp1,dp2=[0]*(W+1),[0]*(W+1)
for i in range(N):
    dp1=dp2
    dp2=[0]*(W+1)
    for j in range(1,W+1):
        if j<bag[i][0]:
            dp2[j]=dp1[j]
        else:
            dp2[j]=max(dp1[j],dp1[j-bag[i][0]]+bag[i][1])
print(dp2[-1])

Fixed submission:
N,W=map(int,input().split(' '))
w=[0]*N ; v=[0]*N
for i in range(N):
    w[i],v[i]=map(int,input().split(' '))
dp=[[0]*(W+1) for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,W+1):
        if j<w[i-1]:
            dp[i][j]=dp[i-1][j]
        else:
            dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1]]+v[i-1])
print(dp[N][W])
Buggy python submission (verdict: Time Limit Exceeded):
N,W=map(int,input().split(' '))
w,v=[0]*N,[0]*N
for i in range(N):
    w[i],v[i]=map(int,input().split(' '))
dp=[[0]+[W+1]*(sum(v)+1) for _ in range(N+1)]
for i in range(N):
    for nv in range(sum(v),0,-1):
        if nv<v[i]:
            dp[i+1][nv]=min(dp[i][nv],dp[i+1][nv+1])
        else:
            dp[i+1][nv]=min(dp[i][nv],dp[i][nv-v[i]]+w[i])

print(dp[N].index(W+1)-1)

Fixed submission:
N,W=map(int,input().split(' '))
w=[0]*N ; v=[0]*N
for i in range(N):
    w[i],v[i]=map(int,input().split(' '))
S=sum(v)
A=0
dp=[[sum(w)]*S for _ in range(N+1)]
for i in range(N):
    for j in range(S):
        if j<v[i]:
            dp[i+1][j]=min(dp[i][j],w[i])
        else:
            dp[i+1][j]=min(dp[i][j],dp[i][j-v[i]]+w[i])
        if dp[i+1][j]>W:
            A=j
            break
        if j==S-1:
          A=j+1
print(A)

Buggy python submission (verdict: Runtime Error):
N,W=map(int,input().split(' '))
w=[0]*N ; v=[0]*N
for i in range(N):
    w[i],v[i]=map(int,input().split(' '))
dp=[[0]*(W+1) for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,W+1):
        if j<w[i-1]:
            dp[i][j]=dp[i-1][j]
        else:
            dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1]]+v[i-1])
print(dp[N][W])

Fixed submission:
N,W=map(int,input().split(' '))
w=[0]*N ; v=[0]*N
for i in range(N):
    w[i],v[i]=map(int,input().split(' '))
S=sum(v)
A=0
dp=[[sum(w)]*S for _ in range(N+1)]
for i in range(N):
    for j in range(S):
        if j<v[i]:
            dp[i+1][j]=min(dp[i][j],w[i])
        else:
            dp[i+1][j]=min(dp[i][j],dp[i][j-v[i]]+w[i])
        if dp[i+1][j]>W:
            A=j
            break
        if j==S-1:
          A=j+1
print(A)
Buggy python submission (verdict: Time Limit Exceeded):
s,t=input(),input()
m,n=len(s),len(t)
c=[[0]*(n+1) for _ in range(m+1)]
fro=[['']*(n+1) for _ in range(m+1)]
for i in range(1,m+1):
    for j in range(1,n+1):
        if s[i-1]==t[j-1]:
            c[i][j]=c[i-1][j-1]+1
            fro[i][j]='upper_left'
        elif c[i-1][j]>=c[i][j-1]:
            c[i][j]=c[i-1][j]
            fro[i][j]='above'
        else:
            c[i][j]=c[i][j-1]
            fro[i][j]='left'
x=''
a,b=m,n
while a>0 and b>0:
    if fro[a][b]=='upper_left':
        x+=s[a-1]
        a-=1;b-=1
    elif fro[a][b]=='above':
        a-=1
    else:
        b-=1
print(x[::-1])

Fixed submission:
s,t=input(),input()
m,n=len(s),len(t)
c=[[0]*(n+1) for _ in range(m+1)]
fro=[['']*(n+1) for _ in range(m+1)]
for i in range(1,m+1):
    for j in range(1,n+1):
        if s[i-1]==t[j-1]:
            c[i][j]=c[i-1][j-1]+1
            fro[i][j]='upper_left'
        elif c[i-1][j]>=c[i][j-1]:
            c[i][j]=c[i-1][j]
            fro[i][j]='above'
        else:
            c[i][j]=c[i][j-1]
            fro[i][j]='left'
x=''
a,b=m,n
while a>0 and b>0:
    if fro[a][b]=='upper_left':
        x+=s[a-1]
        a-=1;b-=1
    elif fro[a][b]=='above':
        a-=1
    else:
        b-=1
print(x[::-1])
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split(' '))
war=[tuple(map(int,input().split(' '))) for _ in range(m)]
war.sort(key=lambda x:x[1])
bridge=[0]*n
for w in war:
    if not 1 in set(bridge[w[0]:w[1]]):
        bridge[w[1]-1]=1
print(sum(bridge))

Fixed submission:
n,m=map(int,input().split(' '))
war=[tuple(map(int,input().split(' '))) for _ in range(m)]
war.sort(key=lambda x:x[1])
bridge=[0]*n
flag=0
for w in war:
    if not w[0]<=flag<w[1]:
        flag=w[1]-1
        bridge[flag]=1
print(sum(bridge))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split(' '))
war=[tuple(map(int,input().split(' '))) for _ in range(m)]
war.sort(key=lambda x:x[1])
bridge=[0]*n
for w in war:
    if sum(bridge[w[0]:w[1]])==0:
        bridge[w[1]-1]=1
print(sum(bridge))

Fixed submission:
n,m=map(int,input().split(' '))
war=[tuple(map(int,input().split(' '))) for _ in range(m)]
war.sort(key=lambda x:x[1])
bridge=[0]*n
flag=0
for w in war:
    if not w[0]<=flag<w[1]:
        flag=w[1]-1
        bridge[flag]=1
print(sum(bridge))
Buggy python submission (verdict: Time Limit Exceeded):
t=input()
s=''
trigger=1
app=['dream','dreamer','erase','eraser']
while len(s)<len(t) and trigger:
    for i in range(4):
        key=app[i]
        if s+key == t[:len(s)+len(key)]:
            s+=key
            break
        trigger==0
if s==t:
    print('YES')
else:
    print('NO')

Fixed submission:
t=input()
trigger=1
key=''
d=-1
app=['dreamer','eraser','dream','erase']
while len(t)>0 and trigger:
    for i in range(4):
        key=app[i]
        if key==t[:len(key)]:
            t=t[len(key):]
            trigger+=1
            d=i
            break
    trigger-=1
    if trigger==0 and d==0 and t[:3]=='ase':
        t='er'+t
        trigger+=1
if t=='':
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = [int(x) for x in input().split()]
total = 0

for i in range(0,n-1):
    total += nums[i]*sum(nums[i+1:n])

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

Fixed submission:
n = int(input())
nums = [int(x) for x in input().split()]
multinums = [0]
total = 0

for i in range(0,n):  #累積和配列を作成する
    multinums.append(multinums[i]+nums[i])

#print(multinums)

for i in range(0,n):
    #print(nums[i],multinums[n]-multinums[i+1],nums[i] * (multinums[n]-multinums[i+1]))
    total += nums[i] * (multinums[n]-multinums[i+1])

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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = [int(x) for x in input().split()]
multinums = []

for i in range(0,n-1):
    for j in range(i+1,n):
        #print(nums[i],nums[j])
        multinums.append(nums[i]*nums[j])

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

Fixed submission:
n = int(input())
nums = [int(x) for x in input().split()]
multinums = [0]
total = 0

for i in range(0,n):  #累積和配列を作成する
    multinums.append(multinums[i]+nums[i])

#print(multinums)

for i in range(0,n):
    #print(nums[i],multinums[n]-multinums[i+1],nums[i] * (multinums[n]-multinums[i+1]))
    total += nums[i] * (multinums[n]-multinums[i+1])

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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
nums = [int(x) for x in input().split()]
total = 0

for i in range(0,n-1):
    for j in range(i+1,n):
        #print(nums[i],nums[j])
        total += (nums[i]*nums[j])

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

Fixed submission:
n = int(input())
nums = [int(x) for x in input().split()]
multinums = [0]
total = 0

for i in range(0,n):  #累積和配列を作成する
    multinums.append(multinums[i]+nums[i])

#print(multinums)

for i in range(0,n):
    #print(nums[i],multinums[n]-multinums[i+1],nums[i] * (multinums[n]-multinums[i+1]))
    total += nums[i] * (multinums[n]-multinums[i+1])

print(total%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
n_copy = n
digit_sum = 0

while(n_copy != 0):
    #print(digit_sum, n_copy%10, n_copy//10)
    digit_sum += n_copy%10
    n_copy //= 10

#print(digit_sum)

if digit_sum%9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
num = int(input())
print("Yes") if num%9 == 0 else print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
stocks = [int(x) for x in input().split()]
mymoney = 1000
mystock = 0

for i in range(0,len(stocks)-1):     # コメントアウト部分はデバッグ用コード
      #print(stocks[i],stocks[i+1],end=":")
      if stocks[i] < stocks[i+1]:    # 明日の方が株価が高くなる場合は、今日のうちに株を買えるだけ買う
            #print("buying",end=" ")
            mystock = mymoney//stocks[i]
            mymoney = mymoney%stocks[i]
      elif stocks[i] >= stocks[i+1]:  # 明日の方が株価が安くなる場合には、今日のうちに手持ちの株を売却
            #print("selling",end=" ")
            mymoney += mystock*stocks[i]
            mystock = 0
      #print(mymoney,mystock)

i += 1
mymoney += mystock * stocks[i]      # 最終日に手持ちの株をすべて売却して現金化
mystock = 0

print(mymoney)

Fixed submission:
score = [1800,1600,1400,1200,1000, 800, 600, 400]
ranks = [   1,   2,   3,   4,   5,   6,   7,   8]

x = int(input())
i = 0

while(x < score[i]):
      i += 1

print(ranks[i])

Buggy python submission (verdict: Runtime Error):
score = [1800,1600,1400,1200,1000, 800, 600, 400]
ranks = [   1,   2,   3,   4,   5,   6,   7,   8]

x = int(input())
i = 0

while(x <= score[i]):
      i += 1

print(ranks[i])


Fixed submission:
score = [1800,1600,1400,1200,1000, 800, 600, 400]
ranks = [   1,   2,   3,   4,   5,   6,   7,   8]

x = int(input())
i = 0

while(x < score[i]):
      i += 1

print(ranks[i])

Buggy python submission (verdict: Runtime Error):
score = [1800,1600,1400,1200,1000, 800, 600, 400]
ranks = [   1,   2,   3,   4,   5,   6,   7,   8]

x = int(input())
i = 0

while(x <= score[i]):
      print(x,score[i])
      i += 1

print(ranks[i])

Fixed submission:
score = [1800,1600,1400,1200,1000, 800, 600, 400]
ranks = [   1,   2,   3,   4,   5,   6,   7,   8]

x = int(input())
i = 0

while(x < score[i]):
      i += 1

print(ranks[i])

Buggy python submission (verdict: Runtime Error):
score = [1999,1799,1599,1399,1199,999,799,599]
ranks = [   1,   2,   3,   4,   5,  6,  7,  8]

x = int(input())
i = 0

while(x <= score[i]):
      i += 1

print(ranks[i-1])


Fixed submission:
score = [1800,1600,1400,1200,1000, 800, 600, 400]
ranks = [   1,   2,   3,   4,   5,   6,   7,   8]

x = int(input())
i = 0

while(x < score[i]):
      i += 1

print(ranks[i])

Buggy python submission (verdict: Runtime Error):
score = [1999,1799,1599,1399,1199,999,799,599]

x = int(input())
i = 0

while(x <= score[i]):
      i += 1

print(i)

Fixed submission:
score = [1800,1600,1400,1200,1000, 800, 600, 400]
ranks = [   1,   2,   3,   4,   5,   6,   7,   8]

x = int(input())
i = 0

while(x < score[i]):
      i += 1

print(ranks[i])
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

for i in range(len(s)):
  if s[i] is not t[i]:
    i++

print(i)

Fixed submission:
s = input()
t = input()
j = 0
     
for i in range(len(s)):
      if s[i] is not t[i]:
            j += 1
     
print(j)
Buggy python submission (verdict: Time Limit Exceeded):
def numdiv(n):
    num=0
    for i in range(1,int(n**0.5)+1):
        if n%i==0:
            num+=1
            if n//i != i:
                num+=1
    return num
n = int(input())
ans = 0
for i in range(1,n):
    ans += numdiv(i)
print(ans)

Fixed submission:
n = int(input())
ans = 0
for i in range(1,n):
    ans += (n-1)//i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input().rstrip())
a = list(map(int,input().rstrip().split()))
mod = 1_000_000_007
ans = 0
for i in range(n):
    for j in range(i+1,n):
        ans = (ans+a[i]*a[j]%mod)%mod
print(ans%mod)

Fixed submission:
n = int(input().rstrip())
a = list(map(int,input().rstrip().split()))
mod = 1_000_000_007
ans = 0
tmp = 0
for i in range(n-1,0,-1):
    tmp = (tmp+a[i])%mod
    ans += (tmp*a[i-1])%mod
print(ans%mod)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input().rstrip())
a = list(map(int,input().rstrip().split()))
mod = 1_000_000_007
ans = 0
for i in range(n):
    for j in range(i+1,n):
        ans = (ans+a[i]*a[j]%mod)%mod
print(ans%mod)

Fixed submission:
n = int(input().rstrip())
a = list(map(int,input().rstrip().split()))
mod = 1_000_000_007
ans = 0
tmp = 0
for i in range(n-1,0,-1):
    tmp = (tmp+a[i])%mod
    ans += (tmp*a[i-1])%mod
print(ans%mod)
Buggy python submission (verdict: Runtime Error):
X, K, D = list(map(int,input().rstrip().split()))
X = abs(X)
a = X//D
if K <= a:
    print(abs(X-(D*K)))
elif (K-a)a%2 == 0:
    print(abs(X-(D*a)))
else:
    print(abs(D*(a+1)-X))

Fixed submission:
X, K, D = list(map(int,input().rstrip().split()))
X = abs(X)
a = X//D
if K <= a:
    print(abs(X-(D*K)))
elif (K-a)%2 == 0:
    print(abs(X-(D*a)))
else:
    print(abs(D*(a+1)-X))