Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
from inspect import currentframe

def chkprint(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

from functools import reduce
from math import floor, ceil

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

left = 1
center = 2
right = 3

res = 10**16



p = sum(A[0:left])
q = sum(A[left:center])
r = sum(A[center:right])
s = sum(A[right:])

# print(A)

while center <= N - 2:
  while True:
    p = sum(A[0:left])
    q = sum(A[left:center])

    if abs(p-q) < abs(p-q+2*A[left]):
      break

    if left == center-1:
      break

    left += 1

  while True:
    r = sum(A[center:right])
    s = sum(A[right:])

    if abs(r-s) < abs(r-s+2*A[right]):
      break

    if right == N-1:
      break

    right += 1

  res = min(max(p,q,r,s)-min(p,q,r,s),res)

  # print(A[0:left], A[left:center], A[center:right], A[right:], res)
  center += 1

print(res)


Fixed submission:
from inspect import currentframe

def chkprint(*args):
    names = {id(v):k for k,v in currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

from functools import reduce
from math import floor, ceil

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

left = 1
center = 2
right = 3

res = 10**16



p = sum(A[0:left])
q = sum(A[left:center])
r = sum(A[center:right])
s = sum(A[right:])

# print(A)

while center <= N - 2:
  while True:
    if abs(p-q) < abs(p-q+2*A[left]):
      break

    if left == center-1:
      break

    p += A[left]
    q -= A[left]
    left += 1

  while True:
    if abs(r-s) < abs(r-s+2*A[right]):
      break

    if right == N-1:
      break

    r += A[right]
    s -= A[right]
    right += 1

  res = min(max(p,q,r,s)-min(p,q,r,s),res)

  # print(A[0:left], A[left:center], A[center:right], A[right:], res)
  q += A[center]
  r -= A[center]
  center += 1

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools  import product, permutations

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

D = [list(map(int, input().split())) for _ in range(C)]

c = [list(map(lambda x: int(x)-1, input().split())) for _ in range(N)]

res = 1000*N*N

scores = [[0,0,0] for _ in range(C)]

for cc in range(C):
    for i,j in product(range(N), range(N)):
        if (i + j)%3 == 0:
            scores[cc][0] += D[c[i][j]][cc]
        if (i + j)%3 == 1:
            scores[cc][1] += D[c[i][j]][cc]
        if (i + j)%3 == 2:
            scores[cc][2] += D[c[i][j]][cc]



for c1, c2, c3 in permutations(range(C), 3):
    score = scores[c1][0] + scores[c2][1] + scores[c3][2]
    if res > score:
        res = score

print(res)



Fixed submission:
from itertools  import product, permutations

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

D = [list(map(int, input().split())) for _ in range(C)]

c = [list(map(lambda x: int(x)-1, input().split())) for _ in range(N)]

res = 1000*N*N

cnt = [[0]*C for _ in range(3)]


for i,j in product(range(N), range(N)):
    cnt[(i + j)%3][c[i][j]] += 1

for c1, c2, c3 in permutations(range(C), 3):
    score = 0
    for cc, cn in enumerate(cnt[0]):
        score += cn*D[cc][c1]
    for cc, cn in enumerate(cnt[1]):
        score += cn*D[cc][c2]
    for cc, cn in enumerate(cnt[2]):
        score += cn*D[cc][c3]
    if res > score:
        res = score

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

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

D = np.zeros((C,C), dtype=int)

for i in range(C):
    D[i] = np.array(input().split())

c = np.zeros((N,N), dtype=int)

for i in range(N):
    c[i] = np.array(input().split())

c -= 1

res = 1000*N*N

for c1 in range(C):
    for c2 in range(C):
        for c3 in range(C):
            if c1 == c2 or c2 == c3 or c3 == c1:
                continue
            score = 0
            for i in range(N):
                for j in range(N):
                    if (i + j)%3 == 0:
                        cc = c1
                    if (i + j)%3 == 1:
                        cc = c2
                    if (i + j)%3 == 2:
                        cc = c3

                    score += D[c[i][j]][cc]

            if res > score:
                res = score

print(res)



Fixed submission:
from itertools  import product, permutations

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

D = [list(map(int, input().split())) for _ in range(C)]

c = [list(map(lambda x: int(x)-1, input().split())) for _ in range(N)]

res = 1000*N*N

cnt = [[0]*C for _ in range(3)]


for i,j in product(range(N), range(N)):
    cnt[(i + j)%3][c[i][j]] += 1

for c1, c2, c3 in permutations(range(C), 3):
    score = 0
    for cc, cn in enumerate(cnt[0]):
        score += cn*D[cc][c1]
    for cc, cn in enumerate(cnt[1]):
        score += cn*D[cc][c2]
    for cc, cn in enumerate(cnt[2]):
        score += cn*D[cc][c3]
    if res > score:
        res = score

print(res)
Buggy python submission (verdict: Runtime Error):
n = int(input())
word = input().strip()

print(max([len(set([s for s in word[:i] if s in word[i:]])) for i in range(1, n-1)]))


Fixed submission:
n = int(input())
word = input().strip()

print(max([len(set([s for s in word[:i] if s in word[i:]])) for i in range(1, n)]))
Buggy python submission (verdict: Runtime Error):
s = input().strip()
K = int(input())


def min_substring(s, l, num):
    substrings = list(set([s[i:i+l] for i in range(len(s)-l+1)]))
    substrings.sort()

    return substrings[num]




rank = 0
top = min_substring(s, 1, rank)
res = top
k = 1
l = 2

while k < K:
    substrings = list(set([s[i:i+l] for i in range(len(s)-l+1) if s[i:i+l-1] == res]))
    substrings.sort()

    if len(substrings) == 0:
        rank += 1
        top = min_substring(s, 1, rank)
        res = top
        k += 1
        continue
    else:
        for string in substrings:
            k += 1
            res = string
            break

        l += 1

print(res)



Fixed submission:
s = input().strip()
K = int(input())

indices = [0]*5
substrings = [sorted(list(set([s[i:i+l] for i in range(len(s)-l+1)])))[:5]+['zzzzz'] for l in range(1,6)]
for k in range(K):
    s = min(substrings[l][i] for l, i in enumerate(indices))
    # print([substrings[l][i] for l, i in enumerate(indices)])
    indices[len(s)-1] += 1
    if k == K-1:
        print(s)
Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())
a = list(map(int,input().split()))
ans = min(a)-1
for i in range(1,102):
    if i in a:
        continue
    if abs(x-i) < abs(x-ans):
        ans = i
print(ans)

Fixed submission:
x,n = map(int,input().split())
a = list(map(int,input().split()))
if n == 0:
    print(x)
    exit()
ans = min(a)-1
for i in range(1,102):
    if i in a:
        continue
    if abs(x-i) < abs(x-ans):
        ans = i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,s = map(int,input().split())
a = list(map(int,input().split()))
dp = [[0 for i in range(s+1)] for j in range(n+1)]
dp[0][0] = 1
MOD = 998244353
for i in range(n):
    for j in range(s+1):
        dp[i+1][j] = dp[i][j]*2
        if a[i] <= j:
            dp[i+1][j] += dp[i][j-a[i]]
        dp[i+1][j] %= MOD
print(dp[n][s])

Fixed submission:
n,s = map(int,input().split())
a = list(map(int,input().split()))
dp = [[0 for i in range(s+1)] for j in range(n+1)]
dp[0][0] = 1
MOD = 998244353
for i in range(n):
    for j in range(s+1):
        dp[i+1][j] = dp[i][j]*2
        if a[i] <= j:
            dp[i+1][j] += dp[i][j-a[i]]
        dp[i+1][j] %= MOD
print(dp[n][s])
Buggy python submission (verdict: Runtime Error):
import math
a = int(input()
print(2*a*math.pi)


Fixed submission:
import math
a = int(input())
print(2*a*math.pi)

Buggy python submission (verdict: Runtime Error):
import math
a = int(input()
print(2*a*math.pi)

Fixed submission:
import math
a = int(input())
print(2*a*math.pi)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
a = list(map(int,input().split()))
sum = -314
for i in a:
  sum += a
if sum < 0:
  print(-1)
else:
  print(sum)

Fixed submission:
n,m = map(int,input().split())
a = list(map(int,input().split()))
sum = n
for i in a:
  sum -= i
if sum < 0:
  print(-1)
else:
  print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    c = 0
    if b > a:
        a,b = b,a
    while a % b != 0:
        c = b
        b = a % b
        a = c
    return b
K = int(input())
count = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            count += gcd(gcd(i,j),k)
print(count)

Fixed submission:
import math
K = int(input())
count = 0
for i in range(1,K+1):
    for j in range(i,K+1):
        for k in range(1,K+1):
            if i != j:
                count += 2 * math.gcd(math.gcd(i,j),k)
            else:
                count += math.gcd(math.gcd(i,j),k)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
def gcd(a,b):
    c = 0
    if b > a:
        a,b = b,a
    while a % b != 0:
        c = b
        b = a % b
        a = c
    return b
def gcd3(a,b,c):
    return gcd(gcd(a,b),c)
K = int(input())
count = 0
for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            count += gcd3(i,j,k)
print(count)

Fixed submission:
import math
K = int(input())
count = 0
for i in range(1,K+1):
    for j in range(i,K+1):
        for k in range(1,K+1):
            if i != j:
                count += 2 * math.gcd(math.gcd(i,j),k)
            else:
                count += math.gcd(math.gcd(i,j),k)
print(count)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
t = [0 for i in range(n)]
b = ""
a = True
for i in range(m):
    s,c = map(int,input().split())
    if t[s-1] != 0 and c == 0:
        a=False
    elif t[s-1] == 0 or t[s-1] == c:
        t[s-1] = c
    else:
        a=False
for i in range(n):
    b += str(t[i])
if n > 1 and b[0] == '0':
    b[0]=1
    print(b)
elif b[0] == '0':
    print(0)
elif a:
    print(b)
else:
    print(-1)

Fixed submission:
n,m = map(int,input().split())
t = [0 for i in range(n)]
e = [True for i in range(n)]
b = ""
a = False
for i in range(m):
    s,c = map(int,input().split())
    if e[s-1]:
        if s == 1 and c == 0:
            a = True
            if n == 1:
                print(0)
                exit()
        else:
            t[s-1] = c
            e[s-1] = False
    else:
        if t[s-1] != c:
            a = True
for i in range(n):
    b += str(t[i])
if a:
    print(-1)
elif n > 1 and b[0] == '0':
    print(str(1)+b[1:3])
else:
    print(b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]
t = set(s)
ma = 0
tmp = []
for i in t:
    tmp2 = s.count(i)
    if ma < tmp2:
        ma = tmp2
        tmp = [i]
    elif ma == tmp2:
        tmp.append(i)
tmp.sort()
#print()
for i in tmp:
    print(i)


Fixed submission:
n = int(input())
s = [input() for i in range(n)]
s.sort()
max = 0
count = 1
for i in range(1,n):
    if s[i] == s[i-1]:
        count+=1
    else:
        if max < count:
            max = count
            count=1
        else:
            count=1
if max < count:
    max = count
count = 1
ans = []
for i in range(1,n):
    if s[i] == s[i-1]:
        count+=1
    else:
        if max == count:
            ans.append(s[i-1])
            count = 1
        else:
            count = 1
if max == count:
    ans.append(s[n-1])
for i in range(len(ans)):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [input() for i in range(n)]
t = set(s)
ma = 0
tmp = []
for i in t:
    if ma < s.count(i):
        ma = s.count(i)
for i in t:
    if ma == s.count(i):
        tmp.append(i)
tmp.sort()
#print()
for i in tmp:
    print(i)


Fixed submission:
n = int(input())
s = [input() for i in range(n)]
s.sort()
max = 0
count = 1
for i in range(1,n):
    if s[i] == s[i-1]:
        count+=1
    else:
        if max < count:
            max = count
            count=1
        else:
            count=1
if max < count:
    max = count
count = 1
ans = []
for i in range(1,n):
    if s[i] == s[i-1]:
        count+=1
    else:
        if max == count:
            ans.append(s[i-1])
            count = 1
        else:
            count = 1
if max == count:
    ans.append(s[n-1])
for i in range(len(ans)):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 0
for i in range(1,n):
    ans+=i
print(ans)

Fixed submission:
n = int(input())
print(n*(n+1)//2 - n)
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int,input().split()))
import math
ans = a[0]
for i in range(1,N):
    ans = math.gcd(ans,a[i])
print(ans)

Fixed submission:
def gcd(a,b):
    return gcd(b, a % b) if b else abs(a)
N = int(input())
a = list(map(int,input().split()))
import math
ans = a[0]
for i in range(1,N):
    ans = gcd(ans,a[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = [list(map(int,input().split())) for i in range(n)]
for x,y,h in t:
    if h > 0:
        a = [x,y,h]            # hが0でない1つの組(地面以外の部分)

for cx in range(101):
    for cy in range(101):
        flag = True
        ch = abs(a[0]-cx) + abs(a[1] - cy) + a[2]     # 高さ
        for x,y,h in t:
            if h != max(ch - abs(x - cx) - abs(y - cy),0):　　　# 高さが条件に合うか 
                flag = False
                break
        if flag:
            print(cx,cy,ch)
            exit()

Fixed submission:
n = int(input())
t = [list(map(int,input().split())) for i in range(n)]
for x,y,h in t:
    if h > 0:
        a = [x,y,h]            # hが0でない1つの組(地面以外の部分)

for cx in range(101):
    for cy in range(101):
        flag = True
        ch = abs(a[0]-cx) + abs(a[1] - cy) + a[2]     # 高さ
        for x,y,h in t:
            if h != max(ch - abs(x - cx) - abs(y - cy),0):    # 高さが条件に合うか 
                flag = False
                break
        if flag:
            print(cx,cy,ch)
            exit()
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())
a = []
for i in range(h):
    ai = list(map(int,input().split()))
    a.append(ai)
ans = []
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 == 1:
            ans.append([i+1,j+1,i+1,j+2])
            a[i][j+1] += 1
for i in range(h-1):
    if a[-1][i] % 2 == 1:
        ans.append([i+1,w,i+2,w])
        a[-1][i+1] += 1
print(len(ans))
for i,j,k,l in ans:
    print(i,j,k,l)

Fixed submission:
h,w = map(int,input().split())
a = []
for i in range(h):
    ai = list(map(int,input().split()))
    a.append(ai)
ans = []
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 == 1:
            ans.append([i+1,j+1,i+1,j+2])
            a[i][j+1] += 1
for i in range(h-1):
    if a[i][-1] % 2 == 1:
        ans.append([i+1,w,i+2,w])
        a[i+1][-1] += 1
print(len(ans))
for i,j,k,l in ans:
    print(i,j,k,l)
Buggy python submission (verdict: Runtime Error):
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**5+1
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 0
tmp = 0
for i in range(n):
    if a[i] == a[-1]:
        break
    if cmb(a[-1],a[i],mod) > ans:
        ans = cmb(a[-1],a[i],mod)
        tmp = a[i]
print(a[-1],tmp)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = 10**18
for i in range(n-1):
    if abs(a[i] - a[-1]/2) < abs(ans - a[-1]/2):
        ans = a[i]
print(a[-1],ans)
Buggy python submission (verdict: Runtime Error):
from collections import deque
h,w = map(int,input().split())
d = [input() for i in range(h)]
count = 0
for i in range(h):
    for j in range(w):
        if d[i][j] == '#':
            count+=1
visited = [[0 for i in range(w)] for i in range(h)]
def bfs(sy,sx,gy,gx):
    que = deque()
    que.append((sy,sx))
    visited[sy][sx] = 0
    while que:
        y,x = que.popleft()
        if y == gy and x == gx:
            return visited[y][x]
        for dy,dx in [(-1,0),(1,0),(0,-1),(0,1)]:
            ny,nx = y+dy, x+dx
            if ny < 0 or nx < 0 or ny >= h or nx >= w:
                continue
            elif d[ny][nx] == '#':
                continue
            elif visited[ny][nx] != 0:
                continue
            else:
                visited[ny][nx] = visited[y][x] + 1
                que.append((ny,nx))
    return visited[gy][gx]
ans = bfs(0,0,h-1,w-1)
if ans = 0:
    print(-1)
    exit()
print(h*w - ans - count - 1)

Fixed submission:
from collections import deque
h,w = map(int,input().split())
d = [input() for i in range(h)]
count = 0
for i in range(h):
    for j in range(w):
        if d[i][j] == '#':
            count+=1
visited = [[0 for i in range(w)] for i in range(h)]
def bfs(sy,sx,gy,gx):
    que = deque()
    que.append((sy,sx))
    visited[sy][sx] = 0
    while que:
        y,x = que.popleft()
        if y == gy and x == gx:
            return visited[y][x]
        for dy,dx in [(-1,0),(1,0),(0,-1),(0,1)]:
            ny,nx = y+dy, x+dx
            if ny < 0 or nx < 0 or ny >= h or nx >= w:
                continue
            elif d[ny][nx] == '#':
                continue
            elif visited[ny][nx] != 0:
                continue
            else:
                visited[ny][nx] = visited[y][x] + 1
                que.append((ny,nx))
    return visited[gy][gx]
ans = bfs(0,0,h-1,w-1)
if ans == 0:
    print(-1)
    exit()
print(h*w - ans - count - 1)
Buggy python submission (verdict: Runtime Error):
S = input()
count =  0
for i in S:
  if i == '1':
    count++
print(count)

Fixed submission:
S = input()
count =  0
for i in S:
  if i == '1':
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import math
def lcm(a,b):
    return (a*b) // math.gcd(a,b)
n = int(input())
t = []
for i in range(n):
    a = int(input())
    t.append(a)
b = t[0]
for i in range(1,n):
    b = lcm(b,t[i])
print(b)

Fixed submission:
def gcd(a,b):
    return gcd(b,a % b) if b else abs(a)
def lcm(a,b):
    return (a*b) // gcd(a,b)
n = int(input())
t = []
for i in range(n):
    a = int(input())
    t.append(a)
b = t[0]
for i in range(1,n):
    b = lcm(b,t[i])
print(b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
T = [False for i in range(n)]
tmp = 1
T[0] = True
count = 1
while True:
    tmp = a[tmp-1]
    if T[tmp -1]:
        print(-1)
        exit()
    if tmp == 2:
        print(count)
        break
    count+=1

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
T = [False for i in range(n)]
tmp = 1
T[0] = True
count = 1
while True:
    tmp = a[tmp-1]
    if T[tmp -1]:
        print(-1)
        exit()
    T[tmp-1] = True
    if tmp == 2:
        print(count)
        break
    count+=1
Buggy python submission (verdict: Runtime Error):
n = int(input())
MOD = 10**9+7
a = list(map(int,input().split()))
a.sort()
if n % 2 == 0:
    if a[0] != 1 or a[1] != 1 or a[2] == 1:
        print(0)
        exit()
    j = 3
    for i in range(2,n,2):
        if a[i] != j:
            print(0)
            exit()
        j += 2
    j = 3
    for i in range(3,n,2):
        if a[i] != j:
            print(0)
            exit()
        j+=2
if n % 2 != 0:
    if a[0] != 0 or a[1] == 0:
        print(0)
        exit()
    j = 2
    for i in range(1,n,2):
        if a[i] != j:
            print(0)
            exit()
        j += 2
    j = 2
    for i in range(2,n,2):
        if a[i] != j:
            print(0)
            exit()
        j+=2
print(pow(2,(n//2),MOD))

Fixed submission:
n = int(input())
MOD = 10**9+7
a = list(map(int,input().split()))
if n == 1 and a[0] == 0:
    print(1)
    exit()
elif n == 1:
    print(0)
    exit()
if n == 2 and a[0] == 1 and a[1] == 1:
    print(1)
    exit()
elif n == 2:
    print(0)
    exit()
a.sort()
if n % 2 == 0:
    if a[0] != 1 or a[1] != 1 or a[2] == 1:
        print(0)
        exit()
    j = 3
    for i in range(2,n,2):
        if a[i] != j:
            print(0)
            exit()
        j += 2
    j = 3
    for i in range(3,n,2):
        if a[i] != j:
            print(0)
            exit()
        j+=2
if n % 2 != 0:
    if a[0] != 0 or a[1] == 0:
        print(0)
        exit()
    j = 2
    for i in range(1,n,2):
        if a[i] != j:
            print(0)
            exit()
        j += 2
    j = 2
    for i in range(2,n,2):
        if a[i] != j:
            print(0)
            exit()
        j+=2
print(pow(2,(n//2),MOD))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
#print(a)

prev = 0
now = 1
for i in range(n - (k - 1)):
#    print(i)#
    if i ==0:
        for j in a[i: k + i]:
    #        print(j)#
            now *= j
    elif i >= 1:
#        print(a[i - 1], a[k+i-1]) #
#        print(prev,now)#
        now = (prev / a[i - 1]) * a[k+i-1]
#        print(prev,now)#
        if prev >= now:
            print("No")
        else:
            print("Yes")
    prev = now
    now = 1
#    print(prev,now)#

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
#print(a)

for i in range(n - (k - 1)):
    if i >=1:
        if a[i - 1] < a[k+i-1]:
            print("Yes")
        else:
            print("No")

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

prev = 0
now = 1
for i in range(n - (k - 1)):
#    print(i)#
    for j in a[i: k + i]:
#        print(j)#
        now *= j
    if i >= 1:
#        print(prev,now)#
        if prev >= now:
            print("No")
        else:
            print("Yes")
    prev = now
    now = 1

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
#print(a)

for i in range(n - (k - 1)):
    if i >=1:
        if a[i - 1] < a[k+i-1]:
            print("Yes")
        else:
            print("No")
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
A = [chr(ord('a') + i) for i in range(26)]

if N <= 26:
    print(A[N-1])
    exit()

B = math.log(N, 26)
B = math.ceil(B)
#print(B)

C = [26]
for i in range(2, B):
        D = 26**i
        C.append(D)

#print(C[::-1])

ans = []
for i in C[::-1]:
    D = int(N // i)
    if D == 0:
        ans.append(A[N-1])
        print(''.join(ans))
    else:
#        print(D)
        ans.append(A[D-1])
        N %= i
#        print(N)


Fixed submission:
N = int(input())

ans = ''
while N > 0:
    N -= 1#この行の意味が分からずに失敗した。今も分からない
    ans += chr(ord('a') + N % 26)
    N //= 26
print(ans[::-1])