Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n,x=map(int,input().split())
y=list(map(int,input().split()))
def gcd(num):
    return reduce(fractions.gcd, num)
ya=[abs(y[i]-x) for i in range(n)]
print(gcd(ya))

Fixed submission:
import fractions
from functools import reduce
n,x=map(int,input().split())
y=list(map(int,input().split()))
def gcd(num):
    return reduce(fractions.gcd, num)
ya=[abs(y[i]-x) for i in range(n)]
print(gcd(ya))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
A=list(map(int,input().split()))
B=[A[i]-i-1 for i in range(N)]
B.sort()
if N%2==0:
    b=B[N//2]
else:
    b=(B[N//2-1]+B[N//2])//2
print(int(sum([abs(Bb-b) for Bb in B])))


Fixed submission:
N=int(input())
if N%2==0:
    print(N)
else:
    print(2*N)
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
    while i%2==0:
        i/=2
        count+=1
print(count)

Fixed submission:
A,B=map(int,input().split())
if A>8 or B>8:
    print(':(')
else:
    print('Yay!')

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
    while b%2==0:
        b/=2
        count+=1
print(count)

Fixed submission:
A,B=map(int,input().split())
if A>8 or B>8:
    print(':(')
else:
    print('Yay!')
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
a=list(map(int,input().split()))
b=np.prod(a,dtype='int64')
count=0
while b%2==0:
    b/=2
    count+=1
print(count)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
    while i%2==0:
        i/=2
        count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
a=list(map(int,input().split()))
b=np.prod(a,dtype='int64')
count=0
while b%2==0:
    if b%2==1:
        break
    b/=2
    count+=1
print(count)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
count=0
for i in a:
    while i%2==0:
        i/=2
        count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=input()
cnt=[]
for i in range(N):
    count=0
    for j in range(N):
        if j<i and S[j]=='W':
            count+=1
        elif j>i and S[j]=='E':
            count+=1
    cnt.append(count)
print(min(cnt))


Fixed submission:
N=int(input())
S=input()
num=S[1:].count('E')
ans=num
for i in range(1,N):
    if S[i-1]=='W':
        num+=1
    if S[i]=='E':
        num-=1
    ans=min(num,ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int,input().split()))
Y=sorted(X)
for i in range(N):
    if X[i]<=Y[N//2-1]:
        print(Y[N//2])
    else:
        print(Y[N//2-1

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
Y=sorted(X)
for i in range(N):
    if X[i]<=Y[N//2-1]:
        print(Y[N//2])
    else:
        print(Y[N//2-1])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
X=list(map(int,input().split()))
for i in range(N):
    Z=X[:i]+X[i+1:]
    print(int(np.median(Z)))

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
Y=sorted(X)
for i in range(N):
    if X[i]<=Y[N//2-1]:
        print(Y[N//2])
    else:
        print(Y[N//2-1])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
X=list(map(int,input().split()))
for i in range(N):
    Z=sorted(X[:i]+X[i+1:])
    print(Z[N//2-1])

Fixed submission:
N=int(input())
X=list(map(int,input().split()))
Y=sorted(X)
for i in range(N):
    if X[i]<=Y[N//2-1]:
        print(Y[N//2])
    else:
        print(Y[N//2-1])
Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
ab=[int(i) for i in range(a,b+1)]
abx=ab[:k]+ab[-k:]
if (b-a+1)>=2*k:
    for i in abx:
        print(i)
else:
    for i in ab:
        print(i)

Fixed submission:
a,b,k=map(int,input().split())
l=range(a,b+1)
for i in sorted(set(l[:k])|set(l[-k:])):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k=map(int,input().split())
ab=[i for i in range(a,b+1)]
c=sorted(list(set(ab[:k]+ab[b-a-(k-1):])))
for j in range(len(c)):
    print(c[j])

Fixed submission:
a,b,k=map(int,input().split())
l=range(a,b+1)
for i in sorted(set(l[:k])|set(l[-k:])):
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[0]+list(map(int,input().split()))+[0]
anew=[]
for i in range(n+1):
    anew.append(abs(a[i]-a[i+1]))
for j in range(1,n+1):
    ans=sum(anew)-anew[j-1]-anew[j]+abs(a[j-1]-a[j+1])
    print(ans)

Fixed submission:
n=int(input())
a=[0]+list(map(int,input().split()))+[0]
s=sum(abs(a[i]-a[i+1]) for i in range(len(a)-1))
for i in range(1,n+1):
    print(s-abs(a[i]-a[i+1])-abs(a[i]-a[i-1])+abs(a[i-1]-a[i+1]))
Buggy python submission (verdict: Runtime Error):
N,Y=map(int,input().split())
Y=Y//1000
error='-1 -1 -1'

for x in range(N+1):
    for y in range(N+1-x):
            z=N-x-y
            if 10*x+5*y+z==Y and z>=0:
                ans=str(x[0])+' '+str(y[0])+' '+str(z[0])
                exit()
print(error)

Fixed submission:
N,Y=map(int,input().split())
Y=Y//1000
error='-1 -1 -1'

for x in range(N+1):
    for y in range(N+1-x):
            z=N-x-y
            if 10*x+5*y+z==Y and z>=0:
                print(str(x)+' '+str(y)+' '+str(z))
                exit()
print(error)
Buggy python submission (verdict: Runtime Error):
import bisect

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
c.sort()
count=0

for j in b:
   x=bisect.bisect_left(a,j)
   y=bisect.bisect_right(c,j)
   ans+=x*(N-l)
print(count)

Fixed submission:
import bisect

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
c.sort()
count=0

for j in b:
   x=bisect.bisect_left(a,j)
   y=bisect.bisect_right(c,j)
   count+=x*(N-y)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
ABC=[[int(i) for i in input().split()] for _ in range(3)]
b=[]
c=[]
count=0
for i in range(3):
    ABC[i].sort()

for j in range(N):
    b=[int(i) for i in ABC[1] if i>ABC[0][j]]
    for k in range(len(b)):
        c=[int(i) for i in ABC[2] if i>b[k]]
        count+=len(c)
print(count)

Fixed submission:
import bisect

N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
c.sort()
count=0

for j in b:
   x=bisect.bisect_left(a,j)
   y=bisect.bisect_right(c,j)
   count+=x*(N-y)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
cout=[]
sa=list(set(a))
for i in range(len(sa)):
    if a.count(sa[i])%2==1:
        cout.append(1)
print(len(cout))

Fixed submission:
import collections
n=int(input())
a=[int(input()) for i in range(n)]
ad=collections.Counter(a)
counter=0
for i in ad.values():
    if i%2==1:
        counter+=1
print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a.sort()
b=[a.count(a[0])+a.count(a[0]+1)]
for x in range(a[0]+1,a[-1]):
    b.append(a.count(x-1)+a.count(x)+a.count(x+1))
b.append(a.count(a[-1]-1)+a.count(a[-1]))
print(max(b))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
cnt=[0]*10**6
for i in a:
    cnt[i-1]+=1
    cnt[i]+=1
    cnt[i+1]+=1
print(max(cnt))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
sa=list(set(a))
sa=sorted(sa,reverse=True)
anew=[]
for i in range(len(sa)):
    if a.count(sa[i])>=2:
        anew.append(sa[i])
        if len(anew)==2:
            break
print(anew[0]*anew[1])

Fixed submission:
from collections import Counter
n=int(input())
a=list(map(int,input().split()))
c=Counter(a)
an=[]
for b,count in c.items():
    for _ in range(count//2):
        an.append(b)
an.sort(reverse=True)
if len(an)<2:
    print(0)
else:
    print(an[0]*an[1])
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split()) print((n-1)*(m-1))

Fixed submission:
n,m=map(int,input().split()) 
print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[int(input())-1 for _ in range(n)]
ans=-1
l=0
for i in range(n):
    l=a[l]
    cnt[l]+=1
    if l==1:
        ans=i+1
        break
print(ans)

Fixed submission:
n=int(input())
a=[int(input())-1 for _ in range(n)]
ans=-1
l=0
for i in range(n):
    l=a[l]
    if l==1:
        ans=i+1
        break
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans='LESS'
if a>b:
    ans='GREATER'
elif a==b:
    ans='EQUAL'
print(ans)

Fixed submission:
a=int(input())
b=int(input())
ans='LESS'
if a>b:
    ans='GREATER'
elif a==b:
    ans='EQUAL'
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
print(math.factorial(n)%(1e9+7))n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%(1e9+7)
print(int(ans))

Fixed submission:
n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%(1e9+7)
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
print(math.factorial(n)%(1e9+7))n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%(1e9+7)
print(ans)

Fixed submission:
n=int(input())
ans=1
for i in range(1,n+1):
    ans=(ans*i)%(1e9+7)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
s=input()
ls=len(s)
c=0
for i in range(ls):
    if s[i]=='S':
        c+=1
    elif c>0:
        ans+=2
        c-=1
print(ls-ans)

Fixed submission:
s=input()
ls=len(s)
c=0
ans=0
for i in range(ls):
    if s[i]=='S':
        c+=1
    elif c>0:
        ans+=2
        c-=1
print(ls-ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
a,b=map(int,input().split())
num=[x for x in range(a,b+1)]
p=np.prod(num)
if p>0:
    print('Positive')
elif p<0:
    print('Negative')
else:
    print('Zero')

Fixed submission:
a,b=map(int,input().split())
if 0<a<=b:
    print('Positive')
elif a<=b<0:
    if (b-a+1)%2==0:
        print('Positive')
    else:
        print('Negative')
else:
    print('Zero')
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
s=[input() for i in range(n)]
print(''.join(sorted(s))

Fixed submission:
n,l=map(int,input().split())
s=[input() for i in range(n)]
print(''.join(sorted(s)))
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
cnt = N//(A+B)+1

br = ''
for i in range(cnt):
    br += 'b'*A + 'r'*B

br = br[:N]
print(br.count('b'))

Fixed submission:
N, A, B = map(int, input().split())
cnt = N//(A+B)
res = A*cnt

if N-cnt*(A+B)>A:
    print(res+A)
else:
    print(res+N-cnt*(A+B))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
for i in range(Q):
    q = list(map(str,input().split()))
    if q[0]=='1':
        S = S[::-1]
    else:#q[0]=='2'
        if q[1]=='1':
            S = q[2] + S
        else:#q[1]=='2'
            S = S + q[2]
print(S)

Fixed submission:
from collections import deque
S = deque(input())
Q = int(input())
Query = [[] for _ in range(Q)]
for i in range(Q):
    Query[i] = list(map(str,input().split()))

fl = False
for q in Query:
    if q[0]=='1':
        fl = not fl
    else:#q[0]=='2'
        if (q[1]=='1') ^ fl:
            S.appendleft(q[2])
        else:#q[1]=='2'
            S.append(q[2])
T = ''.join(S)
if fl:
    T = T[::-1]
print(T)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
Query = [[] for _ in range(Q)]
for i in range(Q):
    Query[i] = list(map(str,input().split()))

for q in Query:
    if q[0]=='1':
        S = S[::-1]
    else:#q[0]=='2'
        if q[1]=='1':
            S = q[2] + S
        else:#q[1]=='2'
            S = S + q[2]
print(S)

Fixed submission:
from collections import deque
S = deque(input())
Q = int(input())
Query = [[] for _ in range(Q)]
for i in range(Q):
    Query[i] = list(map(str,input().split()))

fl = False
for q in Query:
    if q[0]=='1':
        fl = not fl
    else:#q[0]=='2'
        if (q[1]=='1') ^ fl:
            S.appendleft(q[2])
        else:#q[1]=='2'
            S.append(q[2])
T = ''.join(S)
if fl:
    T = T[::-1]
print(T)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
Q = int(input())
Query = []*Q
for _ in range(Q):
    Query.append(list(map(str,input().split())))

for q in Query:
    if q[0]=='1':
        S = S[::-1]
    else:#q[0]=='2'
        if q[1]=='1':
            S = q[2] + S
        else:#q[1]=='2'
            S = S + q[2]
print(S)


Fixed submission:
from collections import deque
S = deque(input())
Q = int(input())
Query = [[] for _ in range(Q)]
for i in range(Q):
    Query[i] = list(map(str,input().split()))

fl = False
for q in Query:
    if q[0]=='1':
        fl = not fl
    else:#q[0]=='2'
        if (q[1]=='1') ^ fl:
            S.appendleft(q[2])
        else:#q[1]=='2'
            S.append(q[2])
T = ''.join(S)
if fl:
    T = T[::-1]
print(T)
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
p = list(map(int, input().split()))

S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + (1+p[i])/2

ans = 0
for i in range(N-K+1):
  diff = S[i+K] - S[i]
  ans = max(ans, diff)
print(ans)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
if len(a)==len(set(a)):
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
answer = list(map(lambda x: (1+x)/2, list(map(int, input().split()))))
total = 0
for i in range(0,N-K+1):
    total = max(total, sum(answer[i:i+K]))
print(total)

Fixed submission:
N, K = map(int, input().split())
p = list(map(int, input().split()))

S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + (1+p[i])/2

ans = 0
for i in range(N-K+1):
  diff = S[i+K] - S[i]
  ans = max(ans, diff)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
answer = list(map(lambda x: sum(range(1,x+1))/x, list(map(int, input().split()))))
total = 0
for i in range(0,N-K+1):
    total = max(total, sum(answer[i:i+K]))
print(total)

Fixed submission:
N, K = map(int, input().split())
p = list(map(int, input().split()))

S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + (1+p[i])/2

ans = 0
for i in range(N-K+1):
  diff = S[i+K] - S[i]
  ans = max(ans, diff)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int, input().split())
answer = list(map(lambda x: sum(range(1,x+1))/x, list(map(int, input().split()))))
total = 0
for i in range(0,N-K+1):
    total = max(total, sum(answer[i:i+K]))
print(total)

Fixed submission:
N, K = map(int, input().split())
p = list(map(int, input().split()))

S = [0]*(N+1)
for i in range(N):
  S[i+1] = S[i] + (1+p[i])/2

ans = 0
for i in range(N-K+1):
  diff = S[i+K] - S[i]
  ans = max(ans, diff)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
p = list(map(int, input().split()))
M = []
for i in range(N):
    M.append(min(p[:i+1]))

cnt = 0
for i in range(N):
    if p[i]==M[i]:
        cnt += 1
print(cnt)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
p = list(map(int, readline().split()))
cnt = n
for i in range(n):
    if not all(p[i]<=p[j] for j in range(i+1)):
        cnt -= 1
print(cnt)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
p = list(map(int, readline().split()))
cnt = n
for i in range(n):
    if not all(p[i]<=p[j] for j in range(i+1)):
        cnt -= 1
print(cnt)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
p = list(map(int, readline().split()))
cnt = 0
for i in range(n):
    if all(p[i]<=p[j] for j in range(i+1)):
        cnt += 1
print(cnt)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = n
for i in range(n):
    if not all(p[i]<=p[j] for j in range(i+1)):
        cnt -= 1
print(cnt)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = n
for i in range(n):
    if not all(p[i]<=p[j] for j in range(i+1)):
        cnt -= 1
print(cnt)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if all(p[i]<=p[j] for j in range(i+1)):
        cnt += 1

print(cnt)

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

cnt = 0
m = 10**6
for i in p:
    if i < m:
        m = i
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import functools
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(nums):
        return functools.reduce(lcm, nums)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

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

Fixed submission:
import functools

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

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n

def lcm_list(nums):
        return functools.reduce(lcm, nums)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

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

Buggy python submission (verdict: Runtime Error):
import functools
import math

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
    return functools.reduce(lcm, numbers, 1)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

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

Fixed submission:
import functools

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

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n

def lcm_list(nums):
        return functools.reduce(lcm, nums)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

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

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

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

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

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

Fixed submission:
import functools

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

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n

def lcm_list(nums):
        return functools.reduce(lcm, nums)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

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

Buggy python submission (verdict: Runtime Error):
from functools import reduce
from math import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
def lcm_list(numbers):
    return reduce(lcm, numbers, 1)

n = int(input())
a = list(map(int, input().split()))
b = [0]*n

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

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

Fixed submission:
import functools

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

def gcd(m, n):
    r = m % n
    return gcd(n, r) if r else n

def lcm(m, n):
    return m//gcd(m, n)*n

def lcm_list(nums):
        return functools.reduce(lcm, nums)

lcm_a = lcm_list(a)

b = [lcm_a//a[i] for i in range(n)]

print(sum(b) % ((10**9)+7))
Buggy python submission (verdict: Runtime Error):
n, k ,s = map(int, input().split())
ans = []

if s<10**9:
    for i in range(n):
        if i <= k-1:
            ans.append(s)
        else:
            ans.append(s+1)
elif s==10**9:
    for j in range(n):
        if i <= k-1:
            ans.append(s)
        else:
            ans.append(1)
ans = map(str, ans)
print(' '.join(ans))


Fixed submission:
n, k ,s = map(int, input().split())
ans = []

if s<10**9:
    for i in range(n):
        if i <= k-1:
            ans.append(s)
        else:
            ans.append(s+1)
elif s==10**9:
    for j in range(n):
        if j <= k-1:
            ans.append(s)
        else:
            ans.append(1)
ans = map(str, ans)
print(' '.join(ans))

Buggy python submission (verdict: Runtime Error):
n, k ,s = map(int, input().split())
ans = []

if s<10**9:
    for i in range(n):
        if i <= k:
            ans.append(s)
        else:
            ans.append(s+1)
elif s==10**9:
    for j in range(n):
        if i <= k:
            ans.append(s)
        else:
            ans.append(1)
ans = map(str, ans)
print(' '.join(ans))

Fixed submission:
n, k ,s = map(int, input().split())
ans = []

if s<10**9:
    for i in range(n):
        if i <= k-1:
            ans.append(s)
        else:
            ans.append(s+1)
elif s==10**9:
    for j in range(n):
        if j <= k-1:
            ans.append(s)
        else:
            ans.append(1)
ans = map(str, ans)
print(' '.join(ans))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())


li = []

for i in range(m):
    p,q = map(str, input().split())
    li.append((int(p),q))

wa = 0

se = {i for i in li if i[1]=='AC'}
ac = len(se)

flag = True
for i in range(m-1):
    if li[i][0]!=li[i+1][0]:
        flag = True
    elif li[i][0]==li[i+1][0] and li[i][1]=='AC':
        flag = False
    elif li[i][0]==li[i+1][0] and li[i][1]=='WA' and flag:
        wa += 1

print(ac, wa)

Fixed submission:
import string
c = input()

upper = string.ascii_lowercase
ind = upper.index(c)
print(upper[ind+1])