Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#19 Grid Coloring
h,w=map(int,input().split() )
n=int(input())
a=list(map(int,input().split()))

import numpy as np

lis=[]
for i in range(n):
    lis.extend([i+1]*a[i])

lis = np.array(lis).reshape((h,w))

for i in range(1,h,2):
    lis[i] = lis[i][::-1]

for i in range(h):
    print(*lis[i])

Fixed submission:
#19 Grid Coloring
h,w=map(int,input().split() )
n=int(input())
a=list(map(int,input().split()))


import numpy as np

lis=[]
for i in range(n):
    lis.extend([i+1]*a[i])

lis = np.array(lis).reshape((h,w))

for i in range(1,h,2):
    lis[i] = lis[i][::-1]

for i in range(h):
    print(*lis[i])
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
h =[0]*n
for i in range(n):
    h[i]=int(input())
def hantei(now):
    ab=a-b
    nokori = sum(kiriage( max(0,hh-now*b) ,ab)//ab  for hh in h)
    return nokori<=now
def kiriage(x,c):
    if x%c==0:
        return x
    else:
        return (x//c+1) *c

ma = 10**9//b +1
mi = 1
while mi<ma:
    now=(mi+ma)//2
    which = hantei(now)
#     print(which,mi,now,ma)
    if which:
        ma=now
        ans=now
    else:
        mi=now+1
print(ans)

Fixed submission:
n,a,b = map(int,input().split())
h =[0]*n
for i in range(n):
    h[i]=int(input())

def hantei(now):
    ab=a-b
    nokori = sum(kiriage( max(0,hh-now*b) ,ab)//ab  for hh in h)
    return nokori<=now
def kiriage(x,c):
    if x%c==0:
        return x
    else:
        return (x//c+1) *c

ma = 10**9 +1
mi = 1

while mi<ma:
    now=(mi+ma)//2
    which = hantei(now)
#     print(which,mi,now,ma)
    if which:
        ma=now
        ans=now
    else:
        mi=now+1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
h =[0]*n
for i in range(n):
    h[i]=int(input())
def hantei(now):
    ab=a-b
    nokori = sum(kiriage( max(0,hh-now*b) ,ab)//(ab)  for hh in h)
    return nokori<=now
def kiriage(x,c):
    if x%c==0:
        return x
    else:
        return (x//c+1) *c

ma = 10**9//b +1
mi = 1
while mi<ma:
    now=(mi+ma)//2
    which = hantei(now)
#     print(which,mi,now,ma)
    if which:
        ma=now
        ans=now
    else:
        mi=now+1
print(ans)

Fixed submission:
n,a,b = map(int,input().split())
h =[0]*n
for i in range(n):
    h[i]=int(input())

def hantei(now):
    ab=a-b
    nokori = sum(kiriage( max(0,hh-now*b) ,ab)//ab  for hh in h)
    return nokori<=now
def kiriage(x,c):
    if x%c==0:
        return x
    else:
        return (x//c+1) *c

ma = 10**9 +1
mi = 1

while mi<ma:
    now=(mi+ma)//2
    which = hantei(now)
#     print(which,mi,now,ma)
    if which:
        ma=now
        ans=now
    else:
        mi=now+1
print(ans)
Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
anses=[]
for i in range(0,len(s)-len(t),1):
    cnt=0
    for j in range(len(t)):
        if s[i+j]==t[j]:
            cnt+=1
    anses.append(cnt)
print(len(t)-max(anses))

Fixed submission:
s=input()
t=input()
anses=[]
for i in range(0,len(s)-len(t)+1,1):
    cnt=0
    for j in range(len(t)):
        if s[i+j]==t[j]:
            cnt+=1
    anses.append(cnt)
print(len(t)-max(anses))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
A=list(map(int,input().split(" ")))
ans=0
base=10**9+7
for i in range(len(A)-1):
    for j in range(i+1,len(A),1):
        ans+=A[i]*A[j]
        ans%=base
print(ans)

Fixed submission:
n=int(input())
A=list(map(int,input().split(" ")))

base=10**9+7
s=0
for i in range(1,len(A),1):
    s=(s+A[i])%base
ans=0
for i in range(len(A)-1):
    ans=(ans+(A[i]*s))%base
    s=(s-A[i+1]+base)%base
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,k=list(map(int,input().split()))
lis=[1]*a+[0]*b+[-1]*c
max=0
for i in range(k):
    max+=lis[i]
print(max)


Fixed submission:
a,b,c,k=list(map(int,input().split()))
max=0
if k>=a:
    max+=a
    if k>=a+b:
        max-=k-a-b
else:
    max+=k
print(max)
Buggy python submission (verdict: Runtime Error):
import numpy as np

n,m,x=list(map(int,input().split()))
lis=[]
for i in range(n):
    l=list(map(int,input().split()))
    lis.append(l)


min=-1
for nnn in range(2**n):
    index=[]
    a=nnn
    for i in range(n):
        index.append(a%2)
        a//=2

    money=0
    xs=np.zeros(n)
    for i in range(n):
        if index[i]==1:
            money+=lis[i][0]
            xs+=np.array(lis[i][1:])
    if np.amin(xs)>=x:
        if min==-1:
            min=money
        elif min>money:
            min=money
print(min)

Fixed submission:
import numpy as np

n,m,x=list(map(int,input().split()))
lis=[]
for i in range(n):
    l=list(map(int,input().split()))
    lis.append(l)


min=-1
for nnn in range(2**n):
    index=[]
    a=nnn
    for i in range(n):
        index.append(a%2)
        a//=2

    money=0
    xs=np.zeros(m)
    for i in range(n):
        if index[i]==1:
            money+=lis[i][0]
            xs+=np.array(lis[i][1:])
    if np.amin(xs)>=x:
        if min==-1:
            min=money
        elif min>money:
            min=money

print(min)
Buggy python submission (verdict: Runtime Error):
x=int(input)
m=100
cnt=0
while x>m:
    cnt+=1
    m=(m*1.01)//1
print(str(cnt))


Fixed submission:
x=int(input())
m=100
cnt=0
while x>m:
    cnt+=1
    m=(m*1.01)//1
print(str(cnt))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
list=[]
for _ in range(n):
    s=input()
    if s not in list:
        list.append(s)
print(str(len(list)))


Fixed submission:
n=int(input())
set=set()
for _ in range(n):
    s=input()
    if s not in set:
        set.add(s)
print(str(len(set)))
Buggy python submission (verdict: Time Limit Exceeded):
def f(x,y):
    if x%y==0:
        return y
    x,y=y,x%y
    return f(x,y)

def main():
    K=int(input())
    sum=0
    for a in range(1,K+1):
        for b in range(1,K+1):
            for c in range(1,K+1):
                sum+=f(a,f(b,c))
    return sum

print(main())

Fixed submission:
def f(x,y):
    if x%y==0:
        return y
    x,y=y,x%y
    return f(x,y)

def main():
    K=int(input())
    sum=0
    for a in range(1,K+1):
        sum+=a
    for a in range(1,K):
        for b in range(a+1,K+1):
            sum+=6*f(a,b)
    for a in range(1,K-1):
        for b in range(a+1,K):
            for c in range(b+1,K+1):
                sum+=f(a,f(b,c))*6
    return sum

print(main())
Buggy python submission (verdict: Runtime Error):
N,K=list(map(int,input().split()))
l=[0]*(K+1)
ans=0
mod=10**9+7

for x in range(K,0,-1):
    l[x]=pow((K//x),N,mod)
    for y in range(2*x,K+1,x):
        l[x]-=l[y]
        l[x]=pow(l[i],1,mod)
    ans+=l[x]*x
    ans=pow(ans,1,mod)
print(ans)

Fixed submission:
N,K=list(map(int,input().split()))
l=[0]*(K+1)
ans=0
mod=10**9+7

for x in range(K,0,-1):
    l[x]=pow((K//x),N,mod)
    for y in range(2*x,K+1,x):
        l[x]-=l[y]
        l[x]=pow(l[x],1,mod)
    ans+=l[x]*x
    ans=pow(ans,1,mod)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=list(map(int,input().split()))
l=[0]*(K+1)
ans=0
mod=10**9+7

for x in range(0,K):
    x=K-x
    l[x]=(K//x)**N%mod
    for y in range(2*x,K+1,x):
        l[x]-=l[y]
        l[x]%=mod
    ans+=l[x]*x
    ans%=mod
print(ans)

Fixed submission:
N,K=list(map(int,input().split()))
l=[0]*(K+1)
ans=0
mod=10**9+7

for x in range(K,0,-1):
    l[x]=pow((K//x),N,mod)
    for y in range(2*x,K+1,x):
        l[x]-=l[y]
        l[x]=pow(l[x],1,mod)
    ans+=l[x]*x
    ans=pow(ans,1,mod)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
queue=[1,2,3,4,5,6,7,8,9]
for i in range(K-1):
    t=queue.pop(0)
    if t%10!=0:
        queue.append(t*10+pow(t,1,10)-1)
    queue.append(t*10+pow(t,1,10))
    if t%10!=9:
        queue.append(t*10+pow(t,1,10)+1)
print(queue[0])

Fixed submission:
K=int(input())
queue=[1,2,3,4,5,6,7,8,9]
count=0
for i in range(K-1):
    t=queue[i]
    if t%10!=0:
        queue.append(t*10+pow(t,1,10)-1)
    queue.append(t*10+pow(t,1,10))
    if t%10!=9:
        queue.append(t*10+pow(t,1,10)+1)
print(queue[K-1])

Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
queue=[1,2,3,4,5,6,7,8,9]
for i in range(K-1):
    t=queue.pop(0)
    if t%10!=0:
        queue.append(t*10+t%10-1)
    queue.append(t*10+t%10)
    if t%10!=9:
        queue.append(t*10+t%10+1)
print(queue[0])

Fixed submission:
K=int(input())
queue=[1,2,3,4,5,6,7,8,9]
count=0
for i in range(K-1):
    t=queue[i]
    if t%10!=0:
        queue.append(t*10+pow(t,1,10)-1)
    queue.append(t*10+pow(t,1,10))
    if t%10!=9:
        queue.append(t*10+pow(t,1,10)+1)
print(queue[K-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=input()
count=0
for i in range(N-1):
    if S[i]!=S[i+1]:
        count+=1
if N!=1 and S[N-2]!=S[N-1]:
    count+=1
if count==0:
    count+=1
print(count)


Fixed submission:
n=input().split(" ")
A=int(n[0])
B=int(n[1])
print(A-B*2 if A-B*2>=0  else 0)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=input().split(" ")
ans=[]
for i in range(1,N+1):
    ans.append(str(A.index(str(i))+1))
print(" ".join(ans))

Fixed submission:
N=int(input())
A=input().split(" ")
ans=[]
for i in range(1,N+1):
    ans.append(0)
for i in range(0,N):
    ans[int(A[i])-1]=str(i+1)
print(" ".join(ans))
Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split(" ")
b=[]
for p in range(0,N):
    b.append(int(a[p]))
if N=1:
    print(0)
else:
    c=[]
    if b[0]-b[1]>=0:
        c.append(1)
    else:
        c.append(0)
    for q in range(1,N-1):
        if b[q]-b[q+1]>=0:
            c.append(c[q-1]+1)
        else:
            c.append(0)
    print(max(c))

Fixed submission:
N=int(input())
a=input().split(" ")
b=[]
for p in range(0,N):
    b.append(int(a[p]))
if N==1:
    print(0)
else:
    c=[]
    if b[0]-b[1]>=0:
        c.append(1)
    else:
        c.append(0)
    for q in range(1,N-1):
        if b[q]-b[q+1]>=0:
            c.append(c[q-1]+1)
        else:
            c.append(0)
    print(max(c))

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split(" ")
b=[]
for p in range(0,N):
    b.append(int(a[p]))
if N=1:
    print(0)
else:
    c=[]
    if b[0]-b[1]>=0:
        c.append(1)
    else:
        c.append(0)
    for q in range(1,N-1):
        if b[q]-b[q+1]>=0:
            c.append(c[q-1]+1)
        else:
            c.append(0)
    print(max(c))

Fixed submission:
N=int(input())
a=input().split(" ")
b=[]
for p in range(0,N):
    b.append(int(a[p]))
if N==1:
    print(0)
else:
    c=[]
    if b[0]-b[1]>=0:
        c.append(1)
    else:
        c.append(0)
    for q in range(1,N-1):
        if b[q]-b[q+1]>=0:
            c.append(c[q-1]+1)
        else:
            c.append(0)
    print(max(c))

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=input().split(" ")
b=[]
for p in range(0,N):
    b.append(int(a[p]))
c=[]
if b[0]-b[1]>=0:
    c.append(1)
else:
    c.append(0)
for q in range(1,N-1):
    if b[q]-b[q+1]>=0:
        c.append(c[q-1]+1)
    else:
        c.append(0)
print(max(c))

Fixed submission:
N=int(input())
a=input().split(" ")
b=[]
for p in range(0,N):
    b.append(int(a[p]))
if N==1:
    print(0)
else:
    c=[]
    if b[0]-b[1]>=0:
        c.append(1)
    else:
        c.append(0)
    for q in range(1,N-1):
        if b[q]-b[q+1]>=0:
            c.append(c[q-1]+1)
        else:
            c.append(0)
    print(max(c))
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=input().split(" ")
f=[]
if a>=3:
    for p in range (0,a-2):
        if int(b[p])-int(b[p+1])>1:
            f.append("miss")
        elif int(b[p])-int(b[p+1])==1:
            if int(b[p+1])-int(b[p+2])==1:
                f.append("miss")
    if int(b[a-2])-int(b[a-1])>1:
        f.append("miss")
elif a=3:
    if int(b[0])-int(b[1])>1:
        f.append("miss")
    elif int(b[1])-int(b[2])>1:
        f.append("miss")
    elif int(b[0])-int(b[2])>1:
        f.append("miss")
elif a=2:
    if int(b[0])-int(b[1])>1:
        f.append("miss")

if "miss" not in f:
    print("Yes")
else:
    print("No")

Fixed submission:
a=input().split(" ")
A=int(a[0])
B=int(a[1])
C=int(a[2])
if C-A+B>=0:
    print(C-A+B)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=input().split(" ")
sequence=[]
for i in range(0,a):
    sequence.append(int(b[i]))
error=[]
for q in range(0,a-1):
    if sequence[q]-sequence[q+1]>0:
        error.append(q)
        error.append(q+1)

if len(error)==0:
    print("YES")

elif len(error)==2:
    if a==2:
        print("YES")
    elif error[0]==0:
        if sequence[error[0]+2]-sequence[error[0]]>0:
            print("YES")
        else:
            print("NO")
    elif error[1]==a:
        if sequence[error[1]]-sequence[error[1]-2]>0:
            print("YES")
        else:
            print("NO")
    else:
        if  sequence[error[1]]-sequence[error[1]-2]>0 and sequence[error[0]+2]-sequence[error[0]]>0:
            print("YES")
        else:
            print("NO")

elif len(error)==4:
    if error[1]==error[2]:
        if sequence[error[0]]>sequence[error[3]]:
            if error[0]==0 and error[3]==a-1:
                if sequence[error[0]]-sequence[error[3]-1]>0 and sequence[error[0]+1]-sequence[error[3]]>0:
                    print("YES")
                else:
                    print("NO")
            elif error[0]==0:
                if sequence[error[0]+3]-sequence[error[0]]>0:
                    print("YES")
                else:
                    print("NO")
            elif error[1]==a:
                if sequence[error[3]]-sequence[error[3]-3]>0:
                    print("YES")
                else:
                    print("NO")
            else:
                if  sequence[error[3]]-sequence[error[3]-3]>0 and sequence[error[0]+3]-sequence[error[0]]>0:
                    print("YES")
                else:
                    print("NO")
    elif sequence[error[0]]-sequence[error[2]]>0 and sequence[error[1]]-sequence[error[3]]>0:
        if error[0]==0 and error[3]==a-1:
            if sequence[error[0]]-sequence[error[3]-1]>0 and sequence[error[0]+1]-sequence[error[3]]>0:
                print("YES")
            else:
                print("NO")
        elif error[0]==0:
            if sequence[error[3]+1]-sequence[error[0]]>0:
                print("YES")
            else:
                print("NO")
        elif error[3]==a:
            if sequence[error[3]]-sequence[error[0]-1]>0:
                print("YES")
            else:
                print("NO")
        elif sequence[error[3]]-sequence[error[0]-1]>0 and sequence[error[3]+1]-sequence[error[0]]>0:
            print("YES")
        else:
            print("NO")
    else:
        print("NO")

else:
    print("NO")

Fixed submission:
a=input().split(" ")
A=int(a[0])
B=int(a[1])
answer=int((A+B)/2)
if (A+B)%2==0 :
    print(answer)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
n = int(input())
a = list(map(str,input().split()))
q = int(input())
d = defaultdict(lambda: 0)
for nums in a:
    d[nums] += 1
for i in range (q):
    Sum = 0
    b,c = map(str,input().split())
    d[c] += d[b]
    del d[b]
    for keys in d:
        cnt = d[keys]
        keys = int(keys)
        Sum += keys*cnt
    print(Sum)

Fixed submission:
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
q = int(input())
d = defaultdict(lambda: 0)
Sum = 0
for nums in a:
    d[nums] += 1
for keys in d:
        cnt = d[keys]
        keys = int(keys)
        Sum += keys*cnt
for i in range (q):
    b,c = map(int,input().split())
    d[c] += d[b]
    Sum += (c-b)*d[b]
    del d[b]
    print(Sum)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(str,input().split()))
q = int(input())
for i in range (q):
    Sum = 0
    b,c = map(str,input().split())
    a.sort()
    a = [s.replace(b,c) for s in a]
    for i in a:
        i= int(i)
        Sum +=i
    print(Sum)

Fixed submission:
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
q = int(input())
d = defaultdict(lambda: 0)
Sum = 0
for nums in a:
    d[nums] += 1
for keys in d:
        cnt = d[keys]
        keys = int(keys)
        Sum += keys*cnt
for i in range (q):
    b,c = map(int,input().split())
    d[c] += d[b]
    Sum += (c-b)*d[b]
    del d[b]
    print(Sum)
Buggy python submission (verdict: Runtime Error):
s = int(intpu())
if s[-1] == 3:
  print('bon')
elif s[-1] == 0 or s[-1] == 1 or s[-1] == 6 or s[-1] == 8:
  print('pon')
else:
  print('hon')

Fixed submission:
s = int(input())
ichi = s%10
if ichi == 3:
    print('bon')
elif ichi == 0 or ichi==1 or ichi== 6 or ichi ==8:
    print('pon')
else :
    print('hon')
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
h = list(map(int,input().split()))
route = []
cnt = 0
for i in range (m):
    s = list(map(int,input().split()))
    route.append(s)
for i in range(1,n+1):
    c = 0
    for j in range(m):
        if i in route[j]:
            a = route[j].index(i)
            if a == 0:
                A = route[j][0]
                B = route[j][1]
            else:
                A = route[j][1]
                B = route[j][0]
            if h[A-1]<=h[B-1]:
                c +=1
    if c == 0:
        cnt +=1
print(cnt)

Fixed submission:
n,m = map(int,input().split())
h = list(map(int,input().split()))
route = []
lower = []
cnt = 0
for i in range (m):
    s = list(map(int,input().split()))
    if h[s[0]-1] > h[s[1]-1]:
        lower.append(s[1])
    elif h[s[1]-1] > h[s[0]-1]:
        lower.append(s[0])
    elif h[s[1]-1] == h[s[0]-1]:
        lower.append(s[0])
        lower.append(s[1])
low = list(set(lower))
cnt =n-len(low)
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = map(int,input().split())
c =0
for i in range(n+1):
    p =i % b 
    P = a*p//b
    if P > c:
        c = P
print(c)

Fixed submission:
a,b,n = map(int,input().split())
c = 0
if n >=b:
    i = b-1
else:
    i =n
ans = int(a*i/b)-a*int(i/b)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n = map(int,input().split())
c = 0
for i in range(n+1):
    ans = int(a*i/b)-a*int(i/b)
    if ans > c:
        c = ans
print(c)

Fixed submission:
a,b,n = map(int,input().split())
c = 0
if n >=b:
    i = b-1
else:
    i =n
ans = int(a*i/b)-a*int(i/b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
table = []
for i in range(n):
    s = input()
    if s not in table:
        table.append(s)
print(len(table))

Fixed submission:
table = []
n = int(input())
for i in range (n):
    s = input()
    table.append(s)
print(len(list(set(table))))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
table = []
for i in range(n):
    s = input()
    if s not in table:
        table.append(s)
print(len(table))

Fixed submission:
table = []
n = int(input())
for i in range (n):
    s = input()
    table.append(s)
print(len(list(set(table))))

Buggy python submission (verdict: Runtime Error):
n = int(input())
table = []
for i in range(n):
  s = input()
  if s not in table
  table.append(s)
print(len(table))
  

Fixed submission:
table = []
n = int(input())
for i in range (n):
    s = input()
    table.append(s)
print(len(list(set(table))))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input().split()
count = 0
for i in range(n-1):
    if s[i] == '1':
        count += 1
print(count)
for i in range(n-1):
    count = 0
    num = i + 2
    for j in range(i+1,n-1):
        NUM = int(s[j])
        if NUM == num:
            count += 1
    print(count)


Fixed submission:
import math as mt
r = int(input())
R = 2*r*mt.pi
print(R)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input().split()
count = 0
for i in range(n-1):
    if s[i] == '1':
        count += 1
print(count)
for i in range(n-1):
    count = 0
    num = i + 2
    for j in range(i+1,n-1):
        NUM = int(s[j])
        if NUM == num:
            count += 1
    print(count)

Fixed submission:
n = int(input())
s = input().split()
A = [[0] for i in range(n)]
for i in range (n-1):
    j = int(s[i])-1
    A[j] += [1]
for i in range(n):
    print(len(A[i])-1)
Buggy python submission (verdict: Runtime Error):
n,m = (int(x) for x in inpit().split())
N = n *(n -1) /2
M = m *(m-1) / 2
print(N+M)

Fixed submission:
n,m =(int(x) for x in input().split())
N = 0
M = 0
if n >1:
    N = n *(n-1)/2
if m > 1:
    M = m*(m-1)/2
a = int(N + M)
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

# k = int(input())
k = 999983
befo = 0

for i in range(k):
    n = befo * 10 + 1
    befo = n
    if (7 * n) % k == 0:
        print(i+1)
        exit(0)
print(-1)


Fixed submission:
# coding: utf-8

k = int(input())
n = 7 % k

for i in range(k+1):
    if n % k == 0:
        print(i+1)
        exit(0)
    n = (((n % k) * (10 % k)) + 7 % k) % k
print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

import itertools
from functools import reduce
from collections import deque

N, K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" ")))

seiseki = deque([])
seiseki2 = []
for i in range(N):
    seiseki.append(A[i])
    if len(seiseki) == K:
        seiseki2.append(reduce(lambda a, b: a * b, seiseki, 1))
        seiseki.popleft()

zenkai = seiseki2[0]
for i in range(1, len(seiseki2)):
    if seiseki2[i] > zenkai:
        print("Yes")
    else:
        print("No")
    zenkai = seiseki2[i]




Fixed submission:
# coding: utf-8

import itertools
from functools import reduce
from collections import deque

N, K = list(map(int, input().split(" ")))
A = list(map(int, input().split(" ")))

for i in range(N):
    if i > K-1:
        if A[i] > A[i-K]:
            print("Yes")
        else:
            print("No")