Harryxun/stf_run huggingface dataset:
x,n=map(int, input().split())
ans=x
judge=True
if(n!=0):
  p=list(map(int, input().split()))
else:
  ans=x
  judge=False

if(judge):
  check=True
  s_list=[]
  l_list=[]
  for i in range(n):
    for j in range(n):
      if(x-i==p[j]):
        check=False
    if(check):
      s_list.append(x-i)
    check=True
  for i in range(n):
    for j in range(n):
      if(x+i==p[j]):
        check=False
    if(check):
      l_list.append(x+i)
    check=True
  if(abs(x-min(l_list)) > abs(x-max(s_list))):
    ans = max(s_list)
  elif(abs(x-min(l_list))==abs(x-max(s_list))):
    ans=max(s_list)
  else:
    ans=min(l_list)

print(ans)

### FIXED CODE ###

x,n=map(int, input().split())
ans=x
judge=True
if(n!=0):
  p=list(map(int, input().split()))
else:
  ans=x
  judge=False
  
if(n==1):
  if(x==p[0]):
    ans = x-1
    judge=False

if(judge):
  check=True
  s_list=[]
  l_list=[]
  for i in range(n):
    for j in range(n):
      if(x-i==p[j]):
        check=False
    if(check):
      s_list.append(x-i)
    check=True

    for i in range(n):
      for j in range(n):
        if(x+i==p[j]):
          check=False
      if(check):
        l_list.append(x+i)
      check=True
    if(l_list == []):
      ans = max(s_list)
    if(s_list == []):
      ans = min(l_list)
    else:
      if(abs(x-min(l_list)) > abs(x-max(s_list))):
        ans = max(s_list)
      elif(abs(x-min(l_list))==abs(x-max(s_list))):
        ans=max(s_list)
      else:
        ans=min(l_list)  

print(ans)
def maxreturn(t,n,a):
    ma=[0]*3
    b=[0]*3
    if t==n-1:
        for i in range(3):
           ma[i]=a[n-1][i]
    else:
      b=list(maxreturn(t+1,n,a))
      for i in range(3):
        for j in range(3):
            if i!=j:
                ma[i]=max(ma[i],a[t][i]+b[j])
                
    return ma
n=int(input())
a=[[0]*3]*n
for i in range(n):
    a[i]=list(map(int,input().split()))
ma=maxreturn(0,n,a)
print(max(ma))

### FIXED CODE ###

n=int(input())
a=[[0]*3]*n
for i in range(n):
    a[i]=list(map(int,input().split()))
b=[0]*3
for i in range(n-2,-1,-1):
    for j in range(3):
        t=0
        for k in range(3):
            if j!=k:
                t=max(t,a[i][j]+a[i+1][k])
        a[i][j]=t
print(max(a[0]))
a, b = map(int, input().split())
if a-2b >= 0:
  print(a-2b)
else:
  print(0)

### FIXED CODE ###

a, b = map(int, input().split())
if a-2*b >= 0:
    print(a-2*b)
else:
    print(0)
N,M=map(int,input().split())
a=list(int(input()) for _ in range(M) )
ans=0
ansn1=0
ansn2=0
mod=1000000007
A=a[0]
for i in range(N):

    if i>=2 and  i+1 < A:
        ans=(ansn1+ansn2)%mod
        ansn2 = ansn1
        ansn1=ans
        continue

    elif i>=2 and  i+1 > A:
        ans=(ansn1+ansn2)%mod
        ansn2 = ansn1
        ansn1=ans
        if a.index(A)+1<=M-1:
            A=a[a.index(A)+1]
        else:
            A=mod
        continue

    elif i+1 == A:
        ans = 0
        ansn2 = ansn1
        ansn1 = ans
        if a.index(A) + 1 <= M - 1:
            A = a[a.index(A) + 1]
        else:
            A=mod
        continue


    if i==0:
        if i+1 not in a:
            ans=1
            ansn2 = 0
            ansn1=ans


    elif i==1:
        if i+1 not in a:
            ans=1+ansn1
            ansn2 = ansn1
            ansn1=ans
        else:
            ans=0
            ansn2=ansn1
            ansn1=ans


print(ans)


### FIXED CODE ###

N,M=map(int,input().split())
a=list(int(input())for _ in range(M))
L=[1 for i in range(N+1)]
dp=[0 for _ in range(N+1)]
#L[0]=0
dp[0]=1
mod=1000000007
for j in a:
    L[j]=0
for i in range(1,N+1):
    if i>=2:
        dp[i]=(dp[i-1]*L[i-1]+dp[i-2]*L[i-2])*L[i]

    elif i==1:
        dp[i]=1
    dp[i]%=mod

print(dp[N])
import sys
sys.setrecursionlimit(10**7)

def uf_find(x):
  if x == p[x]:
    return x
  else:
    p[x] = uf_find(p[x])
    return p[x]

def uf_unite(x,y):
  x = uf_find(x)
  y = uf_find(y)
  if x != y:
    if r[y]>r[x]:
      x,y = y,x
    if r[x]==r[y]:
      r[x]+= 1
    p[y] = x
    #print(r)


N, M = map(int, input().split())
p = list(range(N))
r = [0]*N

for i in range(M):
  A, B = [int(j)-1 for j in input().split()]
  uf_unite(A,B)
  print(p)
  
for i in range(N):
  p[i] = uf_find(i)

q = [0]*N
for i in range(N):
  q[i] = p.count(i)
  
print(max(q))


### FIXED CODE ###

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

par = list(range(N))
rank = [1]*N
size = [1]*N

def find(x):
  if par[x] == x:
    return x
  else:
    return find(par[x])
  
def unite(x,y):
  x = find(x)
  y = find(y)
  
  if x == y:
    return
  if rank[x]<rank[y]:
    par[x]=y
    size[y]+= size[x]
  else:
    par[y] = x
    size[x] += size[y]
    if rank[x]==rank[y]:
      rank[x]+=1
    
for i in range(M):
  a,b = [int(i)-1 for i in input().split()]
  unite(a,b)
  
print(max(size))
from sys import stdin
import bisect
        
N = int(stdin.readline().rstrip())
L = [int(x) for x in stdin.readline().rstrip().split()]
L.sort()
 
ans = 0
for a in range(len(L)-2):
    for b in range(a + 1, len(L)-1):
        c = bisect.bisect_left(L, L[a] + L[b])

        ans += c - 1 - b
print(ans)

### FIXED CODE ###

# import bisect
# import heapq
# from copy import deepcopy
# from collections import deque
# from collections import Counter
# from itertools import accumulate
# from itertools import permutations
# import numpy as np
import math
# mod = 10**9 + 7

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


print(a-2*b if a-2*b>=0 else 0)
n = int(input())
s = input()
after_fusion = []

current = ''
for i in range(n):
    if s[i] != current:
        after_fusion.append(s[i])
        current = s[i]

print(len(after_fusion)

### FIXED CODE ###

n = int(input())
s = input()
after_fusion = []

current = ''
for i in range(n):
    if s[i] != current:
        after_fusion.append(s[i])
        current = s[i]

print(len(after_fusion))
import math
def bi(x, y):
  if x < y or y < 0 or x < 0: return 0
  if y == 0: return 1
  return math.factorial(x) // math.factorial(y) // math.factorial(x - y)

n, b = list(map(int, input().split(' ')))
for i in range(1, k + 1):
  print(bi(k - 1, i - 1) * bi(n - k + 1, i) % (10**9 + 7))

### FIXED CODE ###

import math
def bi(x, y):
  if x < y or y < 0 or x < 0: return 0
  if y == 0: return 1
  return math.factorial(x) // math.factorial(y) // math.factorial(x - y)

n, k = list(map(int, input().split(' ')))
for i in range(1, k + 1):
  print(bi(k - 1, i - 1) * bi(n - k + 1, i) % (10**9 + 7))
N = int(input())
A = list(map(int, input().split()))

mina = min(A)
mini = A.index(mina)
maxa = max(A)
maxi = A.index(mixa)

if mina >= 0:
  print(N-1)
  for i in range(N-1):
    print("{} {}".format(i+1, i+2))
elif maxa < 0:
  print(N-1)
  for i in range(N-1):
    print("{} {}".format(N-i, N-i-1))
else:
  if -mina < maxa:
    print(2*N-1)
    for i in range(N):
      print("{} {}".format(maxi+1, i+1))
    for i in range(N-1):
      print("{} {}".format(i+1, i+2))
  else:
    print(2*N-1)
    for i in range(N):
      print("{} {}".format(mini+1, i+1))
    for i in range(N-1):
      print("{} {}".format(N-i, N-i-1))

### FIXED CODE ###

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

mina = min(A)
mini = A.index(mina)
maxa = max(A)
maxi = A.index(maxa)

if mina >= 0:
  print(N-1)
  for i in range(N-1):
    print("{} {}".format(i+1, i+2))
elif maxa < 0:
  print(N-1)
  for i in range(N-1):
    print("{} {}".format(N-i, N-i-1))
else:
  if -mina < maxa:
    print(2*N-1)
    for i in range(N):
      print("{} {}".format(maxi+1, i+1))
    for i in range(N-1):
      print("{} {}".format(i+1, i+2))
  else:
    print(2*N-1)
    for i in range(N):
      print("{} {}".format(mini+1, i+1))
    for i in range(N-1):
      print("{} {}".format(N-i, N-i-1))
N = int(input())
a = list(map(int,input().split()))
a.sort(reverse==True)
ans = 0
for i in range(N):
  if(a%2==0):
    ans += a[i]
  else:
    ans-=a[i]
    

### FIXED CODE ###

N = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = 0
for i in range(N):
  if(i%2==0):
    ans += a[i]
  else:
    ans-=a[i]
print(ans)
N, M = map(int, input().split())
sc = [list(map(int, input().split())) for i in range(M)]
sc.sort()
if N == 1:
  tmp = sc[0][1]
  for i in range(M):
    if tmp != sc[i][1]:
      print(-1)
      break
    print(tmp)
else:
  ans_lis = [0] * N
  tmp_s = sc[0][0]
  tmp_c = sc[0][1]
  for i in range(M):
    if sc[i][0] == 1 and sc[i][1] == 0:
      print(-1)
      break
    if tmp_s == sc[i][0]:
      if tmp_c != sc[i][1]:
        print(-1)
        break
    else:
      ans_lis[tmp_s -1] = tmp_c
      tmp_s = sc[i][0]
      tmp_c = sc[i][1]
      if ans_lis[0] == 0:
        ans_lis[0] = 1
      lis = map(str, ans_lis)
      mojiretsu = ''
      for x in lis:
        mojiretsu += x
      print(mojiretsu)
      
      

### FIXED CODE ###

N, M = map(int, input().split())
if M == 0:
  if N == 1:
    print(0)
  elif N==2:
    print(10)
  else:
    print(100)
else:
  sc = [list(map(int, input().split())) for i in range(M)]
  sc.sort()
  pin = 0
  if N == 1:
    tmp = sc[0][1]
    for i in range(M):
      if tmp != sc[i][1]:
        print(-1)
        pin = 1
        break
    if pin == 0:
      print(tmp)
  else:
    pin = 0
    ans_lis = [0] * N
    tmp_s = sc[0][0]
    tmp_c = sc[0][1]
    for i in range(M):
      if sc[i][0] == 1 and sc[i][1] == 0:
        print(-1)
        pin = 1
        break
      if tmp_s == sc[i][0]:
        if tmp_c != sc[i][1]:
          print(-1)
          pin = 1
          break
      else:
        ans_lis[tmp_s -1] = tmp_c
        tmp_s = sc[i][0]
        tmp_c = sc[i][1]
    if pin == 0:
      ans_lis[tmp_s -1] = tmp_c
      if ans_lis[0] == 0:
        ans_lis[0] = 1
      lis = map(str, ans_lis)
      mojiretsu = ''
      for x in lis:
         mojiretsu += x
      print(mojiretsu)
A, B = (int(i) for i in input().split())
1 <= B <= A <= 20

if B%A==0：
    ptint(A+B)
else:
    print(A-B)
  

### FIXED CODE ###

A, B = map(int, input().split())
 
if B % A == 0:
    print(A + B)
else:
    print(B - A)
import math
from bisect import bisect_right
N, D, A = map(int, input().split())  # N体のモンスター, 爆弾の範囲D, 爆弾の威力A
XH = []
X = []
for _ in range(N):
    x, h = map(int, input().split())
    XH.append(x, math.ceil(x/A))  # 座標と必要な爆弾の個数を格納する
    X.append(x)  # こっちは座標のみ, あとで座標を二分探索するときに使う
# 座標でソートする
XH.sort()
X.sort()
T = [0]*(N+1)
j = 0
now = 0
ans = 0
for i in range(N):
    x, h = XH[i]
    now -= T[i]
    if now >= h:
        continue
    else:
        T[bisect_right(X, x+D*2)] += h - now
        ans += h - now
        now = h
print(ans)

### FIXED CODE ###

import math
from bisect import bisect_right
N, D, A = map(int, input().split())  # N体のモンスター, 爆弾の範囲D, 爆弾の威力A
XH = []
X = []
for _ in range(N):
    x, h = map(int, input().split())
    XH.append((x, math.ceil(h/A)))  # 座標と必要な爆弾の個数を格納する
    X.append(x)  # こっちは座標のみ, あとで座標を二分探索するときに使う
# 座標でソートする
XH.sort()
X.sort()
T = [0]*(N+1)
now = 0
ans = 0
for i in range(N):
    x, h = XH[i]
    now -= T[i]
    if now >= h:
        continue
    else:
        T[bisect_right(X, x+D*2)] += h - now
        ans += h - now
        now = h
print(ans)
if __name__ == '__main__':
    from collections import Counter
    from scipy.special import comb

    N,A,B = [int(i) for i in input().split()]
    V = [int(i) for i in input().split()]

    V.sort(reverse = True)
    max_list = V[0:A]
    max = sum(V[0:A]) / A

    for i in range(A+1,B+1):
        a = sum(V[0:i]) / i
        if max < a:
            max_list = V[0:i]
            max = a
    print("{:.6f}".format(max))

    ans = 1
    max_list = Counter(max_list).most_common()
    for i in range(len(max_list)):
        ans *= comb(V.count(max_list[i][0]),max_list[i][1])
    print(int(ans))


### FIXED CODE ###

def comb(n, k):
    return factorial(n) // (factorial(k) * factorial(n-k))
  
if __name__ == '__main__':
    from collections import Counter
    from math import factorial

    N,A,B = [int(i) for i in input().split()]
    V = [int(i) for i in input().split()]

    V.sort(reverse = True)
    max_list = [V[0:A]]
    max = sum(V[0:A]) / A

    for i in range(A+1,B+1):
        a = sum(V[0:i]) / i
        if max <= a:
            max_list.append(V[0:i])
            max = a
    print("{:.6f}".format(max))

    ans = 0
    for x in max_list:
        ans_sub = 1
        try:
            x = Counter(x).most_common()
        except TypeError:
            ans += ans_sub
            continue
        for i in range(len(x)):
            ans_sub *= comb(V.count(x[i][0]),x[i][1])
        ans += ans_sub
    print(int(ans))
a, p = map(int, input().split())

pis = (3a + p)//2
print(pis)

### FIXED CODE ###

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

pies = (3*a + p) // 2
print(pies)
a = list(map(int, input().split()))

if len(set(a)) = 2:
  print('Yes')
else:
  print('No')
  


### FIXED CODE ###

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

if len(set(a)) == 2:
  print('Yes')
else:
  print('No')
N=int(input())
i=int(input())
print(N-i+1)


### FIXED CODE ###

N,i=map(int, input().split())
print(N-i+1)
a, b = input().split()
if a == b == "H":
  print("H")
elif a == D and b == "H":
  print("D")
elif a == H and b == "D":
  print("H")
else:
  print("H")

### FIXED CODE ###

a, b = input().split()
print("H" if a==b else "D")
from math import sqrt

i = input().split()
a = int(i[0] * 1000000000000000000000000)
b = int(i[1]* 1000000000000000000000000)
c = int(i[2]* 1000000000000000000000000)

if sqrt(a) + sqrt(b) < sqrt(c):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

k = int(input()) -1

print(a[k])
N = int(input())
x = int(n**.5)
while n%x:
  x-=1

print(len(str(n//x)))

### FIXED CODE ###

N = int(input())
a = len(str(N))

for i in range(1,int(N**(1/2))+1):
  if N%i==0:
    a=len(str(N//i))

print(a)
for i in range(n):
    sum_n = A[i]
    for j in range(q):
        if M[j] == sum_n:
            result[j] = 'yes'
    for j in range(n-1-i):
        sum_n = A[i]
        ad = A[i+j+1]
        sum_n = sum_n + ad
        for k in range(q):
            if M[k] == sum_n:
                result[k] = 'yes'
        for k in range(n-2-i-j):
            ad = ad + A[i+j+2+k]
            sum_n = sum_n + ad
            for l in range(q):
                if M[l] == sum_n:
                    result[l] = 'yes'

### FIXED CODE ###


n = int(raw_input())
A = map(int, raw_input().split())

q = int(raw_input())
M = map(int, raw_input().split())

result = []
for i in range(q):
    result.append('no')

def adder(axis = 0, nums = [0], M = [0], q = 0):
    for i in range(q):
        if M[i] == axis:
            result[i] = 'yes'
    length = len(nums)
    if length != 0:
        for i in range(length):
            sum_n = axis + nums[i]
            adder(sum_n, nums[i+1:], M, q)

for i in range(n):
    adder(A[i], A[i+1:], M, q)

for i in result:
    print(i)
from Decimal import *
n1, n2 = map(Decimal, input().split())
print(int(n1*n2))

### FIXED CODE ###

from decimal import Decimal
n1, n2 = map(Decimal, input().split())
print(int(n1*n2))
N = int(input())
A = list(map(int, input().split()))

BB = A[:]

BB_P = []
BB_M = []


for b in BB:
    if b < 0:
        BB_M.append(b)
    else:
        BB_P.append(b)

        
ope = []
if not BB_M:
    BB_P = sorted(BB_P)
    p = BB_P[-1]
    m = BB_P[0]
    for b in BB_P[1:-1]:
        ope.append((m,b))
        m = m-b
    ope.append((p,m))
    ans = p - m
elif not BB_P:
    BB_M = sorted(BB_M)
    p = BB_M[-1]
    for b in BB_M[:-1]:
        ope.append((p, b))
        p = p-b
    ans = p
else:
    p = BB_P.pop()
    m = BB_M.pop()
    for b in BB_P:
        ope.append((m ,b))
        m = m-b
    for b in BB_M:
        ope.append((p ,b))
        p = p-b
    ope((p,m))
    ans = p-m
    
print(ans)
for x,y in ope:
    print(x, y)


### FIXED CODE ###

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

BB = A[:]

BB_P = []
BB_M = []


for b in BB:
    if b < 0:
        BB_M.append(b)
    else:
        BB_P.append(b)

        
ope = []
if not BB_M:
    BB_P = sorted(BB_P)
    p = BB_P[-1]
    m = BB_P[0]
    for b in BB_P[1:-1]:
        ope.append((m,b))
        m = m-b
    ope.append((p,m))
    ans = p - m
elif not BB_P:
    BB_M = sorted(BB_M)
    p = BB_M[-1]
    for b in BB_M[:-1]:
        ope.append((p, b))
        p = p-b
    ans = p
else:
    p = BB_P.pop()
    m = BB_M.pop()
    for b in BB_P:
        ope.append((m ,b))
        m = m-b
    for b in BB_M:
        ope.append((p ,b))
        p = p-b
    ope.append((p,m))
    ans = p-m
    
print(ans)
for x,y in ope:
    print(x, y)
import numpy as np
N = int(input())
num = np.array(list(map(int,input().split())))

a = np.prod(num)
if a> 10**18:
  a=-1
print(a)

### FIXED CODE ###

A, B = map(int, input().split())
print(A*B)
#階数Nの階段の上り方の総数を求める関数
N , M= map(int, input().split())
A = [int(input()) for i in range(M)]
d = [0]*N
d = [0]*N
d[0] = 1
d[1] = 1
A = [-1] + A + [N+1]
def func(N):
    if d[N] > 0:
        return d[N]
    d[N] = func(N-1) + func(N-2)
    return d[N]
B = [A[i+1]-A[i]-2 for i in range(M+1)]
ans = 1
for i in range(M+1):
    ans = ans * func(B[i])
ans = ans%1000000007
print(ans)

### FIXED CODE ###

import sys
 
n,m=map(int,input().split())
a=[int(input()) for i in range(m)]+[0] #jがはみ出ないように最後に付け足しておく
MOD=7+10**9 #%MODを忘れない
 
dp=[1]+[0]*n
 
j=0
#iにのぼることができるかを考える
for i in range(1,n+1):
  if i==a[j]:
    j+=1
  elif i>1:
    dp[i] = (dp[i-1] + dp[i-2])%MOD #-1,-2からの遷移を考える
  else:
    if i!=a[0]:
      dp[i] = dp[i-1]

print((dp[-1])%MOD)
N, K=(int(i) for i in input().split())
A=[int(i) for i in input().split()]

import numpy as np
from scipy.ndimage.interpolation import shift

res=[0]*(N+1)
res[1] = A[0]
for i in range(0,len(A)):
    res[i+1] = (res[i] + A[i])%K

array=np.array(res)
ans=0

for i in range(1,N):
    ans+=((array-shift(array,i,cval=0))%K==i).sum()
print(ans)


### FIXED CODE ###

S=input()
if (S=="SUN"):
    print(7)
elif (S=="MON"):
    print(6)
elif (S=="TUE"):
    print(5)
elif (S=="WED"):
    print(4)
elif (S=="THU"):
    print(3)
elif (S=="FRI"):
    print(2)
elif (S=="SAT"):
    print(1)
S = input()
T = input()
if (S in T) and (S[0] == T[0])
  if ((len(S) > 1) and (S[1] == T[1])) or (len(S) = 1):
    print('Yes')
else:
  print('No')
  


### FIXED CODE ###

S = input()
T = input()
if (S in T) and (S[0] == T[0]):
  if ((len(S) > 1) and (S[1] == T[1])) or (len(S) == 1):
    print('Yes')
else:
  print('No')
import sys
h,w = ri()
C = [input() for _ in range(h)]

dd = [(0,1),(0,-1),(1,0),(-1,0)]
for i in range(h):
    for j in range(w):
        if C[i][j] == '#':
            b = []
            for di,dj in dd:
                if 0<=i+di<h and 0<=j+dj<w:
                    b.append(C[i+di][j+dj] == '.')
            if all(b):
                print('No')
                sys.exit()
print('Yes')

### FIXED CODE ###

import sys

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

dd = [(0,1),(0,-1),(1,0),(-1,0)]
for i in range(h):
    for j in range(w):
        if C[i][j] == '#':
            b = []
            for di,dj in dd:
                if 0<=i+di<h and 0<=j+dj<w:
                    b.append(C[i+di][j+dj] == '.')
            if all(b):
                print('No')
                sys.exit()
print('Yes')
N, M = (int(x) for x in input().split())
import collections
Parent = [i for i in range(N)]
for _ in range(M):
    a, b = (int(x) for x in input().split())
    Parent[max(a,b)-1] = min(a,b)-1

def fp(i):
    global Parent
    if Parent[i] == i:
        return i
    else:
        Parent[i] == fp(Parent[i])
        return Parent[i]


Groupsize = collections.defaultdict(lambda:0)
for i in range(N):
    i = fp(i)
    Groupsize[i] +=1
ans = max(gs for gs in Groupsize.values())
print(ans)

### FIXED CODE ###

N, M = (int(x) for x in input().split())
import collections
Parent = [i for i in range(N)]
def fp(i):
    global Parent
    if Parent[i] == i:
        return i
    else:
        Parent[i] = fp(Parent[i])
        return Parent[i]

for _ in range(M):
    a, b = (int(x) for x in input().split())
    par_a, par_b = fp(a-1), fp(b-1)
    if par_a < par_b:
        Parent[par_b] = par_a
    else:
        Parent[par_a] = par_b

Groupsize = collections.defaultdict(lambda:0)
for i in range(N):
    i = fp(i)
    Groupsize[i] +=1
ans = max(gs for gs in Groupsize.values())
print(ans)
k, x = map(int, input().split())

start = x - k + 1
last = x + k - 1

result = []
result.append(start)

for i in range(1, last - start + 1):
    result.append(start + i)
for i in result:
    if i == start:
	output = str(i)
    else:
        output = output + " " + str(i)

print(output + "\n")

### FIXED CODE ###

k, x = map(int, input().split())

start = x - k + 1
last = x + k - 1

result = []
result.append(start)

for i in range(1, last - start + 1):
    result.append(start + i)
for i in result:
    if i == start:
	    output = str(i)
    else:
        output = output + " " + str(i)

print(output)
import itertools
import math
import sys
import heapq
from collections import Counter
from collections import deque
from fractions import gcd
from functools import reduce
INF = 1 << 60
sys.setrecursionlimit(10 ** 6)

#ここから書き始める
def gcd(*numbers):
    return reduce(math.gcd, numbers)


n, start = map(int, input().split())
a = list(map(int, input().split()))
gap = []
a.append(start)
a.sort()
for i in range(1, n + 1):
    gap.append(abs(a[i] - a[i - 1]))
# print(gap)
print(gcd(*gap))

### FIXED CODE ###

import itertools
import math
import sys
from collections import Counter
from fractions import gcd
from functools import reduce

n, start = map(int, input().split())
x = list(map(int, input().split()))
x.append(start)
x.sort()
# print(x)
gaps = []
for i in range(n):
    gaps.append(x[i + 1] - x[i])
# print(gaps)
if len(gaps) == 1:
    print(gaps[0])
else:
    ans = reduce(gcd, gaps)
    print(ans)
import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
n, a, b = [int(x) for x in input().strip().split()]
mod = 10 ** 9 + 7
ans = pow(2, n, mod) - 1

fact = [1] * (n + 1)
for i in range(1, n+1):
    fact[i] = (fact[i-1] * i) % mod

inv = [1] * (n + 1)
inv[-1] = pow(fact[-1], mod-2, mod)
for i in range(1, n+1):
    inv[-1-i] = (inv[-1-i+1] * (n-(i-1))) % mod

ans = (ans - (fact[n] * inv[n-a] * inv[a]) % mod) % mod
ans = (ans - (fact[n] * inv[n-b] * inv[b]) % mod) % mod
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
n, a, b = [int(x) for x in input().strip().split()]
mod = 10 ** 9 + 7
ans = pow(2, n, mod) - 1

fact = [1] * (b + 1)
for i in range(1, b+1):
    fact[i] = (fact[i-1] * i) % mod

inv = [1] * (b + 1)
inv[-1] = pow(fact[-1], mod-2, mod)
for i in range(1, b):
    inv[-1-i] = (inv[-1-i+1] * (b-(i-1))) % mod

def nCr(n, r):
    ret = 1
    for i in range(r):
        ret = (ret * (n - i) % mod) % mod
    return (ret * inv[r]) % mod

ans = (ans - nCr(n, a)) % mod
ans = (ans - nCr(n, b)) % mod
print(ans)
import math
def main():
	s = str(input())
	l = s.split()
	x = int(l[0])
	k = int(l[1])
	d = int(l[2])
	value = x - k * d
	ans = x + k * d
	be = 0
	en = k
	while (be <= en):
	    mid = (be + en) // 2
	    diff = 2 * mid * d
	    if ((value + diff) >= 0):
	        ans = value + diff
	        en = mid - 1
	    else:
	        be = mid + 1

	ans2 = value
	be = 0
	en = k
	while (be <= en):
		mid = (be + en) / 2
		diff = 2 * mid * d
		if ((value + diff) < 0):
		    ans2 = value + diff
		    be = mid + 1
		else:
		    en = mid - 1
	print(int(min(abs(ans), abs(ans2))))	



if __name__ == '__main__':
	main()



### FIXED CODE ###

import math
def main():
	s = raw_input()
	l = s.split()
	x = int(l[0])
	k = int(l[1])
	d = int(l[2])
	value = x - k * d
	ans = x + k * d
	be = 0
	en = k
	while (be <= en):
	    mid = (be + en) // 2
	    diff = 2 * mid * d
	    if ((value + diff) >= 0):
	        ans = value + diff
	        en = mid - 1
	    else:
	        be = mid + 1

	ans2 = value
	be = 0
	en = k
	while (be <= en):
		mid = (be + en) / 2
		diff = 2 * mid * d
		if ((value + diff) < 0):
		    ans2 = value + diff
		    be = mid + 1
		else:
		    en = mid - 1
	print(int(min(abs(ans), abs(ans2))))	



if __name__ == '__main__':
	main()