Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
open = []
for _ in range(N):
    open.append(list(map(int,input().split())))
open = np.array(open)
sales = []
for _ in range(N):
    sales.append(list(map(int,input().split())))
sales = np.array(sales)

ans = -float("inf")
for i in range(1 , 1024):
    sum_val = 0
    mapping = []
    for k in range(N):
        cnt = 0
        for j in range(10):
            if i >> j & 1 and open[k][j] == 1:
                cnt += 1
        mapping.append(cnt)
    for k in range(N):
        sum_val += sales[k][mapping[k]]
    if sum_val > ans:
        ans = sum_val
print(ans)


Fixed submission:
N = int(input())
open = []
for _ in range(N):
    open.append(list(map(int,input().split())))
sales = []
for _ in range(N):
    sales.append(list(map(int,input().split())))

ans = -float("inf")
for i in range(1 , 1024):
    sum_val = 0
    mapping = []
    for k in range(N):
        cnt = 0
        for j in range(10):
            if i >> j & 1 and open[k][j] == 1:
                cnt += 1
        mapping.append(cnt)
    for k in range(N):
        sum_val += sales[k][mapping[k]]
    if sum_val > ans:
        ans = sum_val
print(ans)
Buggy python submission (verdict: Runtime Error):
abcd = list(input())
pirnt("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

Fixed submission:
abcd = list(input())
print("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c,d = input().split()
pirnt("Yes") if a==b==c or b==c==d else print("No")

Fixed submission:
abcd = list(input())
print("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c,d = input().split()
pirnt("Yes") if a==b==c or b==c==d else print("No")

Fixed submission:
abcd = list(input())
print("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c,d = input().split()
pirnt("Yes",if a==b==c or b==c==d else "No")

Fixed submission:
abcd = list(input())
print("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c,d = input()
pirnt("Yes",if a==b==c or b==c==d else "No")

Fixed submission:
abcd = list(input())
print("Yes") if abcd[2]==abcd[3]==abcd[1] or abcd[0]==abcd[1]==abcd[2] else print("No")
Buggy python submission (verdict: Runtime Error):
from pprint import pprint
'''
## O(1)のパターン
N , Z , W = map(int , input().split())

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

print(max(abs(a[N - 2] - a[N - 1]), abs(a[N - 1] - W)))
'''
## DPを使って解くとき
N , Z , W = map(int , input().split())
a = list(map(int , input().split()))
a.reverse()
a += [W]
#print(a)
memo = [[-1]* (N + 1) , [-1] * (N + 1)]
def DP(n , turn):

    if n == 1:
        #print(memo[turn][n])
        return abs(a[0] - W)
    if memo[turn][n] != -1:
        return memo[turn][n]
    if turn == 1:
        #print("turn : 1")
        tmp_max = 0
        for i in range(1 , n + 1):
            if i == n:
                tmp_max = max(tmp_max , abs(a[0]-W))
            else:
                tmp_max = max(tmp_max , DP(n - 1,1 - turn))
        #print("tmp_max : ",tmp_max)
        memo[turn][n] = tmp_max
        return tmp_max
    if turn == 0:
        tmp_min = 10 ** 9
        #print("turn : 0")
        for i in range(1 , n + 1):
            if i == n:
                tmp_min = min(tmp_min , abs(a[0]-W))
            else:
                tmp_min = min(tmp_min , DP(n - 1,1 - turn))
        #print("tmp_min : ",tmp_min)
        memo[turn][n] = tmp_min
        return tmp_min



print(DP(N , 1))
#print(memo)


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

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

print(max(abs(a[N - 2] - a[N - 1]), abs(a[N - 1] - W)))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
now = A[0]
start_idx = 0
while now <= A[-1] + 1:
    tmp_max = 0
    flag = True
    for i in range(start_idx, N):
        if flag and now - 1 == A[i]:
            flag = False
            start_idx = i
        if now - 1 <= A[i] <= now + 1:
            tmp_max += 1
    ans = max(tmp_max, ans)
    now += 1
print(ans)

Fixed submission:
from bisect import *
N = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 0
min_a = min(a)
max_a = max(a)
for x in range(min_a , max_a + 1):
    r = bisect_right(a , x + 1)
    l = bisect_left(a , x - 1)
    tmp_max = r - l
    if tmp_max > ans:
        ans = tmp_max
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
now = A[0]
start_idx = 0
while now <= A[-1] + 1:
    tmp_max = 0
    flag = True
    for i in range(start_idx, N):
        if flag and now - 1 == A[i]:
            flag = False
            start_idx = i
        if now - 1 <= A[i] <= now + 1:
            tmp_max += 1
    ans = max(tmp_max, ans)
    now += 1
print(ans)

Fixed submission:
from bisect import *
N = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 0
min_a = min(a)
max_a = max(a)
for x in range(min_a , max_a + 1):
    r = bisect_right(a , x + 1)
    l = bisect_left(a , x - 1)
    tmp_max = r - l
    if tmp_max > ans:
        ans = tmp_max
print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
S = list(input())
S = Counter(S)
S = list(S.keys())
S.sort()
for i in range(26):
    alph = chr(ord("a") + i)
    #print(alph)
    if S[i] != chr(ord("a") + i):
        print(alph)
        exit()
print("None")


Fixed submission:
from collections import Counter
S = list(input())
S = Counter(S)
S = list(S.keys())
S.sort()
for i in range(26):
    alph = chr(ord("a") + i)
    #print(alph)
    if i == len(S):
        print(chr(ord("a") + i))
        exit()
    elif S[i] != chr(ord("a") + i):
        print(alph)
        exit()

print("None")
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(x, y):
    return (x * y) // gcd(x, y)

N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
    print(T)

ans = lcm(T[0] , T[1])
for i in range(2 , N):
    ans = lcm(T[i] , ans)
print(ans)

Fixed submission:
import math


def lcm(a, b):
    return a * b // math.gcd(a, b)


N = int(input())
ans = int(input())
for _ in range(N - 1):
    ans = lcm(ans, int(input()))
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
    print(T)

ans = lcm(T[0] , T[1])
for i in range(2 , N):
    ans = lcm(T[i] , ans)
print(ans)

Fixed submission:
import math


def lcm(a, b):
    return a * b // math.gcd(a, b)


N = int(input())
ans = int(input())
for _ in range(N - 1):
    ans = lcm(ans, int(input()))
print(ans)
Buggy python submission (verdict: Runtime Error):
import bisect
N, M = map(int, input().split())
start_to_middle = []
middle_to_end = []
for i in range(M):
    a, b = map(int, input().split())
    if a == 1:
        start_to_middle.append(b)
    elif b == N:
        middle_to_end.append(a)
if not len(start_to_middle) or not len(middle_to_end):
    print('IMPOSSIBLE')
    exit()
middle_to_end.sort()
for middle in start_to_middle:
    idx = bisect.bisect_left(middle_to_end, middle)
    if middle_to_end[idx] == middle:
        print('POSSIBLE')
        exit()

print('IMPOSSIBLE')


Fixed submission:
N , M = map(int,input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
    a , b = map(int,input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)

for node0 in graph[0]:
    for node1 in graph[node0]:
        if node1 == N - 1:
            print("POSSIBLE")
            exit()
print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
if K in A:
    print("POSSIBLE")
    exit()
if max(A) < K or N == 1:
    print("IMPOSSIBLE")
    exit()

A.sort()
for i in range(1, N):
    tmp = abs(A[i - 1] - A[i])
    if K % tmp == 0:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
if K in A:
    print("POSSIBLE")
    exit()
if max(A) < K or N == 1:
    print("IMPOSSIBLE")
    exit()

A.sort()
for i in range(1, N):
    tmp = abs(A[i - 1] - A[i])
    if not tmp == 0 and K % tmp == 0:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
A = list(map(int, input().split()))
if max(A) < K:
    print("IMPOSSIBLE")
    exit()
if K in A:
    print("POSSIBLE")
    exit()

A.sort()
for i in range(1, N):
    tmp = abs(A[i - 1] - A[i])
    if K % tmp == 0:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")

Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
if K in A:
    print("POSSIBLE")
    exit()
if max(A) < K or N == 1:
    print("IMPOSSIBLE")
    exit()

A.sort()
for i in range(1, N):
    tmp = abs(A[i - 1] - A[i])
    if not tmp == 0 and K % tmp == 0:
        print("POSSIBLE")
        exit()
print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A_oddList = A[::2]
A_evenList = A[1::2]
A_oddList = A_oddList[::-1]
A_evenList = A_evenList[::-1]

if N % 2 == 1:
    print(*A_oddList ,*A_evenList)
else:
    A_oddList = A_oddList[::-1]
    print(*A_evenList , *A_oddList)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A_oddList = A[::2]
A_evenList = A[1::2]
A_oddList = A_oddList[::-1]
A_evenList = A_evenList[::-1]

if N % 2 == 1:
    A_evenList = A_evenList[::-1]
    print(*A_oddList , end = " ")
    print(*A_evenList)
else:
    A_oddList = A_oddList[::-1]
    print(*A_evenList , end = " ")
    print(*A_oddList)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))
A_oddList = A[::2]
A_evenList = A[1::2]
A_oddList = A_oddList[::-1]
A_evenList = A_evenList[::-1]

if N % 2 == 1:
    print(*A_oddList ,*A_evenList)
else:
    A_oddList = A_oddList[::-1]
    print(*A_evenList , *A_oddList)


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A_oddList = A[::2]
A_evenList = A[1::2]
A_oddList = A_oddList[::-1]
A_evenList = A_evenList[::-1]

if N % 2 == 1:
    A_evenList = A_evenList[::-1]
    print(*A_oddList , end = " ")
    print(*A_evenList)
else:
    A_oddList = A_oddList[::-1]
    print(*A_evenList , end = " ")
    print(*A_oddList)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
b = []
for a in A:
    b.append(a)
    b = b[::-1]
print(*b)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A_oddList = A[::2]
A_evenList = A[1::2]
A_oddList = A_oddList[::-1]
A_evenList = A_evenList[::-1]

if N % 2 == 1:
    A_evenList = A_evenList[::-1]
    print(*A_oddList , end = " ")
    print(*A_evenList)
else:
    A_oddList = A_oddList[::-1]
    print(*A_evenList , end = " ")
    print(*A_oddList)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
b = []
for a in A:
    b.append(a)
    b = b[::-1]
print(*b)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A_oddList = A[::2]
A_evenList = A[1::2]
A_oddList = A_oddList[::-1]
A_evenList = A_evenList[::-1]

if N % 2 == 1:
    A_evenList = A_evenList[::-1]
    print(*A_oddList , end = " ")
    print(*A_evenList)
else:
    A_oddList = A_oddList[::-1]
    print(*A_evenList , end = " ")
    print(*A_oddList)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
for _ in range(N):
    a = int(input())
    A.append(a - 1)
Flags = [False] * N
Flags[0] = True
now = 0
cnt = 0
while now != 1:
    cnt += 1
    next_node = A[now]
    if Flags[next_node]:
        print("-1")
        exit()
    now = next_node
print(cnt)


Fixed submission:
N = int(input())
A = []
for _ in range(N):
    a = int(input())
    A.append(a - 1)
Flags = [False] * N
Flags[0] = True
now = 0
cnt = 0
for _ in range(N):
    cnt += 1
    next_node = A[now]
    if next_node == 1:
        break
    if Flags[next_node]:
        print("-1")
        exit()
    Flags[next_node] = True
    now = next_node
print(cnt)
Buggy python submission (verdict: Runtime Error):
sequence = ((1, 3, 5, 7, 8, 10, 12), (4, 6, 9, 11), (2))

x , y = map(int, input().split())
for s in sequence:
    if x in s and y in s:
        print('Yes')
        exit()
print('No')



Fixed submission:
sequence = ((1, 3, 5, 7, 8, 10, 12), (4, 6, 9, 11), (2, ))

x , y = map(int, input().split())
for s in sequence:
    if x in s and y in s:
        print('Yes')
        exit()
print('No')
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
S = []
for _ in range(N):
    s = list(input())
    s.sort()
    S.append(s)

work = S[0]
for i in range(1 , N):
    work_lst = []
    for j in range(max(len(S[i]) , len(work))):
        if len(work) == 0 or len(S[i]) == 0:
            break
        if work[0] == S[i][0]:
            c = S[i].pop(0)
            c = work.pop(0)
            work_lst.append(c)
        elif work[0] > S[i][0]:
            S[i].pop(0)
        elif work[0] < S[i][0]:
            work.pop(0)
    work = work_lst
print("".join(work_lst))


Fixed submission:
from collections import Counter
N = int(input())
S = []
for _ in range(N):
    s = list(input())
    s.sort()
    S.append(s)

work = S[0]
for i in range(1 , N):
    work_lst = []
    while len(work) != 0 and len(S[i]) != 0:
        if work[0] == S[i][0]:
            c = S[i].pop(0)
            c = work.pop(0)
            work_lst.append(c)
        elif work[0] > S[i][0]:
            S[i].pop(0)
        elif work[0] < S[i][0]:
            work.pop(0)
    work = work_lst
if N == 1:
    print("".join(s))
else:
    print("".join(work_lst))
Buggy python submission (verdict: Runtime Error):
ZABCZ

Fixed submission:
s = input()
for i in range(len(s)):
    if s[i] == 'A':
        A_idx = i
        break
for i in range(len(s)):
    if s[i] == 'Z':
        Z_idx = i
print(Z_idx - A_idx + 1)
Buggy python submission (verdict: Time Limit Exceeded):
K , S = map(int , input().split())
count = 0
for i in range(0 , K + 1):
  for j in range(0 , K + 1):
    for k in range(0 , K + 1):
      if i + j + k == S:
	      count += 1
print(count)


Fixed submission:
K , S = map(int,input().split())
cnt = 0
for x in range(K + 1):
    for y in range(K + 1):
        if x + y > S:
            continue
        z = S - x - y
        if z <= K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
K , S = int(input().split())
count = 0
for i in range(K):
  for j in range(K):
    for k in range(k):
      if i + j + k == S:
	      count += 1
print(count)      

Fixed submission:
K , S = map(int,input().split())
cnt = 0
for x in range(K + 1):
    for y in range(K + 1):
        if x + y > S:
            continue
        z = S - x - y
        if z <= K:
            cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
import math
N = int(input())
A = list(map(int,input().split()))
A_count = Counter(A)
count_item = list(A_count.items())
count_item.sort()
start = 1 - (N % 2)
for i in range(math.ceil(N / 2)):
    if i == 0 and N % 2 == 1:
        if count_item[i][0] == 0 and count_item[i][1] != 1:
            print("0")
            exit()
    else:
        if count_item[i][0] != i * 2 + (1 - (N % 2)) or count_item[i][1] != 2:
            print("0")
            exit()
print(2 ** (N // 2) % (10 ** 9 + 7)

Fixed submission:
from collections import Counter
import math
N = int(input())
A = list(map(int,input().split()))
A_count = Counter(A)
count_item = list(A_count.items())
count_item.sort()
start = 1 - (N % 2)
for i in range(math.ceil(N / 2)):
    if i == 0 and N % 2 == 1:
        if count_item[i][0] == 0 and count_item[i][1] != 1:
            print("0")
            exit()
    else:
        if count_item[i][0] != i * 2 + (1 - (N % 2)) or count_item[i][1] != 2:
            print("0")
            exit()
print(2 ** (N // 2) % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
c = input()
l = ['a'、'e'、'i'、'o'、'u']
print('vowwl' if c in l else 'consonant')

Fixed submission:
c = input()
l = ['a','e','i','o','u']
print('vowel' if c in l else 'consonant')
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
string = [list("dream") ,  list("dreamer") , list("erase") ,list("eraser")]
for i in range(4):
    string[i] = string[i][::-1]
#print(string)
S = S[::-1]
#print(S[0:5])
while len(S) != 0:
    if S[0:5] == string[0]:
        for _ in range(5):
            S.pop(0)
    elif S[0:7] == string[1]:
        for _ in range(7):
            S.pop(0)
    elif S[0:5] == string[2]:
        for _ in range(5):
            S.pop(0)
    elif S[0:6] == string[3]:
        for _ in range(6):
            S.pop(0)
    else:
        print("NO")
        exit()
print("YES")

Fixed submission:
S = list(input())
#S = list("dream" * 20000)
string = [list("dream") ,  list("dreamer") , list("erase") ,list("eraser")]
for i in range(4):
    string[i] = string[i][::-1]
#print(string)
S = S[::-1]
#print(S[0:5])
idx = 0
#print(S[idx:5])
while idx != len(S):
    if S[idx:idx + 5] == string[0]:
        idx += 5
    elif S[idx:idx + 7] == string[1]:
        idx += 7
    elif S[idx:idx + 5] == string[2]:
        idx += 5
    elif S[idx:idx + 6] == string[3]:
        idx += 6
    else:
        print("NO")
        exit()
print("YES")
Buggy python submission (verdict: Time Limit Exceeded):
X = list(input())
now = 0
while now < len(X) - 1:
    if X[now] == 'S' and X[now + 1] == 'T':
        for _ in range(2):
            X.pop(now)
        now = max(0, now - 1)
    else:
        now += 1
print(len(X))

Fixed submission:
from collections import deque
right = deque(input())
left = deque()
while right:
    left.append(right.popleft())
    if not right:
        break
    while left and right and left[-1] == 'S' and right[0] == 'T':
        left.pop()
        right.popleft()
print(len(left))
Buggy python submission (verdict: Runtime Error):
str = input().split()
a = int(str[0])
b = int(str[1])
k = int(str[2])

x = max(0,a-k)
if x == 0:
    y = b + a - k

print(x,y)


Fixed submission:
str = input().split()
a = int(str[0])
b = int(str[1])
k = int(str[2])

x = max(0,a-k)
y = b;
if x == 0:
    y = max(0, b + a - k)

print(x,y)
Buggy python submission (verdict: Runtime Error):
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

X,K,D = LI()

sho = X // D
amari = X % D

if (sho>=K):
    saigo = X - (K*D)
    print(abs(saigo))
else:
    nokori = K - ans(sho)
    if nokori % 2 == 0:
        print(abs(amari))
    else:
        ans = min(amari+D,amari-D)
        print(abs(ans))
        

Fixed submission:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

X,K,D = LI()
X = abs(X)
sho = X // D
amari = X % D

if (sho>=K):
    saigo = X - (K*D)
    print(abs(saigo))
else:
    nokori = K - abs(sho)
    if nokori % 2 == 0:
        print(abs(amari))
    else:
        ans = min(amari+D,amari-D)
        print(abs(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N,K = LI()
A = LI()

hyoten = [1] * (N-K+1)

for i in range(N-K+1):
    for q in range(K):
        hyoten[i] *= A[i+q]


for j in range(len(hyoten)-1):
    if (hyoten[j+1]>hyoten[j]):
        print('Yes')
    else:
        print('No')

    

Fixed submission:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N,K = LI()
A = LI()

# hyoten = [1] * (N-K+1)

# for i in range(N-K+1):
#     for q in range(K):
#         hyoten[i] *= A[i+q]


# for j in range(len(hyoten)-1):
#     if (hyoten[j+1]>hyoten[j]):
#         print('Yes')
#     else:
#         print('No')

for i in range(N-K):
    if A[i] < A[i+K]:
        print('Yes')
    else:
        print('No')

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

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N,K = LI()
A = LI()

hyoten = [1] * (N-K+1)

for i in range(N-K+1):
    for q in range(K):
        hyoten[i] *= A[i+q]


for j in range(len(hyoten)-1):
    if (hyoten[j+1]>hyoten[j]):
        print('Yes')
    else:
        print('No')

Fixed submission:
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N,K = LI()
A = LI()

# hyoten = [1] * (N-K+1)

# for i in range(N-K+1):
#     for q in range(K):
#         hyoten[i] *= A[i+q]


# for j in range(len(hyoten)-1):
#     if (hyoten[j+1]>hyoten[j]):
#         print('Yes')
#     else:
#         print('No')

for i in range(N-K):
    if A[i] < A[i+K]:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()
# combs = list(itertools.combinations_with_replacement(range(1,int(N**0.5)), 3))
combs = list(itertools.product(range(1,int(N**0.5)), repeat=3))

sum = []
for comb in combs:
    temp = comb[0]**2 + comb[1]**2 + comb[2]**2+ comb[0]*comb[1]+ comb[1]*comb[2] + comb[2]*comb[0]
    sum.append(temp)

for i in range(1,N+1):
    print(sum.count(i))

Fixed submission:
import sys
import itertools
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

N = I()

# combs = list(itertools.product(range(1,int(N**0.5)), repeat=3))
combs = list(itertools.combinations_with_replacement(range(1,int(N**0.5)), 3))
sum = [0] * (N+1)

for comb in combs:
    temp = comb[0]**2 + comb[1]**2 + comb[2]**2+ comb[0]*comb[1]+ comb[1]*comb[2] + comb[2]*comb[0]
    if temp <= N:
        if comb[0] != comb[1] and comb[1] != comb[2] and comb[2] != comb[0]:
            sum[temp] += 6
            # sum.append(temp)
            # sum.append(temp)
            # sum.append(temp)
            # sum.append(temp)
            # sum.append(temp)
            # sum.append(temp)
        elif comb[0] == comb[1] == comb[2]:
            sum[temp] += 1
            # sum.append(temp)
        else:
            sum[temp] += 3
            # sum.append(temp)
            # sum.append(temp)
            # sum.append(temp)


for i,s in enumerate(sum):
    if i == 0:
        continue
    print(s)
# for i in range(1,N+1):
#     print(sum.count(i))

# elif (comb[0] == comb[1] and comb[1] != comb[2] and comb[2] != comb[0]) or (comb[0] != comb[1] and comb[1] == comb[2] and comb[2] != comb[0]) or (comb[0] != comb[1] and comb[1] != comb[2] and comb[2] == comb[0]):