Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
import copy
from queue import Queue

n = int(input())
#n, k = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#num = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
# s = [input() for i in range(n)]
#s = input()
# list = list(s)
# dp = [[0 for _ in range(2)] for _ in range(13)]
#s = [input() for i in range(n)]

#a = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

queue = Queue()
temp = 0

if (n < 10):
    print(n)
else:
    for i in range(1,10):
        queue.put(i)
    for i in range(1,n):
        temp = queue.get()
        if (temp % 10 != 0) :
            queue.put(10 * temp + (temp % 10) - 1)
        queue.put(10 * temp + (temp % 10))
        if (temp % 10 != 9) :
            queue.put(10 * temp + (temp % 10) + 1)

print(queue.get())



Fixed submission:
import math
import copy
from queue import Queue

n = int(input())
#n, k = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#num = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
# s = [input() for i in range(n)]
#s = input()
# list = list(s)
# dp = [[0 for _ in range(2)] for _ in range(13)]
#s = [input() for i in range(n)]

#a = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

queue = Queue()
temp = 0

if (n < 10):
    print(n)
else:
    for i in range(1,10):
        queue.put(i)
    for i in range(1,n):
        temp = queue.get()
        if (temp % 10 != 0) :
            queue.put(10 * temp + (temp % 10) - 1)
        queue.put(10 * temp + (temp % 10))
        if (temp % 10 != 9) :
            queue.put(10 * temp + (temp % 10) + 1)
    print(queue.get())
Buggy python submission (verdict: Runtime Error):
import math
import copy
from queue import Queue
import heapq
import numpy as np

MOD = 5000000007

#n = int(input())
#s = int(input())
#a, b, c, x, y = [int(i) for i in input().split()]
#table = [[int(i)  for i in input().split()] for j in range(m)]
#table = [list(input()) for n in range(r)] #table[h][w]
#p = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#p = [int(input()) for i in range(m)]
#s = input()

#list = list(s)
#a = [0 for _ in range(n+1)]
#dp = [[0 for _ in range(n+1)] for _ in range(n+1)]

n = int(input())
word_list = [[] for i in range(n)]

for i in range(n):
    a = int(input())
    for j in range(a):
        x, y = [int(i) for i in input().split()]
        word_list[i].append((x-1,y))

ans = 0

for i in range(2**n):
    peoples = []
    flag = 1
    for j in range(n):
        if(i >> j & 1):
            peoples.append(1)
        else:
            peoples.append(0)
    
    for k in range(n):
        if peoples[k] == 1
            words = words_list[k]
            for word in words:
                if peoples[word[0]] != word[1]:
                    flag = 0
                    break
    
    if flag:
        ans = max(ans,sum(peoples))

print(ans)

Fixed submission:
import math
import copy
from queue import Queue
import heapq
import numpy as np

MOD = 5000000007

#n = int(input())
#s = int(input())
#a, b, c, x, y = [int(i) for i in input().split()]
#table = [[int(i)  for i in input().split()] for j in range(m)]
#table = [list(input()) for n in range(r)] #table[h][w]
#p = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#p = [int(input()) for i in range(m)]
#s = input()

#list = list(s)
#a = [0 for _ in range(n+1)]
#dp = [[0 for _ in range(n+1)] for _ in range(n+1)]

n = int(input())
word_list = [[] for i in range(n)]

for i in range(n):
    a = int(input())
    for j in range(a):
        x, y = [int(i) for i in input().split()]
        word_list[i].append((x-1,y))

ans = 0

for i in range(2**n):
    peoples = []
    flag = 1
    for j in range(n):
        if(i >> j & 1):
            peoples.append(1)
        else:
            peoples.append(0)

    for k in range(n):
        if peoples[k] == 1:
            words = word_list[k]
            for word in words:
                if peoples[word[0]] != word[1]:
                    flag = 0
                    break

    if flag:
        ans = max(ans,sum(peoples))

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
import copy
from queue import Queue

#n = int(input())
n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
s = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#s = [int(input()) for i in range(n)]
#s = input()
#list = list(s)
# dp = [[0 for _ in range(2)] for _ in range(13)]

#a = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

for i in range(m) :
    s[s.index(max(s))] = math.floor(max(s)/2)

print(sum(s))

Fixed submission:
import math
import copy
from queue import Queue
import heapq

#n = int(input())
n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
s = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#s = [int(input()) for i in range(n)]
#s = input()
#list = list(s)
# dp = [[0 for _ in range(2)] for _ in range(13)]

#a = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

s = list(map(lambda x: x*(-1), s))
heapq.heapify(s)

for i in range(m) :
    heapq.heappush(s, math.ceil(heapq.heappop(s)/2))

print(sum(s)*(-1))

Buggy python submission (verdict: Runtime Error):
import math
import copy
from queue import Queue

#n = int(input())
n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
s = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#s = [int(input()) for i in range(n)]
#s = input()
#list = list(s)
# dp = [[0 for _ in range(2)] for _ in range(13)]

#a = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

for i in range(m) :
    s[s.index(max(s))] = math.floor(max(s)/2)

print(sum(s))

Fixed submission:
import math
import copy
from queue import Queue
import heapq

#n = int(input())
n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
s = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#s = [int(input()) for i in range(n)]
#s = input()
#list = list(s)
# dp = [[0 for _ in range(2)] for _ in range(13)]

#a = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

s = list(map(lambda x: x*(-1), s))
heapq.heapify(s)

for i in range(m) :
    heapq.heappush(s, math.ceil(heapq.heappop(s)/2))

print(sum(s)*(-1))
Buggy python submission (verdict: Time Limit Exceeded):
import math
import copy

n = int(input())
#k, x = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#s = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = [input() for i in range(n)]
#s = input()
#list = list(s)
#dp = [[0 for _ in range(2)] for _ in range(13)]
s = [input() for i in range(n)]

for i in range(n):
    moji = list(map(lambda x:x, s[i]))
    moji.sort()
    s[i] = moji

s.sort()

count=0

for i in range(n-1) :
    for j in range(i+1,n) :
        if(s[i] == s[j]) :
            count += 1

print(count)



Fixed submission:
import math
import copy

n = int(input())
# k, x = [int(i) for i in input().split()]
# table = [[int(i) for i in input().split()] for j in range(n)]
# table = [list(input()) for n in range(h)]
# s = [int(i) for i in input().split()]
# num = [int(i) for i in range(n)]
# s = [input() for i in range(n)]
# s = input()
# list = list(s)
# dp = [[0 for _ in range(2)] for _ in range(13)]
s = [input() for i in range(n)]

for i in range(n):
    moji = list(map(lambda x: x, s[i]))
    moji.sort()
    s[i] = moji

s.sort()

count = 0
i = 0
j = 1
temp = 0
while (j < n):
    if (s[i] == s[j] and j < n - 1):
        j += 1
    elif (s[i] != s[j] and j < n - 1):
        count += (j - i) * (j - i - 1) / 2
        i = j
        j = i + 1
    elif (s[i] == s[j] and j == n - 1):
        count += (j - i) * (j - i + 1) / 2
        i = j
        j = i + 1
    else:
        count += (j - i) * (j - i - 1) / 2
        i = j
        j = i + 1

print(int(count))
Buggy python submission (verdict: Time Limit Exceeded):
import math

#n = int(input())
#a, b, c = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = [input() for i in range(n)]
s = input()
#list = list(s)
#temp = [[0 for _ in range(13)] for _ in range(13)]

n = len(s)
ans = [0 for i in range(n)]

for i in range(n) :
    if(s[i] == "R") :
        j = 1
        while(s[i+j] == "R") :
            j += 1
        if(j % 2 == 0) :
            ans[i+j] += 1
        else:
            ans[i+j-1] += 1
    else:
        j = 1
        while(s[i-j] == "L") :
            j += 1
        if (j % 2 == 0):
            ans[i-j] += 1
        else:
            ans[i-j+1] += 1

print(*ans)

Fixed submission:
import math

#n = int(input())
#a, b, c = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = [input() for i in range(n)]
s = input()
#list = list(s)
#temp = [[0 for _ in range(13)] for _ in range(13)]

n = len(s)
ans = [0 for i in range(n)]
ans2 = [0 for i in range(n)]

for i in range(n) :
    if(s[i] == "L") :
        if(s[i-1] == "R") :
            ans[i] = i
            ans2[i] += 1
        elif(s[i-2] == "L") :
            ans[i] = ans[i-2]
            ans2[ans[i]] += 1
        else:
            ans[i] = i-2
            ans2[ans[i]] += 1

for i in range(n-1, -1 ,-1) :
    if(s[i] == "R") :
        if(s[i+1] == "L") :
            ans[i] = i
            ans2[i] += 1
        elif (s[i+2] == "R"):
            ans[i] = ans[i+2]
            ans2[ans[i]] += 1
        else:
            ans[i] = i + 2
            ans2[ans[i]] += 1


print(*ans2)
Buggy python submission (verdict: Time Limit Exceeded):
import math

#n = int(input())
l, r= [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = [input() for i in range(n)]
#s = input()
#list = list(s)
#temp = [[0 for _ in range(13)] for _ in range(13)]

ans = 2019

for i in range(l,min(r,l+2019)) :
    for j in range(i+1,min(r+1,i+2020)) :
        a = i % 2019
        b = j % 2019
        ans = min(ans, (a * b) % 2019)

print(ans)

Fixed submission:
import math

#n = int(input())
l, r= [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#num = [int(i) for i in range(n)]
#s = [input() for i in range(n)]
#s = input()
#list = list(s)
#temp = [[0 for _ in range(13)] for _ in range(13)]

ans = 2019

for i in range(l,min(r,l+2018)) :
    for j in range(i+1,min(r+1,i+2019)) :
        ans = min(ans, (i * j) % 2019)

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

#n = int(input())
n, k = [int(i) for i in input().split()]
#table = [[i for i in input().split()] for n in range(h)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#s = input()
#list = list(s)

#s = [int(input()) for i in range(m)] #m行1列入力

if (k = 1) :
    kotae = 0
else :
    kotae = n - k

print(kotae)

Fixed submission:
import math

#n = int(input())
n, k = [int(i) for i in input().split()]
#table = [[i for i in input().split()] for n in range(h)]
#table = [list(input()) for n in range(h)]
#list = [int(i) for i in input().split()]
#s = input()
#list = list(s)

#s = [int(input()) for i in range(m)] #m行1列入力

if (k == 1) :
    kotae = 0
else :
    kotae = n - k

print(kotae)
Buggy python submission (verdict: Runtime Error):
import math
 
#n = int(input())
n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for n in range(n)]
#list = [int(i) for i in input().split()]
#s = input()
#list = list(s)
 
s = [int(input()) for i in range(m)] #m行1列入力
 
MOD = 1000000007
 
 
def fib(n):
    a = 0
    b = 1
    temp = 0
    if (n == 0) :
        return 0
    elif (n == 1) :
        return 1
    else:
        for i in range(n-1) :
            temp = b
            b = (a + b) % MOD
            a = temp
        return b
 
kotae = 1
 
if (m == 0) :
    kotae = (kotae * fib(n)) % MOD
else :
    for i in range(m + 1) :
        if (i == 0) :
            kotae = (kotae * fib(s[i])) % MOD
        elif (i == m) :
            kotae = (kotae * fib(n - s[i-1])) % MOD
        else :
            kotae = (kotae * fib(s[i] - s[i-1] - 1)) % MOD
 
 
print(kotae)

Fixed submission:
import math

a, b, c= [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for n in range(n)]
#light = [int(i) for i in input().split()]
#s = input()
#list = list(s)

#print(n, m)
#print(table)
#print(light)

kotae = 0

kotae = a + b + c - max(a, b, c)

print(kotae)
Buggy python submission (verdict: Runtime Error):
import math

n, a, b, c, d = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for m in range(m)]
#light = [int(i) for i in input().split()]
s = input()
list = list(s)

#print(n, m)
#print(table)
#print(light)

flag = 1



#A-C B-Dまでの間に岩が2個並んでいたらアウト

for i in range(a-1, c-1) :
    if ( list[i] == '#') :
        if ( list[i+1] == "#") :
            flag = 0

for i in range(b-1, d-1) :
    if ( list[i] == "#") :
        if ( list[i+1] == "#") :
            flag = 0

# D < C　のとき、A-Cまでの間に、3個以上空白がなければアウト

if (d < c) :
    flag = 0
    for i in range(a-1, d) :
        if (list[i] == '.' and list[i+1] == '.' and list[i+2] == '.') :
            flag = 1

if (flag == 1) :
    print("Yes")
else :
    print("No")

Fixed submission:
import math

n, a, b, c, d = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for m in range(m)]
#light = [int(i) for i in input().split()]
s = input()
list = list(s)

#print(n, m)
#print(table)
#print(light)

flag = 1



#A-C B-Dまでの間に岩が2個並んでいたらアウト

for i in range(a-1, c-1) :
    if ( list[i] == '#') :
        if ( list[i+1] == "#") :
            flag = 0

for i in range(b-1, d-1) :
    if ( list[i] == "#") :
        if ( list[i+1] == "#") :
            flag = 0

# D < C　のとき、B-Dまでの間に、3個以上空白がなければアウト

if (d < c) :
    flag = 0
    for i in range(b-2, d-1) :
        if (list[i] == '.' and list[i+1] == '.' and list[i+2] == '.') :
            flag = 1

if (flag == 1) :
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import math
import bisect
from queue import Queue
from collections import deque

n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

dp = [1000000000 for _ in range(n)]

dp[0] = 0

for i in range(1,n):
    if(i == 1):
        dp[i] = abs(h[i]-h[i-1])
    else:
        for j in range(1,min(k+1,i+1)):
            dp[i] = min(dp[i],abs(h[i]-h[i-j]) + dp[i-j])

print(dp[n-1])

Fixed submission:
import math
import bisect
from queue import Queue
from collections import deque

n, k = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]

dp = [1000000000 for _ in range(n)]

dp[0] = 0

for i in range(1,n):
    if(i == 1):
        dp[i] = abs(h[i]-h[i-1])
    else:
        for j in range(1,min(k+1,i+1)):
            dp[i] = min(dp[i],abs(h[i]-h[i-j]) + dp[i-j])

print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):

s = input()
t = input()

dp = [[0 for _ in range(len(t) + 1)] for _ in range(len(s) + 1)]

for i in range(1, len(s) + 1):
    for j in range(1, len(t) + 1):
        if (s[i-1] == t[j-1]) :
            dp[i][j] = dp[i-1][j-1] + 1
        else :
            dp[i][j] = max(dp[i][j-1], dp[i-1][j])

kotae = []

while(i > 0 and j > 0):
    if(dp[i][j] == dp[i-1][j]):
        i -= 1
    elif(dp[i][j] == dp[i][j-1]):
        j -= 1
    else:
        i -= 1
        j -= 1
        kotae.append(s[i])

kotae.reverse()
kotae = "".join(kotae)
print(kotae)

Fixed submission:

s = input()
t = input()

dp = [[0 for _ in range(len(t) + 1)] for _ in range(len(s) + 1)]

for i in range(1, len(s) + 1):
    for j in range(1, len(t) + 1):
        if (s[i-1] == t[j-1]) :
            dp[i][j] = dp[i-1][j-1] + 1
        else :
            dp[i][j] = max(dp[i][j-1], dp[i-1][j])

kotae = []

while(i > 0 and j > 0):
    if(dp[i][j] == dp[i-1][j]):
        i -= 1
    elif(dp[i][j] == dp[i][j-1]):
        j -= 1
    else:
        i -= 1
        j -= 1
        kotae.append(s[i])

kotae.reverse()
kotae = "".join(kotae)
print(kotae)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

n = int(sys.stdin.readline())
lst = list(map(int, sys.stdin.readline().split()))
ans = 0
for i in range(len(lst)):
    ans += lst[i] * sum(lst[i+1:])

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

Fixed submission:
import sys

n = int(sys.stdin.readline())
lst = list(map(int, sys.stdin.readline().split()))

pref = [lst[0]]
for i in range(1, len(lst)):
    pref.append(pref[i-1]+lst[i])

ans = 0
for i in range(len(lst)):
    ans += lst[i] * (pref[-1] - pref[i])

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

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

n = int(sys.stdin.readline())
lst = list(map(int, sys.stdin.readline().split()))
ans = 0
for a,b in combinations(lst, 2):
    ans += a*b

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

Fixed submission:
import sys

n = int(sys.stdin.readline())
lst = list(map(int, sys.stdin.readline().split()))

pref = [lst[0]]
for i in range(1, len(lst)):
    pref.append(pref[i-1]+lst[i])

ans = 0
for i in range(len(lst)):
    ans += lst[i] * (pref[-1] - pref[i])

print(ans%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict

graph = defaultdict(list)

n, m = map(int, sys.stdin.readline().split())

if m == 0:
    print(1)
    exit()

for _ in range(m):
    a,b = map(int, sys.stdin.readline().split())

    if not b in graph[a]:
        graph[a].append(b)
    if not a in graph[b]:
        graph[b].append(a)

visited = set()
maxi = 0

def dfs(start):
    stk = [start]
    visited.add(start)
    temp = 1

    while stk:
        cur = stk.pop()

        for c in graph[cur]:
            if not c in visited:
                visited.add(c)
                stk.append(c)
                temp += 1

    return temp

for j in graph:
    if not j in visited:
        cnt = dfs(j)
        maxi = max(cnt, maxi)

print(maxi)

Fixed submission:
import sys
from collections import defaultdict

graph = defaultdict(set)

n, m = map(int, sys.stdin.readline().split())

if m == 0:
    print(1)
    exit()

for _ in range(m):
    a,b = map(int, sys.stdin.readline().split())

    if not b in graph[a]:
        graph[a].add(b)
    if not a in graph[b]:
        graph[b].add(a)

visited = set()
maxi = 0

def dfs(start):
    stk = [start]
    visited.add(start)
    temp = 1

    while stk:
        cur = stk.pop()

        for c in graph[cur]:
            if not c in visited:
                visited.add(c)
                stk.append(c)
                temp += 1

    return temp

for j in graph:
    if not j in visited:
        cnt = dfs(j)
        maxi = max(cnt, maxi)

print(maxi)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import defaultdict

graph = defaultdict(list)

n, m = map(int, sys.stdin.readline().split())

if m == 0:
    print(1)
    exit()

for _ in range(m):
    a,b = map(int, sys.stdin.readline().split())

    if not b in graph[a]:
        graph[a].append(b)
    if not a in graph[b]:
        graph[b].append(a)

visited = set()
maxi = 0

def dfs(start):
    stk = [start]
    visited.add(start)
    temp = 1

    while stk:
        cur = stk.pop()

        for c in graph[cur]:
            if not c in visited:
                visited.add(c)
                stk.append(c)
                temp += 1

    return temp

for j in graph:
    if not j in visited:
        cnt = dfs(j)
        maxi = max(cnt, maxi)

print(maxi)

Fixed submission:
import sys
from collections import defaultdict

graph = defaultdict(set)

n, m = map(int, sys.stdin.readline().split())

if m == 0:
    print(1)
    exit()

for _ in range(m):
    a,b = map(int, sys.stdin.readline().split())

    if not b in graph[a]:
        graph[a].add(b)
    if not a in graph[b]:
        graph[b].add(a)

visited = set()
maxi = 0

def dfs(start):
    stk = [start]
    visited.add(start)
    temp = 1

    while stk:
        cur = stk.pop()

        for c in graph[cur]:
            if not c in visited:
                visited.add(c)
                stk.append(c)
                temp += 1

    return temp

for j in graph:
    if not j in visited:
        cnt = dfs(j)
        maxi = max(cnt, maxi)

print(maxi)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

if k%2 is 0:
    print('-1')
    exit()

seq = '7'

while int(seq) % k != 0:
    seq += '7'

print(len(seq))

Fixed submission:
k=int(input())
rm=7%k
an=-1
for i in range(10**6):
	if rm==0:
		an=i+1;break
	rm=(rm*10+7)%k
print(an)

Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())

if k%2 is 0:
    print('-1')
    exit()

seq = '7'

while int(seq) % k != 0:
    seq += '7'

print(len(seq))

Fixed submission:
k=int(input())
rm=7%k
an=-1
for i in range(10**6):
	if rm==0:
		an=i+1;break
	rm=(rm*10+7)%k
print(an)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
lst = list(map(int, input().split()))

loc = 1

for _ in range(n-k):
    cur = 1
    for i in range(loc, loc+k):
        cur *= lst[i]

    if cur*lst[loc-1] > cur*lst[loc+1]:
        print('Yes')
    else:
        print('No')
    loc += 1

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


for i in range(n-k):
    if lst[i] < lst[i+k]:
        print('Yes')
    else:
        print('No')