Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
ans=0
for i in range(n-1):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=input()
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)

Fixed submission:
n=int(input())-1
l=list(map(int,input().split()))
l.sort()
m=n//2
if l[m]==l[m+1]:
    print(0)
else:
    print(l[m+1]-l[m])
Buggy python submission (verdict: Runtime Error):
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

Fixed submission:
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12) or (int(f)>12 and l=="00") or (int(l)>12 and f=="00") :
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 or l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

Buggy python submission (verdict: Runtime Error):
n=input():
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12):
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")

Fixed submission:
n=input()
f=n[:2]
l=n[2:]
if (f=="00" and l=="00") or (int(f)>12 and int(l)>12) or (int(f)>12 and l=="00") or (int(l)>12 and f=="00") :
    print("NA")
elif int(f)>12 or f=="00":
    print("YYMM")
elif int(l)>12 or l=="00":
    print("MMYY")
else:
    print("AMBIGUOUS")
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):    
    predp=dp[i-1]+abs(l[i]-l[i-1])
    for j in range(2,k+1):
        if i-j>=0 :
            predp=min(predp,dp[i-j]+abs(l[i]-l[i-j]))
    dp[i]=predp
print(dp[-1])

Fixed submission:
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):    
    start=max(0,i-k)
    dp[i]=min(dp[j]+abs(l[i]-l[j]) for j in range(start,i))
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]
for i in range(1,n):    
    predp=dp[i-1]+abs(l[i]-l[i-1])
    for j in range(2,k+1):
        if i-j>=0 :
            predp=min(predp,dp[i-j]+abs(l[i]-l[i-j]))
    dp.append(predp)  
print(dp[-1])

Fixed submission:
n,k=map(int,input().split())
l=list(map(int,input().split()))
dp=[0]*n
for i in range(1,n):    
    start=max(0,i-k)
    dp[i]=min(dp[j]+abs(l[i]-l[j]) for j in range(start,i))
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input.split())
print(x+y/2)

Fixed submission:
x,y=map(int,input().split())
print(int(x+y/2))
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n%2==0:
    print((n//2)*(n//2+1)
else:
    print((n//2)**2)

Fixed submission:
n=int(input())
if n%2==1:
    print((n//2)*(n//2+1))
else:
    print((n//2)**2)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a=<8 and b=<8:
    print("Yay!")
else:
    print(":(")

Fixed submission:
a,b=map(int,input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a=<8 and b<=8:
    print("Yay!")
else:
    print(":(")

Fixed submission:
a,b=map(int,input().split())
if a<=8 and b<=8:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
a,b=map(input().split())
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")

Fixed submission:
a,b=input().split()
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")

Fixed submission:
a,b=input().split()
if (a=="H" and b=="H") or (a=="D" and b=="D"):
    print("H")
else:
    print("D")
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
print(a+" "+b+" "+c)

Fixed submission:
a=input()
l=a.split(",")
print(l[0]+" "+l[1]+" "+l[2])
Buggy python submission (verdict: Time Limit Exceeded):
# http://www.nct9.ne.jp/m_hiroi/puzzle/prime.html
def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff

# http://www.nct9.ne.jp/m_hiroi/puzzle/divisor.html#ans03
def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

N = int(input())
ans = 0
for i in range(1, N):
    ans += divisor_num(N-i)

print(ans)

Fixed submission:
N = int(input())
ans = 0
a = 1
while(a < N):
    ans += (N-1)//a # bmax
    a += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# http://www.nct9.ne.jp/m_hiroi/puzzle/prime.html
def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff

# http://www.nct9.ne.jp/m_hiroi/puzzle/divisor.html#ans03
def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a

N = int(input())
ans = 0
for i in range(1, N):
    ans += divisor_num(N-i)

print(ans)

Fixed submission:
N = int(input())
ans = 0
a = 1
while(a < N):
    ans += (N-1)//a # bmax
    a += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
if x1+y1 > x2+y2:
    xmax = x1+y1
    xmin = x2+y2
else:
    max1 = x2+y2
    min1 = x1+y1

if x1-y1 > x2-y2:
    max2 = x1-y1
    min2 = x2-y2
else:
    max2 = x2-y2
    min2 = x1-y1

for i in range(N-2):
    x, y = map(int, input().split())
    if x+y > max1:
        max1 = x+y
    elif x+y < min1:
        min1 = x+y
    
    if x-y > max2:
        max2 = x-y
    elif x-y < min2:
        min2 = x-y

print(max((max1-min1), (max2-min2)))

Fixed submission:
N = int(input())
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
if x1+y1 > x2+y2:
    max1 = x1+y1
    min1 = x2+y2
else:
    max1 = x2+y2
    min1 = x1+y1

if x1-y1 > x2-y2:
    max2 = x1-y1
    min2 = x2-y2
else:
    max2 = x2-y2
    min2 = x1-y1

for i in range(N-2):
    x, y = map(int, input().split())
    if x+y > max1:
        max1 = x+y
    elif x+y < min1:
        min1 = x+y
    
    if x-y > max2:
        max2 = x-y
    elif x-y < min2:
        min2 = x-y


ans = print(max((max1-min1),(max2-min2)))
Buggy python submission (verdict: Runtime Error):
K = int(input())
ans = 1
X = 7
cnt = K
while(cnt > 0):
#     print('rem={}'.format(X%K))
    rem = X % K
    if rem == 0:
        print(ans)
        break
    else:
        remlst.append(rem)
        ans += 1
        X = rem*10 + 7 
        cnt -= 1

if rem != 0:
    print(-1)

Fixed submission:
K = int(input())
ans = 1
X = 7
cnt = K
while(cnt > 0):
#     print('rem={}'.format(X%K))
    rem = X % K
    if rem == 0:
        print(ans)
        break
    else:
        ans += 1
        X = rem*10 + 7 
        cnt -= 1

if rem != 0:
    print(-1)

Buggy python submission (verdict: Runtime Error):
K = int(input())
ans = 1
X = 7
cnt = K
while(cnt > 0):
#     print('rem={}'.format(X%K))
    rem = X % K
    if rem == 0:
        print(ans)
        break
    else:
        remlst.append(rem)
        ans += 1
        X = rem*10 + 7 
        cnt -= 1

if cnt == 0:
    print(-1)

Fixed submission:
K = int(input())
ans = 1
X = 7
cnt = K
while(cnt > 0):
#     print('rem={}'.format(X%K))
    rem = X % K
    if rem == 0:
        print(ans)
        break
    else:
        ans += 1
        X = rem*10 + 7 
        cnt -= 1

if rem != 0:
    print(-1)
Buggy python submission (verdict: Runtime Error):
import itertools

H, W, K = map(int, input().split())
c = [['.' for j in range(6)] for i in range(6)]
for i in range(H):
    tmp = str(input())
    for j in range(len(tmp)):
        c[i][j] = tmp[j]
    
hp = list(itertools.product([0,1], repeat=H))
wp = list(itertools.product([0,1], repeat=W))

hl = []
for elem in hp:
    hl.append([i for i, x in enumerate(list(elem)) if x == 1])
wl = []
for elem in wp:
    wl.append([i for i, x in enumerate(list(elem)) if x == 1

def func(hli, wli, c):
    tmp = 0
    for i in range(len(hli)):
        for j in range(len(wli)):
            if c[hli[i]][wli[j]] == '#':
                tmp += 1 
            
    return tmp

ans  = 0
for hli in hl:
    for wli in wl:
        if func(hli, wli, c) == K:
            ans += 1

print(ans)   

Fixed submission:
import itertools

H, W, K = map(int, input().split())
c = [['.' for j in range(6)] for i in range(6)]
for i in range(H):
    tmp = str(input())
    for j in range(len(tmp)):
        c[i][j] = tmp[j]
    
hp = list(itertools.product([0,1], repeat=H))
wp = list(itertools.product([0,1], repeat=W))

hl = []
for elem in hp:
    hl.append([i for i, x in enumerate(list(elem)) if x == 1])
wl = []
for elem in wp:
    wl.append([i for i, x in enumerate(list(elem)) if x == 1])

# print(hl)
# print(wl)


def func(hli, wli, c):
    tmp = 0
    for i in range(len(hli)):
        for j in range(len(wli)):
            if c[hli[i]][wli[j]] == '#':
                tmp += 1 
            
    return tmp


ans  = 0
for hli in hl:
    for wli in wl:
        if func(hli, wli, c) == K:
            ans += 1


print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

T = [False]*(10**6+1)
D = [0]*(10**6+1)
for i in A:
    # iの2以上の倍数の値はTrueに
    for j in range(i*2, 10**6+1, i):
        T[j] = True
    # ダブってる値は2以上に
    D[i] += 1

# TがFalseかつDが1の数を数える
ans = 0
for i in A:
    if T[i] == False and D[i] == 1:
        ans += 1

print(ans)

Fixed submission:
x1, x2, x3, x4, x5 = map(int, input().split())
if x1 == 0:
    print(1)
elif x2 == 0:
    print(2)
elif x3 == 0:
    print(3)
elif x4 == 0:
    print(4)
elif x5 == 0:
    print(5)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input().split()

for i in range(a):
    if b[i] == 0:
        print(0)
        return

c = 1
for i in range(a):
    c = c*int(b[i])
    if c > 1000000000000000000:
        break

if c > 1000000000000000000:
    print(-1)
else:
    print(c)

Fixed submission:
a = int(input())
b = input().split()
c = 1
for i in range(a):
    if int(b[i]) == 0:
        c = 0

if c == 1:
    for i in range(a):
        c = c*int(b[i])
        if c > 1000000000000000000:
            break

if c > 1000000000000000000:
    print(-1)
else:
    print(c)

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = input().split()
c = 1
for i in range(a):
    if b[i] == 0:
        c = 0
        break

    c = c*int(b[i])

if c > 1000000000000000000:
    print(-1)
else:
    print(c)

Fixed submission:
a = int(input())
b = input().split()
c = 1
for i in range(a):
    if int(b[i]) == 0:
        c = 0

if c == 1:
    for i in range(a):
        c = c*int(b[i])
        if c > 1000000000000000000:
            break

if c > 1000000000000000000:
    print(-1)
else:
    print(c)

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = input().split()
c = 1
for i in range(a):
    c = c*int(b[i])

if c > 1000000000000000000:
    print(-1)
else:
    print(c)    

Fixed submission:
a = int(input())
b = input().split()
c = 1
for i in range(a):
    if int(b[i]) == 0:
        c = 0

if c == 1:
    for i in range(a):
        c = c*int(b[i])
        if c > 1000000000000000000:
            break

if c > 1000000000000000000:
    print(-1)
else:
    print(c)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# あまりの計算
b = a - (a%10)*10
# 出力するテキスト
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
  out = 'hon'
elif b == 0 or b == 1 or b == 6 or b == 8:
  out = 'pon'
elif b == 3:
  out = 'bon'
# 出力
print("{}".format(out))

Fixed submission:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# あまりの計算
b = a%10
# 出力するテキスト
if b == 2 or b == 4 or b == 5 or b == 7 or b == 9:
  out = 'hon'
elif b == 0 or b == 1 or b == 6 or b == 8:
  out = 'pon'
elif b == 3:
  out = 'bon'
# 出力
print("{}".format(out))
Buggy python submission (verdict: Time Limit Exceeded):
A, B, N = map(int, input().split())

# x=0の場合、値は0
ans = 0
# x=1～Nについて
for x in range(1, min(B+1,N+1)):
    if (A*x)//B - A*(x//B) > ans:
        ans = (A*x)//B - A*(x//B)
        
print(ans)

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

if N>=B:
    print(A*(B-1)//B)
else:
    print(A*N//B)

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

# x=0の場合、値は0
ans = 0
# x=1～Nについて
for x in range(1, N+1):
    if (A*x)//B - A*(x//B) > ans:
        ans = (A*x)//B - A*(x//B)
        
print(ans)

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

if N>=B:
    print(A*(B-1)//B)
else:
    print(A*N//B)

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

# x=0の場合、値は0
ans = 0
# x=1～Nについて
for x in range(1, N+1):
    if (A*x)//B - A*(x//B) > ans:
        ans = (A*x)//B - A*(x//B)
        
print(ans)

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

if N>=B:
    print(A*(B-1)//B)
else:
    print(A*N//B)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = []
for i in range(N):
    S = str(input())
    if S not in lst:
        lst.append(S)

print(len(lst))


Fixed submission:
N = int(input())
lst = {}
for i in range(N):
    S = str(input())
    if S not in lst.keys():
        lst[S] = []

print(len(lst))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = []
for i in range(N):
    S = str(input())
    if S not in lst:
        lst.append(S)

print(len(lst))

Fixed submission:
N = int(input())
lst = {}
for i in range(N):
    S = str(input())
    if S not in lst.keys():
        lst[S] = []

print(len(lst))
Buggy python submission (verdict: Time Limit Exceeded):
import math

K = int(input())

ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += math.gcd(math.gcd(a, b),c)

print(ans)

Fixed submission:
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a

K = int(input())

ans = 0
for a in range(1,K+1):
    for b in range(1,K+1):
        for c in range(1,K+1):
            ans += gcd(gcd(a, b),c)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = str(input())

R = []
G = []
B = []

for i in range(1,N+1):
    if S[i-1] == 'R':
        R.append(i)
    elif S[i-1] == 'G':
        G.append(i)
    elif S[i-1] == 'B':
        B.append(i)

ans = 0
for a in R:
    for b in G:
        for c in B:
            i = min(a,b,c)
            k = max(a,b,c)
            j = a+b+c-i-k
            if j-i != k-j:
                ans += 1


print(ans)

Fixed submission:
N = int(input())
S = str(input())

r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt*g_cnt*b_cnt

for i in range(N):
    for d in range(1, N):
        j = i + d
        k = j + d
        if k >= N:break
        if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
            ans -= 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = str(input())

ans = 0
for k in range(3,N+1):
    for j in range(2,k):
        if S[k-1] != S[j-1]:
            for i in range(1,j):
                if S[k-1] != S[i-1] and S[j-1] != S[i-1] and j-i != k-j:
                    ans += 1

print(ans)

Fixed submission:
N = int(input())
S = str(input())

r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt*g_cnt*b_cnt

for i in range(N):
    for d in range(1, N):
        j = i + d
        k = j + d
        if k >= N:break
        if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
            ans -= 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N = int(input())
S = str(input())

c = list(itertools.combinations_with_replacement(list(range(1,N+1)), 3))

ans = 0
for i in range(len(c)):
    if S[c[i][0]-1] != S[c[i][1]-1] and S[c[i][0]-1] != S[c[i][2]-1] and S[c[i][1]-1] != S[c[i][2]-1] and c[i][1]-c[i][0] != c[i][2]-c[i][1]:
        ans += 1

print(ans)

Fixed submission:
N = int(input())
S = str(input())

r_cnt = S.count('R')
g_cnt = S.count('G')
b_cnt = S.count('B')

ans = r_cnt*g_cnt*b_cnt

for i in range(N):
    for d in range(1, N):
        j = i + d
        k = j + d
        if k >= N:break
        if S[i]!=S[j] and S[i]!=S[k] and S[j]!=S[k]:
            ans -= 1

print(ans)
Buggy python submission (verdict: Runtime Error):
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3 or s == 4:
  print(1)
else:
  array = np.zeros(s)
  array[2] = 1
  array[3] = 1
  for i in range(4, s):
    array[i] = (array[i-1] + array[i-3]) % mod
  print(array[s])

Fixed submission:
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s+1)
  array[0] = 1
  for i in range(3, s+1):
    array[i] = np.sum(array[:i-2]) % mod
  print(int(array[s]))

Buggy python submission (verdict: Runtime Error):
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3 or s == 4:
  print(1)
else:
  array = np.zeros(s)
  array[2] = 1
  array[3] = 1
  for i in range(4, s):
    array[i] = (array[i-1] + array[i-3]) % mod
  print(array[s])


Fixed submission:
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s+1)
  array[0] = 1
  for i in range(3, s+1):
    array[i] = np.sum(array[:i-2]) % mod
  print(int(array[s]))

Buggy python submission (verdict: Runtime Error):
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3 or s == 4:
  print(1)
else:
	array = np.zeros(s)
	array[2] = 1
	array[3] = 1
    for i in range(4, s):
      array[i] = (array[i-1] + array[i-3]) % mod
	print(array[s])

Fixed submission:
s = int(input())
mod = 10**9+7
import numpy as np

if s == 1 or s == 2:
  print(0)
elif s == 3:
  print(1)
else:
  array = np.zeros(s+1)
  array[0] = 1
  for i in range(3, s+1):
    array[i] = np.sum(array[:i-2]) % mod
  print(int(array[s]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = list(map(int, input().split())
s=0
ss=0
for i in range(n):
    ss += a[i]%mod
    s += ss * a[i] % mod
print(s)


Fixed submission:
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = list(map(int, input().split()))
s=0
ss=0
for i in range(n):
    if i > 0:
        ss += a[i-1]%mod
    s += ss * a[i] % mod
print(s%mod)

Buggy python submission (verdict: Runtime Error):
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = np.array(map(int, input().split())
s=0
ss=0
for i in range(n):
  ss += a[i]%mod
  s += ss * a[i] % mod
print(s)

Fixed submission:
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = list(map(int, input().split()))
s=0
ss=0
for i in range(n):
    if i > 0:
        ss += a[i-1]%mod
    s += ss * a[i] % mod
print(s%mod)

Buggy python submission (verdict: Runtime Error):
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = np.array(map(int, input().split())
s=0
ss=0
for i in range(n):
    ss += a[i]%mod
    s += ss * a[i] % mod
print(s)

Fixed submission:
n = int(input())
mod = 10 ** 9 + 7
import numpy as np
a = list(map(int, input().split()))
s=0
ss=0
for i in range(n):
    if i > 0:
        ss += a[i-1]%mod
    s += ss * a[i] % mod
print(s%mod)
Buggy python submission (verdict: Runtime Error):
N = int(input()) 
ans='' 
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26) N //= 26
print(ans[::-1])

Fixed submission:
N = int(input()) 
ans='' 
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26) 
    N //= 26
print(ans[::-1])

Buggy python submission (verdict: Runtime Error):
N = int(input()) ans='' whileN>0:
N -= 1
ans += chr(ord('a') + N % 26) N //= 26
print(ans[::-1])

Fixed submission:
N = int(input()) 
ans='' 
while N>0:
    N -= 1
    ans += chr(ord('a') + N % 26) 
    N //= 26
print(ans[::-1])
Buggy python submission (verdict: Runtime Error):
array = list(map(int, input().split()))                                                        
  
sort_array = array.sort()
 
for i in range(len(array)):
    if i == 0 and sort_array[i] == 5:
        continue
    elif  i==0 and not(sort_array[i]) == 5:
        print("No")
        break
 
    if i==1 and sort_array[i] == 5:
        continue
    elif  i==1 and not(sort_array[i]) == 5:
        print("No")
        break
 
 
    if i==2 and sort_array[i] == 7:
        print("YES")
    elif  i==2  and not(sort_array[i]) == 7:
        print("NO")
        break


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

if array[0] == 5 and array[1] == 5 and array[2] == 7:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
array = list(map(int, input().split()))                                                        
  
sort_array = array.sort()
 
for i in range(len(array)):
    if i == 0 and array[i] == 5:
        continue
    elif  i==0 and not(array[i]) == 5:
        print("No")
        break
 
    if i==1 and array[i] == 5:
        continue
    elif  i==1 and not(array[i]) == 5:
        print("No")
        break
 
 
    if i==2 and array[i] == 7:
        print("Yes")
    elif  i==2  and not(array[i]) == 7:
        print("No")
        break
~                        


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

if array[0] == 5 and array[1] == 5 and array[2] == 7:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
[D T S] = [int(i) for i in input().split()]
if D <= T * S:
  print("yes")
else:
  print("no")
 

Fixed submission:
[D, T, S] = [int(i) for i in input().split()]
if D <= T * S:
  print("Yes")
else:
  print("No")