Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split()))
A.append(sum(A))

ans = False
for i in A:
  if A%3 == 0:
    ans = True
if ans:
  print("Possible")
else:
  print("Impossible")

Fixed submission:
A = list(map(int, input().split()))
A.append(sum(A))

ans = False
for i in A:
  if i%3 == 0:
    ans = True
if ans:
  print("Possible")
else:
  print("Impossible")
Buggy python submission (verdict: Runtime Error):
A, B, C = input().split()

if A(len(A)-1) == B[0] and B(len(B)-1) == C[0]:
  print("YES")
else:
  print("NO")

Fixed submission:
A, B, C = input().split()
 
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
import itertools
A, B = map(int,input().split())

print(itertools.cycle(range(24))[A+B])

Fixed submission:
import itertools
A, B = map(int,input().split())
print((A+B)%24)
Buggy python submission (verdict: Runtime Error):
A = list(map(int,input().split()))
B = map(A)
print(len(B))

Fixed submission:
A = list(map(int,input().split()))
B = set(A)
print(len(B))
Buggy python submission (verdict: Runtime Error):
n, k = list(map(int, input().split(" ")))

a_lst = list(map(int, input().split(" ")))

# previousの値を取っておいて真に掛け算した評定が高かったかを判定
previous = 1
for i in range(k):
    previous *= a_lst[i]
for i in range(k, n):
    now = previous / a_lst[i - k] * a_lst[i]
    if now > previous:
        print("Yes")
    else:
        print("No")
    previous = now


Fixed submission:
x = int(input())
left_score = x - 400

print(8 - left_score // 200)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().split(" ")))

a_lst = list(map(int, input().split(" ")))

# previousの値を取っておいて真に掛け算した評定が高かったかを判定
previous = 1
for i in range(k):
    previous *= a_lst[i]
for i in range(k, n):
    now = previous / a_lst[i - k] * a_lst[i]
    if now > previous:
        print("Yes")
    else:
        print("No")
    previous = now


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

a_lst = list(map(int, input().split(" ")))

for i in range(k, n):
    if a_lst[i] > a_lst[i - k]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().split(" ")))

a_lst = list(map(int, input().split(" ")))

# previousの値を取っておいて真に掛け算した評定が高かったかを判定
previous = 1
for i in range(k):
    previous *= a_lst[i]
for i in range(k, n):
    now = previous / a_lst[i - k] * a_lst[i]
    if now > previous:
        print("Yes")
    else:
        print("No")
    previous = now


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

a_lst = list(map(int, input().split(" ")))

for i in range(k, n):
    if a_lst[i] > a_lst[i - k]:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int, input().split(" ")))
a_lst = list(map(int,input().split(" ")))


plus_lst = list(filter(lambda num: num >= 0 , a_lst))
minus_lst = list(filter(lambda num: num < 0 , a_lst))
plus_lst.sort(reverse=True)
minus_lst.sort(reverse=True)


# +,-どちらもk以上ある
	# max(abs+,abs-)で大きい方をk-1回目までとる, k-1回目で+だったら+, -だったら-
# +: kない, -: kある
	# +の数が残り1になるまでabsでやる,最後に+を使って調整する
# +: kある, -: kない
	# -の数が1になるまでabsでやる, 最後に-を使って調整
# +: kない, -: kない
	# どちらかが残り1になるまでやる,最後に調整
# -のみ
	# absでできるだけ小さいものを使う

# 0を抜いたらk個なかった場合、絶対どっかで0を掛けるので0
# 全部-の場合
if(len(plus_lst) == 0):
	total = 1
	for i in range(k):
		total *=minus_lst[i]
	print(total % (10**9 + 7))
elif(len(minus_lst) == 0):
	total = 1
	for i in range(k):
		total *= plus_lst[i]
	print(total % (10**9 + 7))
else:
	total = 1
	for i in range(k):
		if(i == k - 1):
			if(total > 0):
				total *= plus_lst.pop(0)
			else:
				total *= minus_lst.pop(-1)
		else:
			# plus残り1の場合
			if(len(plus_lst) == 1):
				total *= minus_lst.pop(-1)
			# minus残り1の場合
			elif(len(minus_lst) == 1):
				total += plus_lst.pop(0)					
			# +-どっちも十分あった場合
			else:
				plus_max = plus_lst[0]
				minus_max = minus_lst[0]
				if(abs(plus_max) > abs(minus_max)):
					plus_lst.pop(0)
					total *= plus_max
				else:
					minus_lst.pop(-1)
					total *= minus_max
	print(total % (10**9 + 7))


Fixed submission:
n = int(input())

if(n % 1000 == 0):
	print(0)
else:
	print(1000 - n % 1000)
Buggy python submission (verdict: Runtime Error):
a1,a2,a3 = input().split(" ")

a12 = abs(a1 - a2)
a13 = abs(a1 - a3)
a23 = abs(a2 - a3)

min_num = min(a12,a13, a23)

print(sum(a12,a13,a23) - min_num)



Fixed submission:
a1,a2,a3 = map(int,input().split(" "))


a12 = abs(a1 - a2)
a13 = abs(a1 - a3)
a23 = abs(a2 - a3)

max_num = max(a12,a13, a23)

print(a12 + a13 + a23 - max_num)
Buggy python submission (verdict: Runtime Error):
from math import floor
n,k = input().split(" ")

print(floor((n - 1) / (k - 1)))


Fixed submission:
from math import ceil
n,k = map(int,input().split(" "))


print(ceil((n - 1) / (k - 1)))
Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = list(map(int,input.split()))
res = 0
for i in range(a,b+1):
  if(i%k==0):
    res=1
    break
if(res==1):
  print("OK")
else:
  print("NG")

Fixed submission:
k = int(input())
a,b = list(map(int,input().split()))
res = 0
for i in range(a,b+1):
  if(i%k==0):
    res=1
    break
if(res==1):
  print("OK")
else:
  print("NG")
Buggy python submission (verdict: Time Limit Exceeded):

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

total = 1

for i in range(n):
    total *= a[i]

if total > 10 ** 18:
    print(-1)
else:
    print(total)



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

A = list(map(int, input().split()))

if 0 in A:
    print(0)
    exit(0)

num = 1
for i in A:
    num *= i
    if num > 10**18:
        print(-1)
        exit(0)
print(num)

Buggy python submission (verdict: Time Limit Exceeded):

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

total = 0

for i in range(n):
    if i == 0:
        total = a[i]
    else:
        total *= a[i]

if total > 10 ** 18:
    print("-1")
else:
    print(total)



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

A = list(map(int, input().split()))

if 0 in A:
    print(0)
    exit(0)

num = 1
for i in A:
    num *= i
    if num > 10**18:
        print(-1)
        exit(0)
print(num)

Buggy python submission (verdict: Time Limit Exceeded):

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

total = 0

for i in range(n):
    if i == 0:
        total = a[i]
    else:
        total *= a[i]

if total > 10 ** 18:
    print("-1")
else:
    print(total)



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

A = list(map(int, input().split()))

if 0 in A:
    print(0)
    exit(0)

num = 1
for i in A:
    num *= i
    if num > 10**18:
        print(-1)
        exit(0)
print(num)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    sum = 0

    for j in range(N - 1):
        if i + 1 == A[j]:
            sum += 1
    
    print(sum)


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

sum =[0] * N

for i in range(N - 1):
    num = A[i - 1] - 1
    sum[num] += 1

for i in range(N):
    print(sum[i])

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

for i in range(N):
    sum = 0

    for j in range(N - 1):
        if i + 1 == A[j]:
            sum += 1
    
    print(sum)


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

sum =[0] * N

for i in range(N - 1):
    num = A[i - 1] - 1
    sum[num] += 1

for i in range(N):
    print(sum[i])
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
k = int(input())

for i in range(k-1):
  if b < a:
    b = b * 2
  elif c < b:
    c = c * 2
  else:
    pass

if (a < b) & (b < c):
    print('Yes')
else:
    print('No')

Fixed submission:
i = int(input())
if 400 <= i < 600:
    print(8)
elif 600 <= i < 800:
    print(7)
elif 800 <= i < 1000:
    print(6)
elif 1000 <= i < 1200:
    print(5)
elif 1200 <= i < 1400:
    print(4)
elif 1400 <= i < 1600:
    print(3)
elif 1600 <= i < 1800:
    print(2)
elif 1800 <= i <= 1999:
    print(1)
Buggy python submission (verdict: Runtime Error):
S = input()

a = len(S) / 2
x = 0

if b == 0:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1
else:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1

print(x)

Fixed submission:
S = input()

a = len(S) / 2
b = len(S) % 2
x = 0

if b == 0:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1
else:
  for i in range(1, int(a+1)):
    if S[i-1]!=S[-i]:
      x += 1

print(x)
Buggy python submission (verdict: Runtime Error):
output = []
 
for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Fixed submission:
output = []
 
for (i, x) in enumerate(input()):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Buggy python submission (verdict: Runtime Error):
output = []
 
for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Fixed submission:
output = []
 
for (i, x) in enumerate(input()):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Buggy python submission (verdict: Runtime Error):
output = []
 
for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
            print(output)
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Fixed submission:
output = []
 
for (i, x) in enumerate(input()):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Buggy python submission (verdict: Runtime Error):
output = []

for (i, x) in enumerate(S):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if output == "Bad":
    print(output)
else:
    output == "Good"
    print(output)

Fixed submission:
output = []
 
for (i, x) in enumerate(input()):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)

Buggy python submission (verdict: Runtime Error):
message = []

for (i, x) in enumerate(S):
    if i == 0:
        pre = 0
        pre = x
    else:
        if pre == x:
            message = "Bad"
        pre = x
            
if message == "Bad":
    print(message)
else:
    print("Good")

Fixed submission:
output = []
 
for (i, x) in enumerate(input()):
    if i == 0:
        pre = x
    else:
        if pre == x:
            output = "Bad"
        pre = x
            
if len(output) > 0:
    print(output)
else:
    output = "Good"
    print(output)
Buggy python submission (verdict: Runtime Error):
def cc():
    a, b = map(str, input().split())
    a2 = int(a)
    b2 = int(b.replace('.', ''))
    c = a2 * b2
    ans = str(c)[0:-2] if len(c) > 2 else 0
    print(ans)
if __name__ == "__main__":
    cc()


Fixed submission:
def c():
    from decimal import Decimal
    import math
    a, b = map(str, input().split())
    print(int(math.floor(Decimal(a) * Decimal(b))))

if __name__ == "__main__":
    c()

Buggy python submission (verdict: Runtime Error):
def cc():
    a, b = map(str, input().split())
    a2 = int(a)
    b2 = int(b.replace('.', ''))
    c = a2 * b2
    print(str(c)[0:-2])

    if __name__ == "__main__":
    cc()


Fixed submission:
def c():
    from decimal import Decimal
    import math
    a, b = map(str, input().split())
    print(int(math.floor(Decimal(a) * Decimal(b))))

if __name__ == "__main__":
    c()
Buggy python submission (verdict: Runtime Error):
def a():
    r = int(input())
    print(2 * 3.141592653589 * r)
##########
if __name__ == "__main__":
    b()


Fixed submission:
def a():
    r = int(input())
    print(2 * 3.141592653589 * r)


##########
if __name__ == "__main__":
    a()
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))

ans = 0
for i in range(N-K+1):
    a = sum(P[i:i+K])
    ans = a if a > ans else ans
print((ans+K)/2)


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

ans = sum(P[0:K])
tmp = sum(P[0:K])

for i in range(1, N-K+1):
    tmp = tmp - P[i-1] + P[i+K-1]
    ans = max(tmp, ans)
print((ans + K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(lambda x: (int(x)+1)/2, input().split()))

ans = 0
for i in range(N-K+1):
    a = sum(P[i:i+K])
    ans = a if a > ans else ans
print(ans)


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

ans = sum(P[0:K])
tmp = sum(P[0:K])

for i in range(1, N-K+1):
    tmp = tmp - P[i-1] + P[i+K-1]
    ans = max(tmp, ans)
print((ans + K)/2)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(int, input().split()))
e1 = list(map(lambda x: (x+1)/2, P))

ans = 0
for i in range(N-K+1):
    a = sum(e1[i:i+K])
    ans = a if a > ans else ans
print(ans)


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

ans = sum(P[0:K])
tmp = sum(P[0:K])

for i in range(1, N-K+1):
    tmp = tmp - P[i-1] + P[i+K-1]
    ans = max(tmp, ans)
print((ans + K)/2)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

memo = [0] * N
memo[0] = 1
for i in range(1, N):
    if P[i] > P[i-1]:
        memo[i] = 0
    elif P[i] == P[i-1]:
        memo[i] = memo[i-1]
    else:
        if P[i] <= min(P[0:i]):
            memo[i] = 1
        else:
            memo[i] = 0
print(sum(memo))


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

memo = [0] * N
memo[0] = 1
minn = P[0]
for i in range(1, N):
    if P[i] <= minn:
        memo[i] = 1
    else:
        memo[i] = 0
    minn = min(minn, P[i])
print(sum(memo))

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

memo = [0] * N
memo[0] = 1
for i in range(1, N):
    if P[i] > P[i-1]:
        memo[i] = 0
    elif P[i] > P[i-1]:
        memo[i] = memo[i-1]
    else:
        c = 1
        for j in range(i+1):
            if P[i] <= P[j]:
                c *= 1
            else:
                c *= 0
        memo[i] = c
print(sum(memo))


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

memo = [0] * N
memo[0] = 1
minn = P[0]
for i in range(1, N):
    if P[i] <= minn:
        memo[i] = 1
    else:
        memo[i] = 0
    minn = min(minn, P[i])
print(sum(memo))

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

cnt = 0
for i in range(N):
    c = 1
    for j in range(i+1):
        if P[i] <= P[j]:
            c *= 1
        else:
            c *= 0
    cnt += c
print(cnt)


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

memo = [0] * N
memo[0] = 1
minn = P[0]
for i in range(1, N):
    if P[i] <= minn:
        memo[i] = 1
    else:
        memo[i] = 0
    minn = min(minn, P[i])
print(sum(memo))
Buggy python submission (verdict: Runtime Error):
def d():
    N = int(input())
    a = {}
    count = 0

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        a[l, r] = a.get((l, r), 0) + 1

    # print(a)

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        # print('a.get(({0}, {1}), 0) * a.get(({1}, {0}), 0) = {2}'.format(l,
                                                                         r, a.get((l, r), 0) * a.get((r, l), 0)))
        count += a.get((r, l), 0)

    print(count)


##########
d()


Fixed submission:
def d():
    N = int(input())
    a = {}
    count = 0

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        a[l, r] = a.get((l, r), 0) + 1

    # print(a)

    for i in range(1, N+1):
        l, r = str(i)[0], str(i)[-1]
        # print('a.get(({0}, {1}), 0) * a.get(({1}, {0}), 0) = {2}'.format(l, r, a.get((l, r), 0) * a.get((r, l), 0)))
        count += a.get((r, l), 0)

    print(count)


##########
d()
Buggy python submission (verdict: Time Limit Exceeded):
def b_frog2():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))

    c = [10**9] * N
    c[0] = 0
    for i in range(1, N):
        k = min(i, K)
        for j in range(1, k+1):
            c[i] = min(c[i], abs(h[i] - h[i-j]) + c[i-j])
            # print('i={}, c[i]={}'.format(i, c[i]))

    print(c[-1])


##########
if __name__ == "__main__":
    b_frog2()


Fixed submission:
import numpy as np


def b_frog2():
    N, K = map(int, input().split())
    h = np.array(list(map(int, input().split())))

    c = np.zeros(N, dtype=int)
    c[0] = 0
    for i in range(1, N):
        j = max(0, i-K)
        c[i] = np.min(abs(h[i] - h[j:i]) + c[j:i])

    print(c[-1])


##########
if __name__ == "__main__":
    b_frog2()
Buggy python submission (verdict: Time Limit Exceeded):
islands = []
bridges = []

N, M = map(int, input().split())

for i in range(M):
    a, b = map(int, input().split())
    islands.append({'a': a, 'b': b})

islands.sort(key=lambda x: x['b'])
# print(islands)

for i in islands:
    b = [j for j in bridges if j >= i['a']]
    b = [j for j in b if j < i['b']]
    if len(b) == 0:
        bridges.append(i['b'] - 1)

# print(bridges)
print(len(bridges))


Fixed submission:
islands = []
bridges = []

N, M = map(int, input().split())

for i in range(M):
    a, b = map(int, input().split())
    islands.append({'a': a, 'b': b})

islands.sort(key=lambda x: x['b'])
# print(islands)

for i in islands:
    b = [j for j in bridges if j >= i['a']]
    if len(b) == 0:
        bridges.append(i['b'] - 1)

# print(bridges)
print(len(bridges))

Buggy python submission (verdict: Time Limit Exceeded):
islands = []
bridges = []

N, M = map(int, input().split())
# N, M = 10, 5
# islands = [
#     {'a': 1, 'b': 10},
#     {'a': 2, 'b': 5},
#     {'a': 1, 'b': 9},
#     {'a': 2, 'b': 4},
#     {'a': 1, 'b': 2},
# ]

for i in range(M):
    a, b = map(int, input().split())
    islands.append({'a': a, 'b': b})

islands.sort(key=lambda x: (x['b'], x['a']))
# print(islands)

for i in islands:
    b = [j for j in bridges if j >= i['a']]
    b = [j for j in b if j < i['b']]
    if len(b) == 0:
        bridges.append(i['b'] - 1)

# print(bridges)
print(len(bridges))


Fixed submission:
islands = []
bridges = []

N, M = map(int, input().split())

for i in range(M):
    a, b = map(int, input().split())
    islands.append({'a': a, 'b': b})

islands.sort(key=lambda x: x['b'])
# print(islands)

for i in islands:
    b = [j for j in bridges if j >= i['a']]
    if len(b) == 0:
        bridges.append(i['b'] - 1)

# print(bridges)
print(len(bridges))
Buggy python submission (verdict: Runtime Error):
n = int(input())
x = input()
fl = {}


def popcount(n):
    s = str(format(n, "b"))
    return s.count("1")


def f(n):
    cnt = 0
    while n > 0:
        n = n % popcount(n)
        if str(n) in fl:
            cnt += fl[n]
            break
        cnt += 1

    fl[n] = cnt
    return cnt


def getX(m, i):
    s = (ord(x[i]) % 2 + 1) % 2
    s = x[:i] + str(s) + x[i + 1:]
    return int(s, 2)


for i in range(n):
    rx = getX(x, i)
    print(f(rx))


Fixed submission:
l, r, d = map(int, input().split())
print(r // d - (l-1) // d)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(lambda x: int(x), list(input()))

cnt = 0
def get_str(a):
    if a >= 0:
        s = "+{}".format(a)
    else:
        s = "{}".format(a)
    return s

for i in range(1 << 4 - 1):
    if (i >> 3) % 2 == 0:
        a = -a
    if (i >> 2) % 2 == 0:
        b = -b
    if (i >> 1) % 2 == 0:
        c = -c
    if (i >> 0) % 2 == 0:
        d = -d

    if a + b + c + d  == 7:
        s = ""
        s += get_str(a)
        s += get_str(b)
        s += get_str(c)
        s += get_str(d)
        s += "=7"
        if a >= 0:
            print(s[1::])
        else:


Fixed submission:
a,b,c,d = map(lambda x: int(x), list(input()))

def get_str(i):
    if i >= 0:
        s = "+{}".format(i)
    else:
        s = "{}".format(i)
    return s

for i in range(1 << 3):
    ai, bi, ci, di = a, b, c, d
    if (i >> 2) % 2:
        bi = -b
    if (i >> 1) % 2:
        ci = -c
    if (i >> 0) % 2:
        di = -d

    if ai+bi+ci+di == 7:
        s = ""
        s += get_str(ai)
        s += get_str(bi)
        s += get_str(ci)
        s += get_str(di)
        s += "=7"
        print(s[1::])
        break
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
a = list(map(int, input().split()))
prod  = 1
for i in range(k-1):
    prod *= a[i]
j = 0
for i in range(k-1,n-1):
    prod *= a[i]
    if prod < (prod//a[j]) * a[i+1]:
        print("Yes")
    else:
        print("No")
    j += 1
    #print(prod, prod//a[j] * a[i+1])
    


Fixed submission:
n,k = map(int, input().split())
a = list(map(int, input().split()))
prod  = 1
# for i in range(k-1):
#     prod *= a[i]
j = 0
for i in range(k,n):
    
    if a[i] > a[j]:
        print("Yes")
    else:
        print("No")
    j += 1
    #print(prod, prod//a[j] * a[i+1])
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n=map(int,input().strip().split())
t=0
for i in range(n+1):
    if (b-1)<=n:
        t=(a*(b-1)//b)
    else:
        t=(a*n)//b
    
   # t=max(t,((a*i)//b)-(a*(i//b)))
print(t)
    

Fixed submission:
a,b,n=map(int,input().strip().split())
t=0
if (b-1)<=n:
        t=(a*(b-1)//b)
else:
        t=(a*n)//b
    
   # t=max(t,((a*i)//b)-(a*(i//b)))
print(t)

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

Fixed submission:
a,b,n=map(int,input().strip().split())
t=0
if (b-1)<=n:
        t=(a*(b-1)//b)
else:
        t=(a*n)//b
    
   # t=max(t,((a*i)//b)-(a*(i//b)))
print(t)
Buggy python submission (verdict: Runtime Error):
import numpy as np

def main():
    N, K = (int(x) for x in input().split(" "))
    A = [int(x) for x in input().split(" ")]
    lastest_score = np.array(A[0:K]).prod()
    for i in range(1, N-K+1):
        current_score = np.array(A[i:i+K]).prod()
        if lastest_score < current_score:
            print("Yes")
        else:
            print("No")
        lastest_score = current_score


if __name__ == '__main__':
    main()


Fixed submission:

def main():
    base = 400
    increment = 200
    X = int(input())
    for i in range(8):

        if base+increment*(i) <= X and X < base+increment*(i+1):
            print(8-i)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    return ass #sortされていない
n = int(input())
ans = 0
for i in range(1, n + 1):
    ans += i*len(divisor(i))
print(ans)

Fixed submission:
n = int(input())
yakusuukosuu=[1]*(n+1)
ans = 0
for i in range(1, n + 1):
    ans += yakusuukosuu[i] * i
    for j in range(i * 2, n + 1, i):
        yakusuukosuu[j] += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
from decimal import *
a,b=map(str,input().split())
b = Decimal(b)
a = Decimal(a)
print(int(a*b))


Fixed submission:
from decimal import *
a,b=map(str,input().split())
b = Decimal(b)
a = Decimal(a)
print(int(a*b))