Harryxun/stf_run huggingface dataset:
N, K = list(map(int, input().split()))
S = input()

ans = -1    # 十分に小さい値
if (S[0] == '0'):
    stand = 1
else:
    stand = 0

L = 0
R = 0

# 尺取り法
while (R < N):
    # 右端を進めることが可能（進めたときの積がK以下）なら、右端を進める
    if (stand <= K):
        ans = max(ans, R - L + 1)
        if (S[R] == '1' and S[R + 1] == '0'):
            stand += 1
        R += 1
    # 進められない場合、左端と右端が同じなら両者を進める
    # 左端が右端を追い越さないための処理
    elif (L == R):
        L += 1
        R += 1
    # それ以外は左端のみを進める
    else:
        if (S[L] == '0' and S[L + 1] == '1'):
            stand -= 1
        L += 1


### FIXED CODE ###

N, K = list(map(int, input().split()))
S = input()

S = S + 'E'   # 終端処理
ans = -1    # 答えの初期値（十分に小さい値）

# 立った人の連続の数
if (S[0] == '0'):
    stand = 1
else:
    stand = 0

L = 0
R = 0

# 尺取り法
while (R < N):
    # 右端を進めることが可能（立った人の連続の数がK以下）なら、右端を進める
    if (stand <= K):
        # 立った人の連続の集合数が増えるなら1足す
        if (S[R] == '1' and S[R + 1] == '0'):
            stand += 1
        ans = max(ans, R - L + 1)
        R += 1
    # 進められない場合、左端と右端が同じなら両者を進める
    # 左端が右端を追い越さないための処理
    elif (L == R):
        L += 1
        R += 1
    # それ以外は左端のみを進める
    else:
        # 立った人の連続の数が減るなら1減らす
        if (S[L] == '0' and S[L + 1] == '1'):
            stand -= 1
        L += 1

print(ans)
from collections import deque

h,w=map(int,input().split())
ch,cw=map(int,input().split())
dh,dw=map(int,input().split())
ch-=1
cw-=1
dh-=1
dw-=1

maze=[list(input()) for i in range(h)]
distance=[[float('inf') for j in range(w)] for i in range(h)]

distance[ch][cw]=0


Q=deque()
Q.append((ch,cw))


while Q:
  p=Q.popleft()
  if p[0]==dh and p[1]==dw:
    break
  
  dx=[1,1,-1,-1]
  dy=[-1,1,-1,1]
  dddx=[2,2,2,2,2,1,1,1,1,1,0,0,0,0,-1,-1,-1,-1,-1,-2,-2,-2,-2,-2]
  dddy=[2,1,0,-1,-2,2,1,0,-1,-2,2,1,-1,-2,2,1,0,-1,-2,2,1,0,-1,-2]

  for i in range(4):
    nx=p[0]+dx[i]
    ny=p[1]+dy[i]

    if 0<=nx<h and 0<=ny<w and maze[nx][ny]!='#':
      if distance[nx][ny]<distance[p[0]][p[1]]:
        Q.append((nx,ny))
      distance[nx][ny]=distance[p[0]][p[1]]

  
  for j in range(24):
    nnnx=p[0]+dddx[j]
    nnny=p[0]+dddy[j]

    if 0<=nnnx<h and 0<=nnny<w and maze[nnnx][nnny]!='#':
      
      Q.appendleft((nx,ny))
      distance[nnnx][nnny]=min(distance[nnnx][nnny],distance[p[0]][p[1]]+1)


if distance[dh][dw]==float('inf'):
  print(-1)
  exit()


print(distance[dh][dw])

### FIXED CODE ###

from collections import deque

h,w=map(int,input().split())
ch,cw=map(int,input().split())
dh,dw=map(int,input().split())
ch-=1
cw-=1
dh-=1
dw-=1

maze=[list(input()) for i in range(h)]

Q=deque()
Q.append((ch,cw,0))

dx=[1,0,-1,0]
dy=[0,1,0,-1]
ddx=[2,2,2,2,2,-2,-2,-2,-2,-2,1,1,1,1,-1,-1,-1,-1,0,0]
ddy=[-2,-1,0,1,2,-2,-1,0,1,2,2,1,-1,-2,2,1,-1,-2,2,-2]

dp=[[float('inf')]*w for i in range(h)]


while Q:
  p=Q.popleft()
  if p[0]==dh and p[1]==dw:
    print(p[2])
    exit()
  
  for i in range(4):
    nx=p[0]+dx[i]
    ny=p[1]+dy[i]

    if 0<=nx<h and 0<=ny<w and maze[nx][ny]=='.' and p[2]<dp[nx][ny]:
      Q.appendleft((nx,ny,p[2]))
      dp[nx][ny]=p[2]

  for j in range(20):
    nnx=p[0]+ddx[j]
    nny=p[1]+ddy[j]

    if 0<=nnx<h and 0<=nny<w and maze[nnx][nny]=='.' and p[2]+1<dp[nnx][nny]:
      Q.append((nnx,nny,p[2]+1))
      dp[nnx][nny]=p[2]+1


print(-1)
import numpy as np
import pandas as pd

a = input()
b = list(input())

### FIXED CODE ###


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

while all(a % 2 == 0 for a in A):
  A = [a/2 for a in A]
  count += 1
  
print(count)
if 500*K < X :
	print("No")
else :
  print("Yes")

### FIXED CODE ###

K,X = map(int,input().split())
if 500*K<X:
  print("No")
else:
  print("Yes")
import sys

N = int(input())
H = list(map(int, input().split()))
ans = ("Yes")

for i in range(N-1):
  if H[i] - H[i+1] == 1:
    H[i+1] -= 1
  elif H[i] - H[i+1] >= 2:
    ans = ("No")
    print(ans)
    sys.exit()

print(ans)

### FIXED CODE ###

A, B, C = list(map(int, input().split()))
ans = max(C-A+B, 0)
print(ans)
from collections import Counter
n=int(input())
V=list(map(int,input().split()))
if len(set(V))==1:
  print(n//2)
else:
  v1=Counter(V[::2])
  v2=Counter(V[1::2])
  ans=0
  if v1.most_common()[0][0]==v2.most_common()[0][0]:
    if v1.most_common()[0][1]>v2.most_common()[0][1]:
      v1_s=v1.most_common()[0][1]
      v2_s=v2.most_common()[1][1]
    else:
      v1_s=v1.most_common()[1][1]
      v2_s=v2.most_common()[0][1]
  if len(v1)!=1:
    ans+=len(list(v1.elements()))-v1_s
  if len(v2)!=1:
    ans+=len(list(v2.elements()))-v2_s
  print(ans)

### FIXED CODE ###

from collections import Counter
n = int(input())
v = list(map(int, input().split()))
a = Counter(v[::2]).most_common()
b = Counter(v[1::2]).most_common()
if len(a) ==1:
  a.append([0,0])
if len(b) == 1:
  b.append([0,0])
if a[0][0] == b[0][0]:
  if a[1][1]>b[1][1]:
    print(n-a[1][1] - b[0][1])
  else:
    print(n-a[0][1]-b[1][1])
else:
  print(n-a[0][1]-b[0][1])
def findTrailingZeros(n): 
      
    # If n is odd 
    if (n & 1): 
        return 0
  
    # If n is even 
    else: 
        ans = 0
  
        # Find the trailing zeros 
        # in n/2 factorial 
        n //= 2
        while (n): 
            ans += n // 5
            n //= 5
  
        # Return the required answer 
        return ans 
  
# Driver code 
  
 input(n)
  
print(findTrailingZeros(n)) 
  

### FIXED CODE ###

def fun(n):
    if n%2!=0:
        return 0
    else:
        ans=0
        n//=2
        while(n):
            ans=ans+n//5
            n=n//5
    return ans


n = int(input())
if n>=2:
    print(fun(n))
else:
    print(0)
N = int(input())
hlist = list(map(int, input().split()))

def f(i, n):
  if i==0:
    return n
  if i==1:
    return n + abs(hlist[1]-hlist[0])
  return min(f(i-1, n+abs(hlist[i]-hlist[i-1])), f(i-2, n+abs(hlist[i]-hlist[i-2])))
print(f(N-1, 0))

### FIXED CODE ###

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

dp = [-1 for _ in range(N)]
dp[0] = 0
for n in range(N-2):
  cost = dp[n] + abs(hlist[n]-hlist[n+1])
  dp[n+1] = min(dp[n+1], cost) if dp[n+1] != -1 else cost
  cost = dp[n] + abs(hlist[n]-hlist[n+2])
  dp[n+2] = min(dp[n+2], cost) if dp[n+2] != -1 else cost
cost = dp[-2] + abs(hlist[-2]-hlist[-1])
dp[-1] = min(dp[-1], cost) if dp[-1] != -1 else cost
print(dp[-1])
n = int(input())

if n % 2==0
	print(n)
else:
  print(n*2)

### FIXED CODE ###

n = int(input())

if n % 2==0:
  print(n)
else:
  print(n*2)
import math

def solve(k):
    l = int(math.log2(k + 1))
    if k + 1 == 2 ** l:
        ans = 0
        for i in range(l):
            if v[i] > 0:
                ans += v[i]
        return ans
    else:
        return max(solve(k - 2 ** l) + v[l], solve(2 ** l - 1))

N, K = map(int, input().split())
A = list(map(int, input().split()))
bit = [0] * 40
for i in A:
    for j in range(40):
        bit[j] += (i >> j) & 1
w = [0] * 40
v = [0] * 40
for i in range(40):
    w[i] = 1 << i
    v[i] = (N - bit[i] - bit[i]) * w[i]
print(solve(K)+sum(A))


### FIXED CODE ###

N, K = map(int, input().split())
A = list(map(int, input().split()))
bit = [0] * 41
for i in A:
    for j in range(41):
        bit[j] += (i >> j) & 1
x = {}
for i in range(41):
    x[i, 0] = 2 ** i * bit[i]
    x[i, 1] = 2 ** i * (N - bit[i])
ans = sum(A)
for i in range(41):
    if ((K + 1) >> i) & 1 == 0:
        continue
    f = 0
    for j in range(i):
        f += max(x[j, 0], x[j, 1])
    f += x[i, 0]
    for j in range(i + 1, 41):
        f += x[j, ((K + 1) >> j) & 1]
    ans = max(ans, f)
print(ans)
n, k = map(int, input().split())
lst = [int(input()) for i in range(n)]
print(sum(sorted(lst)[:k])

### FIXED CODE ###

n, k = map(int, input().split())
lst = list(map(int, input().split()))
print(sum(sorted(lst)[::-1][:k]))
#https://atcoder.jp/contests/abc089/tasks/abc089_c
import itertools
N = int(input())
S = [input() for _ in range(N)]
march = [0]*N
ans = 0
for s in S:
    if s[0] == "M":
        march[0] +=1
    if s[0] == "A":
        march[1] +=1
    if s[0] == "R":
        march[2] +=1
    if s[0] == "C":
        march[3] +=1
    if s[0] == "H":
        march[4] +=1

for i,j,k in itertools.combinations(march,3):
    ans += i*j*k
print(ans)

### FIXED CODE ###

#https://atcoder.jp/contests/abc089/tasks/abc089_c
import itertools
N = int(input())
S = [input() for _ in range(N)]
M,A,R,C,H = 0,0,0,0,0
ans = 0
for s in S:
    if s[0] == "M":
        M +=1
    if s[0] == "A":
        A +=1
    if s[0] == "R":
        R +=1
    if s[0] == "C":
        C +=1
    if s[0] == "H":
        H +=1

for i,j,k in itertools.combinations([M,A,R,C,H],3):
    ans += i*j*k
print(ans)
N=int(input())
S=input()
K=int(input())
Slist =list(S)
for i in range(N):
	if Slist[K] == Slist[i]:
		continue
	else:
		Slist[i]="*"
S = ''.join(Slist)
print(S)

### FIXED CODE ###

N=int(input())
S=input()
K=int(input())
Slist =list(S)
for i in range(N):
	if Slist[K-1] == Slist[i]:
		continue
	else:
		Slist[i]="*"
S = ''.join(Slist)
print(S)
b = int(input())

enkitsui = {'A':'T','C':'G','T':'A','G':'C'}
print(enkitsui.value['b'])

### FIXED CODE ###

b = input()
enkitsui = {'A':'T','C':'G','T':'A','G':'C'}
print(enkitsui[b])
s = input()
search="keyence"
idx=0
flg = False
ans="NO"
if s.find(search)>=0:
    print("YES")
elif:
    for i in range(7):
        x=s.find(search[0:i+1])
        print("ps=%s, ns=%s, reduce=%s" %(search[0:i+1], search[i+1:], s[x+i+1:]))
        if x == -1:
            break
        if x == 0:
            if s[x+i:].find(search[i+1:])>=0:
                ans = "YES"
                break
    print(ans)


### FIXED CODE ###

s = input()
search="keyence"
idx=0
flg = False
ans="NO"
n = len(s)
if s[0:7] == search:
    print("YES")
elif (s[-7:] == search):
    print("YES")
else:
    for i in range(7):
        if s[0:i+1] == search[0:i+1]:
            #print(s[(-7+i+1):])
            #print(search[i+1:])
            if (s[(-7+i+1):] == search[i+1:]):
                ans = "YES"
                break
    print(ans)
while True:
    H,W=[int(i) for i in input().split(" ")]
    if H==W==0:
        break
    print("#"*(W))
    for h in range(H-2):
        print(("."*(W-2)).join(("#","#")))
    print("#"*(W))
    print()

### FIXED CODE ###

while True:
    h,w = tuple([int(x) for x in raw_input().split(" ")])
    if h==0 and w==0: break
 
    for ih in range(h):
        if ih==0 or ih==h-1 or w <= 2: print "#" * w
        else: print "#" + "." * (w-2) + "#"
 
    print ""
N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0 for i in range(1, N+2)]
i=1
while i<=N+1:
    D[0]=0
    D[i]=D[i-1]+L[i-1]
    if D[i]>X:
        print(i)
        break
    i+=1

### FIXED CODE ###

N,X=map(int,input().split())
L=list(map(int,input().split()))
D=[0 for i in range(1, N+2)]
i=1
while i<=N:
    D[0]=0
    D[i]=D[i-1]+L[i-1]
    if D[i]>X:
        print(i)
        break
    i+=1
else:
    print(i)
H, W = map(int, input().split())
S = ['.' * (W + 2)] + ['.' + input() + '.' for _ in range(H)] + ['.' * (W + 2)]
ans = [[] for _ in range(H)]
N = [(1, 1), (1, 0), (1, -1), (0, 1), (0, -1), (-1, 1), (-1, 0), (-1, -1)]
for h in range(1, H + 1):
    for w in range(1, W + 1):
        if S[h][w] == '#':
            ans[h - 1].append('#')
        else:
            ans[h - 1].append(sum([S[h + n[0]][w + n[1]] == '#' for n in N]))

for h in range(H):
    print(''.join(ans[h]))


### FIXED CODE ###

H, W = map(int, input().split())
S = ['.' * (W + 2)] + ['.' + input() + '.' for _ in range(H)] + ['.' * (W + 2)]

N = [(0, 1), (1, 0), (1, 1), (0, -1), (-1, 0), (1, -1), (-1, 1), (-1, -1)]
ans = [[] for _ in range(H)]
for h in range(1, H + 1):
    for w in range(1, W + 1):
        if S[h][w] == '.':
            ans[h - 1].append(sum([S[h + n[0]][w + n[1]] == '#' for n in N]))
        else:
            ans[h - 1].append('#')

for h in range(H):
    print(''.join(map(str, ans[h])))
a = input().split(" ")
print(a[0]*a[1])

### FIXED CODE ###

a = input().split(" ")
print(int(a[0])*int(a[1]))
N=int(input())
count=0
for i in range(1,N):
  if len(i)%2!=0:
    count+=1
print(count)

### FIXED CODE ###

N=int(input())
count=0
for i in range(1,N+1):
  if len(str(i))%2!=0:
    count+=1
print(count)
#文字列
s=list(input())
n=int(input())
for i in range(n):
    li = input().split()
    if(li[0]=="1"):
        s.reverse()
    else:
        if(li[1]=="1"):
            s.insert(0, li[2])
        else:
            s.append(li[2])

print("".join(s))


### FIXED CODE ###

#C消費税
h,j = map(int,input().split())
s=int(h*(25/2))
while True:
    hh=int(s*(2/25))
    jj=int(s/10)
    if(hh==h and jj==j):
        print(s)
        exit()
    if(hh>h and jj>j):
        print(-1)
        exit()
    s+=1
N = raw_input()
N = int(N)

a = []
for i in range(N):
	s_input = raw_input()
	s_input = int(s_input)
	if s_input in a:
		a.remove(s_input)
	else:
		a.append(s_input)
    a.sort()

print(len(a))

### FIXED CODE ###

n=int(raw_input())
li={}
while n !=0:
    a = raw_input()
    if a in li:
        del li[a]
    else:
        li[a]=a
    n-=1
print(len(li))
from collections import Counter
import numpy as np

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

count = Counter(a)
# 1; Counter 同士を比較
# 2; 2step loopで2個であることを確認する。

# > linspace で2個ずつ２ステップのリストを比較して、リストが同じであるかIFチェックする。

# 偶数
if (n % 2 == 0):
    check = [0] * n
    for i in range(1, n, 2):
        check[i - 1] = i
        check[i] = i

    checkC = Counter(check)

    if (checkC == count):
        ans = 2 ** (n / 2)
    else:
        ans = 0
# n = 1
elif (n == 1):
    if (a[0] == 0):
        ans = 1
    else:
        ans = 0


# 奇数
else:
    check = [0] * n
    for i in range(2, n, 2):
        check[i - 1] = i
        check[i] = i

    checkC = Counter(check)
    if (checkC == count):
        ans = 2 ** ((n - 1) / 2)
    else:
        ans = 0

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


### FIXED CODE ###

from collections import Counter
import numpy as np

MOD = 10 ** 9 + 7

n = int(input())
a = list(map(int, input().split()))
count = Counter(a)
# 0の個数は、count[0]
num = len(a)
ans = 1


if (num % 2 == 0):
    # 偶数パターン
    temp = 1
    loop = int(num / 2)
    for i in range(loop):
        tar = count[temp]
        if (tar == 2):
            ans *= 2
            temp += 2
        else:
            print(0)
            exit()

else:

    tar0 = count[0]
    if (tar0 == 1):
        pass
    else:
        print(0)
        exit()

    temp = 2

    for i in range(num // 2):
        if (count[temp] == 2):
            ans *= 2
            temp += 2
        else:
            print(0)
            exit()

ans %= MOD
print(ans)
N,K,M = input().split()
N = int(N)
K = int(K)
M = int(M)
A = input().split()
A = [int(s) for s in A]
AN = M * N - sum(A)
if (AN <= K) and (AN >= 0):
	print (AN)
else:
	print ('-1')

### FIXED CODE ###

a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
C = input()
if (C != 'z') and (C in a):
	i = a.index(C)
	print (a[i+1])
from math import *
n,k=map(int,input().split())
e=0
for i in range(1,n+1):
  t=ceil(log2(k/i))
  e+=1*(m<1)or 2**-t
print(e/n)

### FIXED CODE ###

import math
e=0
n, k = map(int, input().split())
for i in range(1,n+1):
  m = math.ceil(math.log2(k/i))
  e += 1*(m<1) or 2**-m
print(e/n)
testtest

### FIXED CODE ###

S = input()

a = 1
b = 1
first = S[0]
second = ""
for i in range(3):
    if S[i+1] == first:
        a += 1
    elif second == "":
        second = S[i+1]
    elif second == S[i+1]:
        b+= 1

if a == 2 and b == 2:
    print("Yes")
else:
    print("No")
N, M = map(int, input().split())
edge = {}
starts = set(i for i in range(1, N+1))
for _ in range(M):
    x, y = map(int, input().split())
    if x not in edge:
        edge[x] = [y]
    else:
        edge[x].append(y)
    starts -= {y}

def rec(d, e, dp):
    dp[e] = max(dp[e], d)
    if e not in edge:
        return 0
    for f in edge[e]:
        rec(d+1, f, dp)
    return max(dp)

depth = []
for s in starts:
    depth.append(rec(0, s, [0]*(N+1)))
print(max(depth))


### FIXED CODE ###

from sys import setrecursionlimit; setrecursionlimit(10**9)
N, M = map(int, input().split())
edge = {i:[] for i in range(1, N+1)}
starts = set(i for i in range(1, N+1))
for _ in range(M):
    x, y = map(int, input().split())
    edge[x].append(y)
    starts -= {y}

memo = [-1] * (N+1)

def rec(e):
    if memo[e] != -1:
        return memo[e]
    ret = 0
    for f in edge[e]:
        ret = max(ret, rec(f) + 1)
    memo[e] = ret
    return ret

max_d = 0
for s in starts:
    max_d = max(max_d, rec(s))
print(max_d)
n=input()
k=n%500
n -= k*500
n //= 5
print(k*1000+n*5)

### FIXED CODE ###

n=int(input())
k=n//500
n -= k*500
n //= 5
print(k*1000+n*5)
# coding: utf-8
# Here your code !
a, b = map(int, input().split())
m = a * b
s = a * 2 + b * 2
print m, s

### FIXED CODE ###

# coding: utf-8
# Here your code !
a,b = input().split()
m = int(a) * 2 + int(b) * 2
s = int(a) * int(b)
print(s,m)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
edge = [[] for i in range(N + 1)]
for i in range(N - 1):
    a, b, c = [int(t) for t in input().split()]
    edge[a].append((b, c))
    edge[b].append((a, c))

Q, K = [int(t) for t in input().split()]

def dfs(s):
    '''深さ優先探索でKからの距離を計算'''
    global dist
    for t, c in edge[s]:
        if dist[t] == None:
            dist[t] = dist[s] + c
            dfs(t)

dist = [None] * (N + 1)  # Kからの距離
dist[K] = 0
dfs(K)

for i in range(Q):
    x, y = [int(t) for t in input().split()]
    print(dist[x] + dist[y])

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
edge = [[] for i in range(N + 1)]
for i in range(N - 1):
    a, b, c = [int(t) for t in input().split()]
    edge[a].append((b, c))
    edge[b].append((a, c))

Q, K = [int(t) for t in input().split()]

def dfs(s):
    '''Kからの距離を計算'''
    global dist
    work = [s]
    while len(work) > 0:
        s = work.pop()
        for t, c in edge[s]:
            if dist[t] == None:
                dist[t] = dist[s] + c
                work.append(t)

dist = [None] * (N + 1)  # Kからの距離
dist[K] = 0
dfs(K)

for i in range(Q):
    x, y = [int(t) for t in input().split()]
    print(dist[x] + dist[y])
n = input()
num = []
num = input().split(" ")
 
t = 0 
a=0 
while True: 
  num2=[] 
  for i in num: 
    if not (int(i)%2): 
    	a =1 
       break 
    num2.append(int(i)%2) 
  num = num2 
  t+=1 
  if a==1: 
     print(t) 
     break

### FIXED CODE ###

n = input()
num = []
num = input().split(" ")
 
t = 0 
a=0 
while True: 
  num2=[] 
  for i in num: 
    if not int(i)%2==0:
      a =1
      break
    num2.append(int(i)/2)
  num = num2
  if a==1: 
     print(t) 
     break
  t+=1
a, b, c = map(int,input().split())
ans = 0

if a == b == c and a%2 == 0:
    print(-1) #無限
    exit()

while x%2 == 0 and y%2 == 0 and z%2 == 0:
    ans += 1

    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    
    a = x
    b = y
    c = z

print(ans)


### FIXED CODE ###

a, b, c = map(int,input().split())
ans = 0

if a == b == c and a%2 == 0:
    print(-1) #無限
    exit()

while a%2 == 0 and b%2 == 0 and c%2 == 0:
    ans += 1

    x = b//2 + c//2
    y = a//2 + c//2
    z = a//2 + b//2
    
    a = x
    b = y
    c = z

print(ans)
N,K = map(int,input().split())
p = list(map(int,input().split()))
print(sum(sorted(p)[:K]))

### FIXED CODE ###

Alp = input()
if Alp.isupper() == True :
  print('A')
else:
  print('a')
K, X = map(int, input().split())
 for i in range(X - K + 1, X + K):
    if i < X + K - 1:
 print(i, end=' ')
 else:
 print(i)
 K, X = map(int, input()

### FIXED CODE ###

a, b = map(int, input().split())
print(max([a+b,a-b,a*b]))
n = int(input())
int x = 1
res = n
while x * x <= n:
  if n % x == 0:
    res = min(res, x + n // x)
print(res)

### FIXED CODE ###

n = int(input())
i = 1
res = n
while i * i <= n:
  if n % i == 0:
    res = min(res, i + n//i - 2)
  i += 1
print(res)
import bisect
from collections import deque
n = int(input())
a = [int(i) for i in input().split()]


a_sum = [0]
for i in range(n):
    a_sum.append((a_sum[-1]+a[i]))

val = deque()
cnt = deque()
for i in range(n+1):
    idx = bisect.bisect_left(val, a_sum[i])
    if len(val) > idx and val[idx] == a_sum[i]:
        cnt[idx] += 1
    else:
        val.insert(idx, a_sum[i])
        cnt.insert(idx,1)

ans = 0
for i in range(len(cnt)):
    ans += cnt[i]*(cnt[i]-1)//2

print(ans)

### FIXED CODE ###

from collections import Counter

n = int(input())
a = [int(i) for i in input().split()]

a_sum = [0]
for i in range(n):
    a_sum.append((a_sum[-1]+a[i]))

cnt = Counter(a_sum)

ans = 0
for v in cnt.values():
    ans += v*(v-1)//2

print(ans)
a=list(map(int, input().split()))
if a[0]+a[1]>=a[2]＊2 :
  if a[3]>=a[4]:
    print (a[2]＊a[4]+a[0]＊(a[3]-a[4]))
  else:
    print (a[2]＊a[3]+a[1]＊(a[4]-a[3]))
else:
  print (a[0]＊a[3]+a[1]＊a[4])


### FIXED CODE ###

a, b, c, x, y = map(int, input().split())
res = 0
if a+b > c*2:
    mi = min(x, y)
    res += c*2 * mi
    x -= mi
    y -= mi
res += x * min(a, c*2)
res += y * min(b, c*2)
print(res)
from sys import exit, stderr, stdin
input = stdin.readline
# setrecursionlimit(10**7)
from collections import deque
import heapq
def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return


def main():
    N = int(input())
    S = [int(a) for a in input().split()]
    S = sorted(S,key=lambda x:x)
    # debug(S,'S')
    live = [S[-1]]
    S.pop()
    # iはステップ
    for i in range(N):
        # 各スライムに生んでもらう
        livenext = live.copy()
        for l in live:
            borned = False
            for j in range(len(S)-1, -1, -1):
                if l > S[j]:
                    # debug((l,S[j]),'parent, child')
                    livenext.append(S[j])
                    S.remove(S[j])
                    borned = True
                    break
            if not borned:
                print("No")
                exit()
        live = livenext
    if len(S) == 0:
        print("Yes")
    else:
        print("No")



if __name__ == "__main__":
    main()


### FIXED CODE ###

from sys import exit, stderr, stdin
input = stdin.readline
from collections import defaultdict
from sys import stderr
def debug(var, name="hoge"):
    print(name +":" + str(type(var)) + " = " + repr(var), file=stderr)
    return
def main():
    N = int(input())
    S = [int(a) for a in input().split()]
    S = sorted(S)
    exist = [S.pop()]
    debug(S)
    debug(exist)
    for i in range(N):
        next_exist = []
        next_s = []
        for p in exist[::-1]:
            while S:
                x = S.pop()
                if x < p:
                    next_exist.append(x)
                    break
                else:
                    next_s.append(x)
        exist += next_exist
        exist.sort()
        S += next_s[::-1]

    if len(exist) == 2**N:
        print("Yes")
        exit()
    else:
        print("No")
        exit()

if __name__ == "__main__":
    main()