Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    div_i = 0
    tmp_multi = 1
    prev_tmp_multi = 1
    for i in range(N):
        if i <= K - 1:
            tmp_multi *= A[i]
            prev_tmp_multi *= A[i]
        else:
            tmp_multi *= A[i]
            tmp_multi /= A[div_i]
            if tmp_multi > prev_tmp_multi:
                print("Yes")
            else:
                print("No")
            prev_tmp_multi = tmp_multi
            div_i += 1


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    div_i = 0
    for i in range(N):
        if i <= K - 1:
            pass
        else:
            if A[i] > A[div_i]:
                print("Yes")
            else:
                print("No")
            div_i += 1


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N = int(input())
    nums = [1] * (N + 1)
    s = 0
    for i in range(2, N+1):
        tmp = i
        while tmp <= N:
            nums[tmp] += 1
            tmp += i
    for i in range(1, N+1):
        s += i * nums[i]
    print(s)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N = int(input())
    nums = [1] * (N + 1)
    s = 0
    for i in range(2, N+1):
        tmp = i
        while tmp <= N:
            nums[tmp] += 1 
            tmp += i
    for i in range(1, N+1):
        s += i * nums[i]
    print(s)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    _ = input()
    A = list(map(int, input().split()))
    cnt = 1 

    for a in A:
        cnt *= a 
    if cnt > 1e18:
        print(-1)
    else:
        print(cnt)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    _ = input()
    A = list(map(int, input().split()))
    cnt = 1 
    mi = min(A)
    if mi == 0:
        print(0)
    else:
        for a in A:
            cnt *= a 
            if cnt > 1e18 and mi > 0:
                print(-1)
                break
        else:
            if cnt < 0:
                print(-1)
            else:
                print(cnt)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
n, *D  = [list(map(int, s.split())) for s in open(0)]
D = D[0]
dic = dict()
for d1 in D:
 
    if d1 not in dic:
        dic[d1] = 1
    else:
        dic[d1] += 1

for d2 in D:
    comb = 0
    dic[d2] -= 1
    for i in dic.values():
        if i >= 2:
            comb += i * (i - 1) / 2
    dic[d2] += 1
    print(int(comb))

Fixed submission:
from collections import defaultdict
n, *D  = [list(map(int, s.split())) for s in open(0)]
D = D[0]
dic = defaultdict(int)
for i in D:
    dic[i] += 1

total_comb = 0
for j in dic:
    if dic[j] >= 2:
        total_comb += dic[j] * (dic[j] - 1) / 2
for k in D:
    if dic[k] >= 2:
        print(int(total_comb - dic[k] + 1))
    else:
        print(int(total_comb))

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
n, *D  = [list(map(int, s.split())) for s in open(0)]
D = D[0]
dic = defaultdict(int)
for d in D:
    dic[d] += 1

for d in D:
    dic[d] -= 1
    comb = 0
    for i in dic.values():
        if i >= 2:
            comb += i * (i - 1) / 2
    dic[d] += 1
    print(int(comb))

Fixed submission:
from collections import defaultdict
n, *D  = [list(map(int, s.split())) for s in open(0)]
D = D[0]
dic = defaultdict(int)
for i in D:
    dic[i] += 1

total_comb = 0
for j in dic:
    if dic[j] >= 2:
        total_comb += dic[j] * (dic[j] - 1) / 2
for k in D:
    if dic[k] >= 2:
        print(int(total_comb - dic[k] + 1))
    else:
        print(int(total_comb))
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict


def main():
    flag_imp = 0
    n, m = map(int, input().split())
    conds = list(set([input() for i in range(m)]))
    conds_dict = defaultdict(list)
    for c in conds:

        conds_dict[int(c.split()[0])].append(c.split()[1])
 
    if max(list(map(len, conds_dict.values()))) > 1:
        flag_imp += 1
    else:
        try:
            first_digit = conds_dict[1][0]
        except IndexError:
            if n == 1:
                first_digit = "0"
            else:
                flag_imp += 1
        try:
            seond_digit = conds_dict[2][0]
        except IndexError:
            seond_digit = "0"

        try:
            third_digit = conds_dict[3][0]
        except IndexError:
            third_digit = "0"
           
    if flag_imp:
        print(-1)
    elif n > 1 and first_digit == "0":
        print(-1)
    else:
        if n == 1:
            print(first_digit)
        elif n == 2:
            print(first_digit + seond_digit)
        else:
            print(first_digit + seond_digit + third_digit)


if __name__ == "__main__":
    main()


Fixed submission:
n, *D  = [list(map(int, s.split())) for s in open(0)]
imp = 0
dic = dict()
D = sorted(D)
cond = []
for d in D:
    if n[0] != 1 and d[0] == 1 and d[1] == 0:
        imp += 1
    if d not in cond:
        cond.append(d)
        if d[0] in dic:
            imp += 1
        else:
            dic[d[0]] = d[1]

s = ""
if imp:
    print(-1)
else:
    for i in range(n[0]):
        if i + 1 in dic:
            s += str(dic[i+1])
        else:
            if i == 0 and n[0] > 1:
                s += str(1)
            else:
                s += str(0)
    print(s)
Buggy python submission (verdict: Runtime Error):
from math import gcd
(A, B), = [list(map(int, s.split())) for s in open(0)]
print(int(A * B / gcd(A, B)))

Fixed submission:
from fractions import gcd
(A, B), = [list(map(int, s.split())) for s in open(0)]
print(int(A * B / gcd(A, B)))
Buggy python submission (verdict: Time Limit Exceeded):
N, *L,  = [list(map(int, s.split())) for s in open(0)]
L = L[0]
i = 0
l = N[0]
cnt = 0
while l > 0 and l - 1 >= i:
    if L[i] != i + 1:
        L.pop(i)
        cnt += 1
    else:
        i += 1
    l = len(L)
if cnt == N[0]:
    print(-1)
else:
    print(cnt)

Fixed submission:
N, *L,  = [list(map(int, s.split())) for s in open(0)]
L = L[0]
minj = 0
for l in L:
    if l == minj + 1:
        minj = l
if minj == 0:
    print(-1)
else:
    print(len(L) - minj)

Buggy python submission (verdict: Time Limit Exceeded):
N, *L,  = [list(map(int, s.split())) for s in open(0)]
L = L[0]
i = 0
l = N[0]
cnt = 0
while l > 0 and l - 1 >= i:
    if L[i] != i + 1:
        L.pop(i)
        cnt += 1
        i = 0
    else:
        i += 1
    l = len(L)
if cnt == N[0]:
    print(-1)
else:
    print(cnt)

Fixed submission:
N, *L,  = [list(map(int, s.split())) for s in open(0)]
L = L[0]
minj = 0
for l in L:
    if l == minj + 1:
        minj = l
if minj == 0:
    print(-1)
else:
    print(len(L) - minj)
Buggy python submission (verdict: Runtime Error):
ef main():
    a1, a2, a3 = map(int, input().split())
    if (a1+a2+a3) <= 21:
        print("win")
    else:
        print("bust")

if __name__ == "__main__":
    main()

Fixed submission:
a, b, c = (int(i) for i in input().split())
if a + b + c <= 21:
  print("win")
else:
  print("bust")
Buggy python submission (verdict: Runtime Error):
def main():
    N = int(input())
    d = defaultdict(list)
    for i in range(N):
        n = int(input())
        for _ in range(n):
            d[i].append(list(map(int, input().split())))
    max_trust_num = 0

    # check all possible combinations of Honest or Unkind.
    for i in range(2**N):
        trust = True

        # assign Honest or Unnkind to each person.
        # if person i is Honest, trust_combs[i] = 1
        # else, trust_combs[i] = 0
        trust_combs = []
        for j in range(N):
            if (i >> j) & 1:
                trust_combs.append(1)
            else:
                trust_combs.append(0)
  
        # check if the combination of Honest or
        # Unkind contradicts the given statements.
        for k in range(len(trust_combs)):
            if trust_combs[k] == 1:
                for l in d[k]:
                    if not l[1] == trust_combs[l[0]-1]:
                        trust = False
        if trust:
            max_trust_num = max(max_trust_num, sum(trust_combs))

    print(max_trust_num)


if __name__ == "__main__":
    main()


Fixed submission:
from collections import defaultdict


def main():
    N = int(input())
    d = defaultdict(list)
    for i in range(N):
        n = int(input())
        for _ in range(n):
            d[i].append(list(map(int, input().split())))
    max_trust_num = 0

    # check all possible combinations of Honest or Unkind.
    for i in range(2**N):
        trust = True

        # assign Honest or Unnkind to each person.
        # if person i is Honest, trust_combs[i] = 1
        # else, trust_combs[i] = 0
        trust_combs = []
        for j in range(N):
            if (i >> j) & 1:
                trust_combs.append(1)
            else:
                trust_combs.append(0)
  
        # check if the combination of Honest or
        # Unkind contradicts the given statements.
        for k in range(len(trust_combs)):
            if trust_combs[k] == 1:
                for l in d[k]:
                    if not l[1] == trust_combs[l[0]-1]:
                        trust = False
        if trust:
            max_trust_num = max(max_trust_num, sum(trust_combs))

    print(max_trust_num)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline


def main():
    num = 0
    _ = input()
    A = sorted(list(map(int, input().split())))
    for i in range(len(A)-1):
        for j in range(i+1, len(A)):
            a = A[i]
            b = A[j]
            thresh = a + b
            ok = j
            ng = len(A)
            idx = binary_search(A, ok, ng, thresh)
            num += idx - j

    print(num)


def binary_search(li, ok, ng, value):
    while abs(ok-ng) > 1:
        mid = (ok + ng) // 2
        if li[mid] < value:
            ok = mid
        else:
            ng = mid

    return ok


if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.readline
 
 
def main():
    num = 0
    _ = input()
    A = sorted(list(map(int, input().split())))
    for i in range(len(A)-1):
        for j in range(i+1, len(A)):
            a = A[i]
            b = A[j]
            thresh = a + b
            ok = j
            ng = len(A)
            idx = binary_search(A, ok, ng, thresh)
            num += idx - j
 
    print(num)
 
 
def binary_search(li, ok, ng, value):
    while abs(ok-ng) > 1:
        mid = (ok + ng) // 2
        if li[mid] < value:
            ok = mid
        else:
            ng = mid
 
    return ok
 
 
if __name__ == "__main__":
    main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    num = 0
    _ = input()
    A = sorted(list(map(int, input().split())))
    for i in range(len(A)-1):
        for j in range(i+1, len(A)):
            a = A[i]
            b = A[j]
            thresh = a + b
            ok = j
            ng = len(A)
            idx = binary_search(A, ok, ng, thresh)
            num += idx - j

    print(num)


def binary_search(li, ok, ng, value):
    while abs(ok-ng) > 1:
        mid = (ok + ng) // 2
        if li[mid] < value:
            ok = mid
        else:
            ng = mid

    return ok


if __name__ == "__main__":
    main()


Fixed submission:
import sys
input = sys.stdin.readline
 
 
def main():
    num = 0
    _ = input()
    A = sorted(list(map(int, input().split())))
    for i in range(len(A)-1):
        for j in range(i+1, len(A)):
            a = A[i]
            b = A[j]
            thresh = a + b
            ok = j
            ng = len(A)
            idx = binary_search(A, ok, ng, thresh)
            num += idx - j
 
    print(num)
 
 
def binary_search(li, ok, ng, value):
    while abs(ok-ng) > 1:
        mid = (ok + ng) // 2
        if li[mid] < value:
            ok = mid
        else:
            ng = mid
 
    return ok
 
 
if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
ef main():

    N, Q = map(int, input().split())
    G = [[] for _ in range(N)]
    for i in range(N-1):
        a, b = map(int, input().split())
        G[a-1].append(b - 1)

    q = deque()
    score = [0] * N
    for _ in range(Q):
        a, s = map(int, input().split())
        score[a-1] += s
    
    q.append(0)
    while q:
        tmp = q.pop()
        for v in G[tmp]:
            q.append(v)
            score[v] += score[tmp]

    print(*score)


if __name__ == '__main__':
    main()


Fixed submission:
from collections import deque


def main():
    N, Q = map(int, input().split())
    g = [[] for _ in range(N)]

    # for storing the value of the each node
    cnt = [0]*N

    # for DFS
    stack = deque()
    stack.append(0)
    seen = [0] * N

    # store the structure of the graph
    for i in range(N-1):
        a, b = map(int, input().split())
        g[b-1].append(a-1)
        g[a-1].append(b-1)

    # add values to parent nodes
    for i in range(Q):
        p, x = map(int, input().split())
        cnt[p-1] += x

    # DFS
    while len(stack):
        idx = stack.pop()
        seen[idx] += 1
        for c in g[idx]:
            if seen[c]:
                continue
            cnt[c] += cnt[idx]
            stack.append(c)

    print(*cnt)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
ef main():
    N = int(input())
    A = list(map(int, input().split()))
    A.insert(0, 1e10)
    ans = []
    B = [0] * len(A)
    for i in range(len(A)-1, 0, -1):
        idx = i
        s = 0
        while idx <= len(A) - 1:
            s += B[idx]
            idx += i

        if s % 2 != A[i]:
            ans.append(i)
            B[i] = 1

    
    if len(ans) > 0:
        print(len(ans))
        print(*ans)
    else:
        print(0)


if __name__ == '__main__':
    main()


Fixed submission:
def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.insert(0, 1e10)
    ans = []
    B = [0] * len(A)
    for i in range(len(A)-1, 0, -1):
        idx = i
        s = 0
        while idx <= len(A) - 1:
            s += B[idx]
            idx += i

        if s % 2 != A[i]:
            ans.append(i)
            B[i] = 1

    
    if len(ans) > 0:
        print(len(ans))
        print(*ans)
    else:
        print(0)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
N, *L,  = [list(map(int, s.split())) for s in open(0)]
A = L[0]
p
cnt = 0
for i in range(len(A) - 2):
    ma = max(A[i], A[i+1], A[i+2])
    mi = min(A[i], A[i+1], A[i+2])
    if A[i+1] not in [ma, mi]:
        cnt += 1
print(cnt)

Fixed submission:
N, *L,  = [list(map(int, s.split())) for s in open(0)]
A = L[0]

cnt = 0
for i in range(len(A) - 2):
    ma = max(A[i], A[i+1], A[i+2])
    mi = min(A[i], A[i+1], A[i+2])
    if A[i+1] not in [ma, mi]:
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
ef main():
    N = int(input())
    jobs = [list(map(int, input().split())) for _ in range(N)]
    time = 0
    jobs = sorted(jobs, key=lambda x: x[1])
    for j in jobs:
        time += j[0]
        if time > j[1]:
            print("No")
            return
        
    else:
        print("Yes")


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N = int(input())
    jobs = []
    time = 0
    for _ in range(N):
        A, B = map(int, input().split())
        jobs.append((A, B))

    jobs = sorted(jobs, key=lambda x: x[1])
    for j in jobs:
        time += j[0]
        if time > j[1]:
            print("No")
            return
        
    else:
        print("Yes")


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    H, W = map(int, input().split())
    A = [list(input()) for i in range(H)]
    right = [[0] * W for _ in range(H)]
    left = [[0] * W for _ in range(H)]
    upper = [[0] * W for _ in range(H)]
    under = [[0] * W for _ in range(H)]

    num_max_loc = 0

    for i in range(H):
        tmp_num = 0
        for j in range(W):
            if A[i][j] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                left[i][j] = tmp_num

    for i in range(H):
        tmp_num = 0
        for j in range(W-1, -1, -1):
            if A[i][j] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                right[i][j] = tmp_num

    for i in range(W):
        tmp_num = 0
        for j in range(H):
            if A[j][i] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                upper[j][i] = tmp_num

    for i in range(W):
        tmp_num = 0
        for j in range(H-1, -1, -1):
            if A[j][i] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                under[j][i] = tmp_num

    for i in range(H):
        for j in range(W):
            tmp_sum = (
                left[i][j] + right[i][j] + upper[i][j] + under[i][j] - 3)
            num_max_loc = max(num_max_loc, tmp_sum)

    print(num_max_loc)


if __name__ == '__main__':
    main()

Fixed submission:
def main():
    H, W = map(int, input().split())
    A = [list(input()) for i in range(H)]
    right = [[0] * W for _ in range(H)]
    left = [[0] * W for _ in range(H)]
    upper = [[0] * W for _ in range(H)]
    under = [[0] * W for _ in range(H)]

    num_max_loc = 0

    for i in range(H):
        tmp_num = 0
        for j in range(W):
            if A[i][j] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                left[i][j] = tmp_num

    for i in range(H):
        tmp_num = 0
        for j in range(W-1, -1, -1):
            if A[i][j] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                right[i][j] = tmp_num

    for i in range(W):
        tmp_num = 0
        for j in range(H):
            if A[j][i] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                upper[j][i] = tmp_num

    for i in range(W):
        tmp_num = 0
        for j in range(H-1, -1, -1):
            if A[j][i] == "#":
                tmp_num = 0
            else:
                tmp_num += 1
                under[j][i] = tmp_num

    for i in range(H):
        for j in range(W):
            tmp_sum = (
                left[i][j] + right[i][j] + upper[i][j] + under[i][j] - 3)
            num_max_loc = max(num_max_loc, tmp_sum)

    print(num_max_loc)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
A, = [s.split() for s in open(0)]
A = A[0]
acgt = []
for i in range(len(A)):
    for j in range(len(A), 0, -1):
        sub_string = A[i:j]
        for s in sub_string:
            if s not in ["A", "C", "G", "T"]:
                break 
        else:
            acgt.append(sub_string)
print(max([len(s) for s in acgt]))

Fixed submission:
A, = [s.split() for s in open(0)]
if len(A) == 0:
    A = [""]
else:
    A = A[0]
acgt = []
for i in range(len(A)):
    for j in range(len(A), 0, -1):
        sub_string = A[i:j]
        for s in sub_string:
            if s not in ["A", "C", "G", "T"]:
                break 
        else:
            acgt.append(sub_string)
if len(acgt) == 0:
    print(0)
else:
    print(max([len(s) for s in acgt]))
Buggy python submission (verdict: Time Limit Exceeded):
(k, s),  = [list(map(int, s.split())) for s in open(0)]

pairs = []
for i in range(k + 1):
    for j in range(k + 1):
        if s - i - j <= k and s - i - j >= 0 :
            l = s - i - j
            pairs.append((i, j, l))
print(len(pairs))

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

num = 0
for x in range(sk[0] + 1):
	for y in range(sk[0] + 1):
		if x + y <= sk[1] and sk[1] - x - y <= sk[0]:
			num += 1
        

print(num)

Buggy python submission (verdict: Time Limit Exceeded):
(k, s),  = [list(map(int, s.split())) for s in open(0)]

pairs = []
for i in range(k + 1):
    for j in range(k + 1):
        for l in range(k + 1):
            if i + j + l == s:
                pairs.append((i, j, l))
print(len(pairs))

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

num = 0
for x in range(sk[0] + 1):
	for y in range(sk[0] + 1):
		if x + y <= sk[1] and sk[1] - x - y <= sk[0]:
			num += 1
        

print(num)

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

num = 0
for x in range(sk[0] + 1):
  for y in range(sk[0] + 1):
    for z in range(sk[0] + 1):
      if (x + y + z) == sk[1]:
        num += 1
        

print(num)


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

num = 0
for x in range(sk[0] + 1):
	for y in range(sk[0] + 1):
		if x + y <= sk[1] and sk[1] - x - y <= sk[0]:
			num += 1
        

print(num)
Buggy python submission (verdict: Runtime Error):
print('Christmas' + ' Eve' * int(input()) % 5)


Fixed submission:
D = int(input())
s = ""
if D == 25:
    s = 'Christmas'
elif D == 24:
    s = 'Christmas Eve'
elif D == 23:
    s = 'Christmas Eve Eve'
elif D == 22:
    s = 'Christmas Eve Eve Eve'

print(s)

Buggy python submission (verdict: Runtime Error):
print('Christmas' - int(input()) % 5 * ' Eve')

Fixed submission:
D = int(input())
s = ""
if D == 25:
    s = 'Christmas'
elif D == 24:
    s = 'Christmas Eve'
elif D == 23:
    s = 'Christmas Eve Eve'
elif D == 22:
    s = 'Christmas Eve Eve Eve'

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
s=0
for i in range(len(a)):
    s+=a[i]*sum(a[i+1:])
print(s%(10**9+7))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
ss=sum(a)
s=0
for i in range(len(a)):
    ss=ss-a[i]
    s+=a[i]*ss
print(s%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
count=0
while len(a)>=2:
    ma=max(a)
    guess =a.index(ma)
    for i in range(guess+1,len(a)):
        count+=ma-a[i]
    a=a[:guess]
print(count)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=0
ma=a[0]
for i in range(1,len(a)):
    if a[i]<ma:
        count+=ma-a[i]
    else:
        ma=a[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
count=0
while len(a)>=2:
    ma=max(a)
    guess =a.index(ma)
    for i in range(guess,len(a)):
        count+=ma-a[i]
    a=a[:guess]
print(count)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=0
ma=a[0]
for i in range(1,len(a)):
    if a[i]<ma:
        count+=ma-a[i]
    else:
        ma=a[i]
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
count=0
while len(a)>=2:
    if a[0]>a[1]:
        count+=a[0]-a[1]
        w=a[0]
        a.pop(0)
        a[0]=w
    else:
        a.pop(0)
print(count)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
count=0
ma=a[0]
for i in range(1,len(a)):
    if a[i]<ma:
        count+=ma-a[i]
    else:
        ma=a[i]
print(count)
Buggy python submission (verdict: Runtime Error):
N=list(map(int,input().split()))
A=list(map(int,input().split()))
n=N[0]
k=N[1]
for i in range(k+1):
    if A[i]<A[k+i]:
        print("Yes")
    else:
        print("No")

Fixed submission:
N=list(map(int,input().split()))
A=list(map(int,input().split()))
n=N[0]
k=N[1]
for i in range(n-k):
    if A[i]<A[k+i]:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N=list(map(int,input().split()))
A=list(map(int,input().split()))
n=N[0]
k=N[1]
aves=[]
for x in range(n-k+1):
    ave=1
    for i in range(x,k+x):
        ave=ave*A[i]
    aves.append(ave)
for y in range(len(aves)-1):
    if aves[y]<aves[y+1]:
        print("Yes")
    else:
        print("No")

Fixed submission:
N=list(map(int,input().split()))
A=list(map(int,input().split()))
n=N[0]
k=N[1]
for i in range(n-k):
    if A[i]<A[k+i]:
        print("Yes")
    else:
        print("No")