Harryxun/stf_run huggingface dataset:
import numpy as np

n, k = map(int, input().split())
p = np.array(list(map(int, input().split())))

q = np.zeros_like(p, dtype='float')
for i in range(n):
    q[i] += (1+p[i]) / 2.0

ans = 0
for i in range(n):
    ans = max(ans, sum(q[i:i+k]))
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
p = [(1+int(x)) / 2.0 for x in input().split()]

ans = sum(p[0:k])
tmp = sum(p[0:k])

for i in range(0, n-k):
    tmp = tmp - p[i] + p[i+k]
    ans = max(ans, tmp)

print(ans)
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
H = LIST()

if H[0] > H[1]:
  if H[0] - H[1] == 1:
    H[0] -= 1
  else:
    print("No")
    exit()

for i in range(2, N):
  if H[i] < H[i-1]:
    if H[i-1] - H[i] == 1:
      H[i-1] -= 1
      if H[i-1] < H[i-2]:
        print("No")
        exit()

    else:
      print("No")
      exit()


print("Yes")

### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N = INT()
H = LIST()

if N == 1:
  print("Yes")
  exit()

for i in range(N-1, 0, -1):
  if H[i-1] > H[i]:
    if H[i-1] - H[i] == 1:
      H[i-1] -= 1
    else:
      print("No")
      exit()

print("Yes")
N, K = map(int, input().split())
S = input()

one = []
cnt = 0
for i, s in enumerate(S):
    if s == '1':
        cnt += 1
        if i == N - 1:
            one.append(cnt)
    elif s == '0':
        if cnt > 0:
            one.append(cnt)
            cnt = 0
            
zero = []
cnt = 0
for i, s in enumerate(S):
    if s == '0':
        cnt += 1
        if i == N - 1:
            zero.append(cnt)
    elif s == '1':
        if cnt > 0:
            zero.append(cnt)
            cnt = 0
            
if len(one) <= len(zero):
    one = [0] + one + [0]
    
for i in range(len(one) - 1):
    one[i + 1] = one[i] + one[i + 1]
one = [0] + one
    
for i in range(len(zero) - 1):
    zero[i + 1] = zero[i] + zero[i + 1]
zero = [0] + zero
    
ans = -1
for i in range(len(one) - (K + 1) + 1):
    tmp = one[i + K] - one[i - 1] + zero[i + K - 1] - zero[i - 1]
    ans = max(ans, tmp)
    # print(tmp)
    
if len(zero) - 1 <= K:
    print(len(S))
else:
    print(ans)

### FIXED CODE ###

N,K = map(int,input().split())
S = input()
 
zeros = []
ones = [0]
# Sが0始まりの時は、それを挟むための1が必要なので、予め入れておく
# 1始まりの時は、これに+= 1するので問題なし
 
prev = '1'
for c in S:
    if c == '1':
        if prev == '0':
            ones.append(1)
        else:
            ones[-1] += 1
    else: #c == '0'
        if prev == '1':
            zeros.append(1)
        else:
            zeros[-1] += 1
    prev = c
ones.append(0)
# Sが0終わりの時は、それを挟むための1が必要なので、最後に付け加えておく
# 1終わりの時は不要だが、maxをとるので0を入れておいても影響はない

tmp = sum(zeros[0:K]) + sum(ones[0:K+1])
#　初期値として、最初の区間の和を計算しておけば、
# あとは先頭と最後尾を+-するだけで累積和を求められる
ans = tmp
for i in range(0,len(zeros)-K):
    tmp += zeros[i+K] - zeros[i] + ones[i+K+1] - ones[i]
    ans = max(tmp,ans)

print(ans)
x,y = input().split()
a,b = ord(x), ord(y)
 
if a < b:
    print('<')
elif a > b:
    print('>')
else if a == b:
    print('=')

### FIXED CODE ###

a,b=input().split()
x,y=ord(a),ord(b)

if x > y:
    print(">")
elif x==y:
  print("=")
else:
  print("<")
def getN():
    return int(input())

def getMN():
    a = input().split()
    b = [int(i) for i in a]
    return b[0],b[1]

def getlist():
    a = input().split()
    b = [int(i) for i in a]
    return b
from collections import deque

n, m = getMN()
class vertex():
    def __init__(self):
        self.number = 0
        self.dst = 0

parents = [[] for i in range(n+1)]
childs = [[] for i in range(n+1)]
for i in range(m+n-1):
    m,n = getMN()
    parents[n].append(m)
    childs[m].append(n)
vtxs = [vertex() for i in range(n+2)]
dst = [0 for i in range(n+2)]
d = deque()
for i ,x in enumerate(parents[1:]):
    if not x:
        n_root = i+1
        break

def bfs(n_cur):
    #print(([v.dst for v in vtxs]))
    #c is pure integer
    #print("n_cur = {}".format(n_cur))
    for c in childs[n_cur]:
        d.append(c)
        #print("c = {}".format(c))
        dst[c] = max(dst[c], dst[n_cur]+1)
    print("d = {}".format(d))
    while(d):
        bfs(d.popleft())

bfs(n_root)


print(parents, dst)
for plist in parents[1:]:
    if plist:
        cur = -1
        for p in plist:
            if dst[p] > cur:
                cur = dst[p]
                ans = p
        print(ans)
    else:
        print(0)


### FIXED CODE ###

def getN():
    return int(input())


def getNM():
    return map(int, input().split())


def getList():
    return list(map(int, input().split()))

n,m = getNM()
children = [[] for i in range(n+2)]
n_in = [0] * (n+1)
par_origin = [0] * (n+1)

#入力の処理
for i in range(n+m-1):
    a,b = getNM()
    children[a].append(b)
    n_in[b] += 1

#根を見つける
for i in range(1,n+m-1):
    if n_in[i]:
        pass
    else:
        root = i
        break

#次数を減らしながら探索
import queue
def bfs(root):
    q = queue.Queue()
    q.put(root)
    while(True):
        try:
            cur = q.get(block=False)
        except:
            break
        for c in children[cur]:
            if n_in[c] == 1:
                par_origin[c] = cur
                q.put(c)
            else:
                n_in[c] -= 1

bfs(root)
for i in range(1, n+1):
    print(par_origin[i])
N, M = map(int, input().split())
H = list(map(int, input().split()))
l = [list(map(int, input().split())) for _ in range(M)]
 
ans = 0
for i in range(1, N+1):
  # ノードi(=1,...,N)と結合しているノードを全て求め、connectに格納
  connect = []
  for j in range(M):
    if i in l[j]:
      if i == l[j][0]: connect.append(l[j][1])
      else: connect.append(l[j][0])
  
  # ノードiの標高が、結合している任意のノードの標高より高いなら ans += 1
  n = 0
  for c in connect:
    if H[i-1] > H[c-1]: n += 1
  if n == len(connect): ans += 1

print(ans)

### FIXED CODE ###

S = input()
if S == 'ABC': print('ARC')
elif S == 'ARC': print('ABC')
def dfs(now, prev):
    ans[now]+=(h[now]+ans[prev])
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
        if next != prev:
            if memo[next]==True:
                # 過去に訪れていれば閉路
                return False
            else:
                memo[next] = True
                dfs(next, now)


n, q = map(int, input().split())
g = [[] * n for i in range(n)]
for i in range(n-1):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)

h=[0]*n
for i in range(q):
    u, v = map(int, input().split())
    u -= 1
    h[u]+=v

ans=[0]*n
memo = [False for i in range(n)]
dfs(0,0)

print(' '.join(map(str, ans)))

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def dfs(now, prev):
    ans[now]+=(h[now]+ans[prev])
    # 今いる頂点から行ける頂点を順に next に入れてループ
    for next in g[now]:
        if next != prev:
            if memo[next]==True:
                # 過去に訪れていれば終わらせる
                return False
            else:
                memo[next] = True
                dfs(next, now)
 
#木構造の取り込み 
n, q = map(int, input().split())
g = [[] * n for i in range(n)]
for i in range(n-1):
    u, v = map(int, input().split())
    u -= 1
    v -= 1
    g[u].append(v)
    g[v].append(u)
 
#操作の取り込み
h=[0]*n
for i in range(q):
    u, v = map(int, input().split())
    u -= 1
    h[u]+=v
 
#初期のカウンター
ans=[0]*n
memo = [False for i in range(n)]
 
#DFSでカウンターを動かす
dfs(0,0)
 
print(' '.join(map(str, ans)))
import math
a,b=map(int,input().split())
s=int(str(a)+str(b))
if s%(math.sqrt(s))==0
  print("Yes")
else:
  print("No")


### FIXED CODE ###

import math
a,b=map(int,input().split())
s=int(str(a)+str(b))
if s%(math.sqrt(s))==0:
  print("Yes")
else:
  print("No")
a, b = map(int, raw_input().split())
if ((a*b)%2) == 0:
  print('Even')
elif:
  print('Odd')

### FIXED CODE ###

a, b = map(int, input().split())
if ((a*b)%2) == 0:
  print('Even')
else:
  print('Odd')
a,b=map(int,input().split())

if ab %= 0:
    print('Even')

else:
    print('Odd')


### FIXED CODE ###

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

if (a*b%2==0):
    print('Even')

else:
    print('Odd')
import math
L=int(input())-1
  
if L==0:
  print(2,2)
  print(1,2,0)
  print(1,2,1)
  exit()
LLL=2**(L2-1)
L2=int(math.log2(L))
lll=LLL*2-1

branch_list=[]
for x in range(1,L2+1):
  branch_list.append([x,x+1,0])
  branch_list.append([x,x+1,LLL])
  LLL//=2


lll+=1
while True:
  ls=L-lll
  if ls<=0:
    branch_list.append([1,L2+1,lll])
    break
  else:
    ls2=int(math.log2(ls))
    branch_list.append([1,L2+1-ls2,lll])
    lll+=2**ls2

print (L2+1,len(branch_list))
for x,y,z in branch_list:
  print (x,y,z)


### FIXED CODE ###

import math
L=int(input())-1
  
if L==0:
  print(2,2)
  print(1,2,0)
  exit()
elif L==1:
  print(2,2)
  print(1,2,0)
  print(1,2,1)
  exit()

L2=int(math.log2(L))
LLL=2**(L2-1)
lll=LLL*2-1

branch_list=[]
for x in range(1,L2+1):
  branch_list.append([x,x+1,0])
  branch_list.append([x,x+1,LLL])
  LLL//=2


lll+=1
while True:
  ls=L-lll
  if ls<=0:
    branch_list.append([1,L2+1,lll])
    break
  else:
    ls2=int(math.log2(ls))
    branch_list.append([1,L2+1-ls2,lll])
    lll+=2**ls2

print (L2+1,len(branch_list))
for x,y,z in branch_list:
  print (x,y,z)
input()
s = input()

x = 0

for i in range(len(s)):
  a = s[0:i]
  b = s[i:]
  
  x = max(x, len(set(a) & set(b)))

print(x)


### FIXED CODE ###

a, b = map(int, input().split())
calcs = [a + b, a - b, a * b]
print(max(calcs))
L, R = map(int,input().split())
l = str(L)
r = str(R)
last_l = ""
last_r = ""
for i in range(L):
    last_r += r 
for i in range(R):
    last_l += l     
if L > R:
    print(last_r)
else:
    print(last_l

### FIXED CODE ###

L, R = map(int,input().split())
l = str(L)
r = str(R)
last_l = ""
last_r = ""
for i in range(L):
    last_r += r 
for i in range(R):
    last_l += l     
if L > R:
    print(last_r)
else:
    print(last_l)
vA, B, C = map(int, input().split())

if A == B and B != C:
    print("Yes")
elif B == C and A != B:
    print("Yes")
elif A == C and A != B:
    print("Yes")
else:
    pirnt("No")

### FIXED CODE ###

A, B, C = map(int, input().split())

if A == B and B != C:
    print("Yes")
elif B == C and A != B:
    print("Yes")
elif A == C and A != B:
    print("Yes")
else:
    print("No")
x = map(int, input().split())
max1 = 1
for s in range(100):
  for t in range(100):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)



### FIXED CODE ###

x = int(input())
max1 = 1
for s in range(x):
  for t in range(2,10):
    if pow(s,t) > max1 and pow(s,t) <= x:
      max1 = pow(s,t)
print(max1)
def dfs(i, sum):
    # n 個決め終わったら、今までの和 sum が k と等しいかを返す
    if i == n  - 1:
#         print(sum)
        if eval(sum) == k:
            print(sum+"=7")
        return eval(sum) == k
    # + を使う
    if dfs(i + 1, sum + "-" +  s[i+1]):
        return True
    
    # - を使う
    if dfs(i + 1, sum + "+" + s[i+1]):
        return True
#     print(sum)
    return False

def main():
    s = input()
    n = len(s)
    k = 7

    if dfs(0, s[0]):
        pass
    else:
        pass
if __name__ == '__main__':
    main()

### FIXED CODE ###

def dfs(i, sum, n, s, k):
    # n 個決め終わったら、今までの和 sum が k と等しいかを返す
    if i == n  - 1:
#         print(sum)
        if eval(sum) == k:
            print(sum+"=7")
        return eval(sum) == k
    # + を使う
    if dfs(i + 1, sum + "-" +  s[i+1],n,s,k):
        return True
    
    # - を使う
    if dfs(i + 1, sum + "+" + s[i+1],n,s,k):
        return True
#     print(sum)
    return False

def main():
    s = input()
    n = len(s)
    k = 7

    if dfs(0, s[0], n, s,k):
        pass
    else:
        pass
if __name__ == '__main__':
    main()
from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
lst = list(range(A,B+1))
for i in sorted(set(lst[:K]+lst[-K:])):
    print(i)

### FIXED CODE ###

from sys import stdin
A,B,K=[int(x) for x in stdin.readline().rstrip().split()]
ran = range(A,B+1)
for i in sorted(set(ran[:K])|set(ran[-K:])):
    print(i)
h,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(h)]
a=[]
for i in range(h):
    if i%2==0:
        for j in range(w-1):
            if l[i][j]%2==1:
                a.append([i+1,j+1,i+1,j+2])
                l[i][j+1]+=1
        j=w-1
        if l[i][j]%2==1:
            a.append([i+1,j+1,i+2,j+1])
            l[i+1][j]+=1
    else:
        for j in range(w-1,0,-1):
            if l[i][j]%2==1:
                a.append([i+1,j+1,i+1,j])
                l[i][j-1]+=1
        j=0
        if l[i][j]%2==1:
            a.append([i+1,1,i+2,1])
            l[i+1][j]+=1
print(len(a))
for i in a:print(' '.join(map(str,i)))

### FIXED CODE ###

h,w=map(int,input().split())
l=[list(map(int,input().split())) for i in range(h)]
a=[]
for i in range(h):
    if i%2==0:
        for j in range(w-1):
            if l[i][j]%2==1:
                a.append([i+1,j+1,i+1,j+2])
                l[i][j+1]+=1
        j=w-1
        if l[i][j]%2==1 and i!=h-1:
            a.append([i+1,j+1,i+2,j+1])
            l[i+1][j]+=1
    else:
        for j in range(w-1,0,-1):
            if l[i][j]%2==1:
                a.append([i+1,j+1,i+1,j])
                l[i][j-1]+=1
        j=0
        if l[i][j]%2==1 and i!=h-1:
            a.append([i+1,1,i+2,1])
            l[i+1][j]+=1

print(len(a))
for i in a:print(' '.join(map(str,i)))
#!/usr/bin/env python3
N, M, K = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
B = [int(s) for s in input().split()]
i = 0
j = M-1

B_SUM = [0] * M
B_SUM[0] = B[0]

max_book = 0

for i in range(1, M):
    B_SUM[i] = B[i] + B_SUM[i - 1]
    if B_SUM[i] <= K:
        max_book = i + 1

A_SUM = 0

b_index = M - 1

for i in range(N):
    A_SUM += A[i]
    while (b_index >= 0):
        B_SUM[b_index]
        if A_SUM + B_SUM <= K:
            break
        b_index -= 1
    max_book = max(max_book, b_index + 1 + i + 1)

print(max_book)

### FIXED CODE ###

#!/usr/bin/env python3
N, M, K = [int(s) for s in input().split()]
A = [int(s) for s in input().split()]
B = [int(s) for s in input().split()]
i = 0
j = M-1

B_SUM = [0] * M
A_SUM = [0] * N
B_SUM[0] = B[0]
A_SUM[0] = A[0]
max_book = 0

if B_SUM[0] <= K:
    max_book = 1

for i in range(1, M):
    B_SUM[i] = B[i] + B_SUM[i - 1]
    if B_SUM[i] <= K:
        max_book = i + 1

A_SUM = 0
b_index = M - 1

for i in range(N):
    A_SUM += A[i]
    while (b_index >= 0):
        B_SUM[b_index]
        if A_SUM + B_SUM[b_index] <= K:
            max_book = max(max_book, b_index + 1 + i + 1)
            break
        b_index -= 1
    if (A_SUM <= K):
        max_book = max(max_book, i + 1)
print(max_book)
count_ac=0
count_wa=0
count_tle=0
count_re=0
data=input().split
for i in range(data[0]):
    if data[i+1] == "AC":
        count_ac += 1
    elif data[i+1] == "WA":
        count_wa += 1
    elif data[i+1] == "TLE":
        count_tle += 1
    else:
        count_re += 1
print("AC x "+str(count_wa))
print("WA x "+str(count_ac))
print("TLE x "+str(count_tle))
print("RE x "+str(count_re))

### FIXED CODE ###

count_ac=0
count_wa=0
count_tle=0
count_re=0
n=int(input())
for i in range(n):
    s=input()
    if s == "AC":
        count_ac += 1
    elif s == "WA":
        count_wa += 1
    elif s == "TLE":
        count_tle += 1
    else:
        count_re += 1
print("AC x "+str(count_ac))
print("WA x "+str(count_wa))
print("TLE x "+str(count_tle))
print("RE x "+str(count_re))
N = int(input())
Alist = list(map(int, input().split()))
Blist = list(map(int, input().split()))
Clist = list(map(int, input().split()))

manzokudo = 0
for B in Blist:
    manzokudo += B
    
for i in range(len(Alist) - 1):
    if Alist[i]+1 == Alist[i+1]:
        manzokudo += Clist[i+1]

print(manzokudo)

### FIXED CODE ###

N = int(input())
Alist = list(map(int, input().split()))
Blist = list(map(int, input().split()))
Clist = list(map(int, input().split()))

manzokudo = 0
for B in Blist:
    manzokudo += B
    
for i in range(0, N-1):
    if Alist[i]+1 == Alist[i+1]:
        manzokudo += Clist[Alist[i]-1]

print(manzokudo)
N=int(input())
X=int(input())
T=int(input())
print((int(N/X)+1)*T)

### FIXED CODE ###

n,x,t=map(int,input().split())
if n%x==0:
  print(n//x*t)
else:
  print((n//x+1)*t)
n, m = map(int, input().split())
ac = [0]*n
wa = [0]*n
a = 0
w = 0
for i in range(m):
  p, s = input().split()
  p = int(p)-1
  if ac[p] == 0, s == "AC":
    ac[p] += 1
    a += 1
    w += wa[p] 
  elif ac[p] == 0, s == "WA":
    wa[p] += 1
print(a,w)

### FIXED CODE ###

n, m = map(int, input().split())
ac = [0]*n
wa = [0]*n
a = 0
w = 0
for i in range(m):
  p, s = input().split()
  p = int(p)-1
  if ac[p] == 0 and s == "AC":
    ac[p] += 1
    a += 1
    w += wa[p] 
  elif ac[p] == 0 and s == "WA":
    wa[p] += 1
print(a,w)
a,b,c,d = map(int,input().split())
print(max(min(b,d)-max(a,c)),0)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
if a>=c and b>=d and d>a:
    print(d-a)
elif a<=c and b<=d and b>c:
    print(b-c)
elif a<c and d<b:
    print(d-c)
elif c<a and b<d:
    print(b-a)
else:
    print(0)
N=input()

if N>9*9:
    print('No')
else:
    print('Yes')


### FIXED CODE ###

N=int(input())

prime=[1]
for i in range(0,82):
    for j in range(2,10):
        P=i%j
        if P==0 and i/j<10:
            prime.append(i)
            break
if N in prime:
    print('Yes')
else:
    print('No')
n = int(input())
*l, = map(int, input().split())
def has_duplicates(seq):
    return len(seq) != len(set(seq))
S = has_duplicates(l)
if str(S) == 'False':
  print('YES')
elif str(S) == 'True':
  print('NO')



### FIXED CODE ###

S, T = input().split()
A, B = map(int,input().split())
U = input()
if U == S:
  print(A-1, B)
elif U == T:
  print(A, B-1)
N = int(input())
x, y, h = [[0]*N, [0]*N, [0]*N]
for n in range(N):
  x[n], y[n], h[n] = map(int, input().split())

def f():
  for xx in range(101):
    for yy in range(101):
      height = [0 for _ in range(N)]
      for n in range(N):
        height[n]= abs(x[n]-xx)+abs(y[n]-yy)+h[n]
      if len(set(height)) == 1:
        return [xx, yy,height[0]]
print(*f())

### FIXED CODE ###

N = int(input())
x, y, h = [[0]*N, [0]*N, [0]*N]
for n in range(N):
  x[n], y[n], h[n] = map(int, input().split())
  if h[n] > 0:
    hi = n

def g(xx, yy, height):
  for n in range(N):
    if max(height-abs(xx-x[n])-abs(yy-y[n]), 0) != h[n]:
      return False
  return True

def f():
  for xx in range(101):
    for yy in range(101):
      height = abs(xx-x[hi])+abs(yy-y[hi])+h[hi]
      if g(xx, yy, height) is True:
        return [xx, yy, height]
print(*f())
n=int(input())
a=list(map(int,input().split()))
ans=1
if a[0]<a[1]:flag=1
elif a[0]>a[1]:flag=-1
else:flag=0
for i in range(1,n-1):
  if flag==1 and a[i]>a[i+1]:
    ans+=1
    flag=0
  elif flag==-1 and a[i]<a[i+1]:
    ans+=1
    flag=0
  else:
    if a[i]>a[i+1]:flag=-1
    elif a[i]<a[i+1]:flag=1
print(ans)

### FIXED CODE ###

n=int(input())
if n==1:
  print(1)
  exit()
a=list(map(int,input().split()))
ans=1
if a[0]<a[1]:flag=1
elif a[0]>a[1]:flag=-1
else:flag=0
for i in range(1,n-1):
  if flag==1 and a[i]>a[i+1]:
    ans+=1
    flag=0
  elif flag==-1 and a[i]<a[i+1]:
    ans+=1
    flag=0
  else:
    if a[i]>a[i+1]:flag=-1
    elif a[i]<a[i+1]:flag=1
print(ans)
def mapt(fn, *args):
    return list(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))

def main():
    N, X = Input()
    x = Input()

    data = [abs(X - x[i]) for i in range(N)]
    ans = data[0]
    for i in range(1, len(data)):
        ans = gcd(data[i], ans)
    print(ans)



main()

### FIXED CODE ###

def gcd(a, b):
    """最大公約数"""
    if b == 0: return a
    return gcd(b, a % b)
  

def mapt(fn, *args):
    return list(map(fn, *args))
 
 
def Input():
    return mapt(int, input().split(" "))
 
def main():
    N, X = Input()
    x = Input()
 
    if N == 1:
        print(abs(x[0] - X))
        exit()
 
    x.append(X)
    x.sort()
    data = [abs(x[i] - x[i+1]) for i in range(N)]
 
    ans = data[0]
    for i in range(1, N):
        ans = gcd(data[i], ans)
    print(ans)
 
 
 
main()
L,R = (int(i) for i in input().split()) 
S=[]
j=0
if R-L>=2:
    for i in range(L,R):
        S.append((L+j)%2019)
        j=j+1
    S.sort()
    ans=(S[0]*S[1])%2019
print(ans)

### FIXED CODE ###

L,R = (int(i) for i in input().split())
ans=0
amari=2018
if R-L>=2018:
    print(ans)
else:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            if amari>=(i*j)%2019:
                amari=(i*j)%2019
    print(amari)
n,k=map(int,input().split())
a=list(map(int,input().split())
a.sort()
print(sum(a[:k]))


### FIXED CODE ###

n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
print(sum(a[:k]))
N,K = map(int, input().split())
if K > (N*(N-1)//2)-(N-1):
    print(-1)
    exit()
else:
    hen = [[0,0] for _ in range((N-1)+((N-1)*(N-2)//2)-K)]
    for i in range(2,N+1):
        hen[i-2] = [1,i]
    tmp = 1
    br = 0
    for j in range(2,N):
        for k in range(j+1,N+1):
            hen[N-2+tmp] = [j,k]
            tmp += 1
            if N-2+tmp == len(hen):
                br = 1
                break
        if br == 1:
            break
    print(len(hen))
    for l in hen:
        print(*l)

### FIXED CODE ###

N,K = map(int, input().split())
if K > (N*(N-1)//2)-(N-1):
    print(-1)
    exit()
else:
    hen = [[0,0] for _ in range((N-1)+((N-1)*(N-2)//2)-K)]
    for i in range(2,N+1):
        hen[i-2] = [1,i]
    tmp = 1
    br = 0
    if hen[-1] !=[0,0]:
        print(len(hen))
        for l in hen:
            print(*l)
        exit()
    for j in range(2,N):
        for k in range(j+1,N+1):
            hen[N-2+tmp] = [j,k]
            tmp += 1
            if N-2+tmp == len(hen):
                br = 1
                break
        if br == 1:
            break
    print(len(hen))
    for l in hen:
        print(*l)
n = int(input())
MOD = 10**9 + 7
ans = pow(10,n,MOD) - 2*pow(9.n,MOD) - pow(8,n,MOD)
print(ans%MOD)

### FIXED CODE ###

n = int(input())
MOD = 10**9 + 7
ans = pow(10,n,MOD) - 2*pow(9,n,MOD) + pow(8,n,MOD)
print(ans%MOD)
import sys
sys.setrecursionlimit(100000)

n, k = list(map(int,input().split(' ')))
path = []
for i in range(n+1):
    path.append([])
for i in range(n-1):
    a, b = list(map(int,input().split(' ')))
    path[a].append(b)
val = [0] * (n+1)
for i in range(k):
    v, pt = list(map(int,input().split(' ')))
    val[v] += pt
# BFS
# q = [1]
# while q:
#     v = q.pop(0)
#     for next_v in path[v]:
#         val[next_v] += val[v]
#         q.append(next_v)

# DFS
def f(current):
    for next_v in path[current]:
        val[next_v] += val[current]
        f(next_v)

f(1)

print(' '.join([str(pt) for pt in val[1:]]))


### FIXED CODE ###

from collections import deque

n, k = list(map(int,input().split(' ')))
path = []
for i in range(n+1):
    path.append([])
for i in range(n-1):
    a, b = list(map(int,input().split(' ')))
    path[a].append(b)
    path[b].append(a)
val = [0] * (n+1)
for i in range(k):
    v, pt = list(map(int,input().split(' ')))
    val[v] += pt

used = {}
q = deque([1])
used[1] = True
while q:
    v = q.pop()
    for next_v in path[v]:
        if next_v not in used:
            used[next_v] = True
            val[next_v] += val[v]
            q.append(next_v)

print(' '.join([str(pt) for pt in val[1:]]))