Harryxun/stf_run huggingface dataset:
k, s = map(int, input().split())
count = 0
for x in range(k+1):
  for y in range(k+1):
    z = s-x-y
      if 0 <= z <=k:
        count = count +1
print(count)

### FIXED CODE ###

k, s = map(int, input().split())
count = 0
for x in range(k+1):
    for y in range(k+1):
        z = s-x-y
        if 0 <= z <=k:
            count = count +1
print(count)
n,k = map(int,input().split())
a = list(map(int,input().split()))
memo = {}

tmp = 0
before = 1
for i in range(k):
    tmp = before
    before *= a[i]
memo[k-1][0] = before
memo[k-1][1] = tmp

for i in range(k,n):
    before = memo[i-1][0]
    
    tmp = 0
    after = 1
    for j in range(k):
        tmp = 
        after *= a[i-j]
    
    if before < after:
        print("Yes")
    else:
        print("No")
    
    memo[i] = after

### FIXED CODE ###

n,k = map(int,input().split())
a = list(map(int,input().split()))
memo = {}

for i in range(k,n):
    if a[i] > a[i-k]:
        print("Yes")
    else:
        print("No")
n=input()
a = []
for i in range(0,len(n)+1,2):
  a.append(str(n[i]))
print(*a)

### FIXED CODE ###

n=input()
a = []
a.append(str(n[:len(n):2]))
print(*a)
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
Max=0
for i in range(N):
  if A[i]>=B[i]:
    Max+=B[i]
  else:
    B[i]-=A[i]
    if A[i+1]>=B[i]:
      A[i+1]-=B[i]
      Max+=A[i]+B[i]
    else:
      A[i+1]=0
      Max+=A[i]+A[i+1]
print(Max)    

### FIXED CODE ###

N=int(input())
B=list(map(int,input().split()))
A=[]
A.append(B[0])
for i in range(0,N-2):
  A.append(min(B[i],B[i+1]))
A.append(B[N-2])
sum=0
for i in range(N):
  sum+=A[i]
print(sum)
n = input()
if 7 in n:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n = input()
if "7" in n:
    print("Yes")
else:
    print("No")
import numpy as np
import itertools

N = int(input())

V = np.array(list(map(int, input().split())))
C = np.array(list(map(int, input().split())))

ans = -1

for condition in itertools.product(range(2),repeat=N):

    cond_nparr = np.array(condition)

    x = np.sum(V[cond_nparr]) - np.sum(C[cond_nparr])

    ans = max(ans, x)

print(ans)


### FIXED CODE ###

N = int(input())

V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0


for v, c in zip(V, C):

    if v > c:

        ans += (v-c)

print(ans)
A,B,K = map(int,input().split())

a = A
b = B
if a = b= 1:
    print('1')
    exit()
def cal_divisor(num):
    prime = [2,3,5,7,11,13]
    ans_list = []
    for i in range(len(prime)):
        ans_list.append([prime[i],0])
    for i in range(len(prime)):
        while True:
            if num % prime[i] == 0:
                num //= prime[i]
                ans_list[i][1] += 1
            if num % prime[i] != 0:
                break
    return ans_list

q = cal_divisor(a)
w = cal_divisor(b)

ans = []
for i in range(len(q)):
    ans.append([q[i][0],min(q[i][1],w[i][1])])


ans1 = []
for i in range(len(ans)):
    if ans[i][1] != 0:
        times = ans[i][1]
        for j in range(times+1):
            ans1.append(ans[i][0] ** j)
ans1.sort() 
print(ans1[K-1])

### FIXED CODE ###

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

n = min(a,b)

count = 0
for i in reversed(range(1,n+1)):
    if a % i == 0 and b % i == 0:
        count += 1
    if count == k:
        print(i)
        break
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

A.sort()
C.sort()


def binary_search(lst, value, high):
  	if high:
      	value += 0.5
    else:
      	value -= 0.5
    l = 0
    r = N - 1
    while l <= r:
        mid = (l + r) // 2
        if lst[mid] < value:
            l = mid + 1
        elif lst[mid] > value:
            r = mid - 1
    if high:
        return l
    else:
        return r


def main():
    ans = 0
    for middle in B:
        lower = binary_search(A, middle, False) + 1
        higher = N - binary_search(C, middle, True)
        ans += lower * higher
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

#import generator


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

"""
with open('generator.txt', 'r') as f:
    read = f.read().split('\n')
    N = int(read[0])
    A = list(map(int, read[1].split()))
    B = list(map(int, read[2].split()))
    C = list(map(int, read[3].split()))
"""
A.sort()
C.sort()


def binary_search(lst, value, high):
    l = 0
    r = N - 1
    while l <= r:
        mid = (l + r) // 2
        if lst[mid] < value:
            l = mid + 1
        elif lst[mid] > value:
            r = mid - 1
        else:
            # lstの中にある場合
            if high:
                # 真に大きい
                return binary_search(lst, value + 0.5, high)
            else:
                # 真に小さい
                return binary_search(lst, value - 0.5, high)
    if high:
        return l
    else:
        return r


def main():
    ans = 0
    # Bの値でループしてそれより小さいA、大きいCの個数を求めて掛け合わせる
    for middle in B:
        lower = binary_search(A, middle, False) + 1 # 0-indexedで返るので+1する
        higher = N - binary_search(C, middle, True)
        ans += lower * higher
    print(ans)

    
# 愚直解
def main2():
    ans = 0
    for a in A:
        for b in B:
            for c in C:
                if a < b < c:
                    ans += 1
    print(ans)
    

if __name__ == "__main__":
    main()
    #main2()
A,B=map(int,input().split());A-=1;print[A,1,A+1,0][A%4]^[B,1,B+1,0][B%4]

### FIXED CODE ###

#!/usr/bin/env python

from collections import deque
import itertools as it
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18

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

ans = 0
for i in range(50):
    cnt = 0
    num1 = A
    cnt -= num1 / (2 ** (i + 1)) * (2 ** i)
    cnt -= max(0, num1 % (2 ** (i + 1)) - 2 ** i)
    num1 = B + 1
    cnt += num1 / (2 ** (i + 1)) * (2 ** i)
    cnt += max(0, num1 % (2 ** (i + 1)) - 2 ** i)
    if cnt % 2:
        ans += 2 ** i
print ans
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
j = 0
dp = [0] * 100100
dp[0] = 1
for i in range(1,N+1):
    if i == A[j]:
        j += 1
        dp[i] = 0
    else:
        dp[i] = dp[i-1] + dp[i-2]
        dp[i] %= 10**9+7
print(dp[N])

### FIXED CODE ###

N,M = (int(i) for i in input().split()) 
a = set(int(input()) for i in range(M))

mod=10**9+7

dp=[0]*(N+1)

dp[0]=1
if 1 in a:
	dp[1]=0
else:
	dp[1]=1

for i in range(0, N-1):
	if i+2 in a:
		dp[i+2]=0
	else:
		dp[i+2]+=dp[i+1]+dp[i]
	
print(dp[N]%mod)
x,y = map(int,input().split())	

# even + even 
ans = x*(x – 1) / 2

# odd + odd
ans += y*(y-1) / 2

print(ans)


### FIXED CODE ###

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

# even + even
ans = x*(x-1) / 2

# odd + odd
ans += y*(y-1) / 2

print(int(ans))
for i in range(1,10):
????????????for j in range(1,10):
????????????????????????print("{0}{1}{2}{3}{4}".format(i,"x",j,"=",i*j))

### FIXED CODE ###

for i in range(1,10):
    for j in range(1,10):
        print("{0}{1}{2}{3}{4}".format(i,"x",j,"=",i*j))
n, y = map(int, input().split())
y = y/1000
answer= ""

for rep1 in range(n + 1):
    for rep2 in range(n + 1):
        for rep3 in range(n + 1):
            if rep1 + rep2 + rep3 == n and rep1 * 10 + rep2 * 5 + rep3 == y:
                answer = ("rep1 rep2 rep3")
                break

print(answer) if answer != "" else print("-1 -1 -1")


### FIXED CODE ###

print(input().replace("2017", "2018"))
import math
A, B, H, M = map(int, input().split())

dgree_h = H / 12. * 360.
dgree_m = M / 60. * 360.

ang = math.pi / 180. * abs(dgree_h - dgree_m)
print(ang)


a = '{:.21f}'.format(math.sqrt(A ** 2. + B ** 2. - 2. * A * B * math.cos(ang)))
print((a))

### FIXED CODE ###

N = int(input())
n = N % 10

if n == 3:
    print('bon')
elif n in [0, 1, 6, 8]:
    print('pon')
else:
    print('hon')
N = int(input())
cnt_edges = [0]*N
A = []
K = 0
for _ in range(N-1):
    a,b = [int(x) for x in input().split()]
    cnt_edges[a-1]+=1
    cnt_edges[b-1]+=1
    A.append((a,b))

K = max(cnt_edges)

color = [set([i for i in range(1,K+1)]) for _ in range(N)]
print(K)
for edge in A:
    a,b = edge
    col = list(color[a-1] & color[b-1])[0]
    print(col)
    color[a-1].discard(col)
    color[b-1].discard(col)


### FIXED CODE ###

N = int(input())
edges = [[] for _ in range(N)]
cnt_edges = [0]*N
colors = [0]*(N-1)
di = {}
A = []
K = 0
for i in range(N-1):
    a,b = [int(x) for x in input().split()]
    edges[a-1].append(b-1)
    edges[b-1].append(a-1)

    K=max(K,len(edges[a-1]),len(edges[b-1]))
    di[(a-1,b-1)] = i
    di[(b-1,a-1)] = i
    A.append((a-1,b-1))
#%%
#K = max(cnt_edges)

stk = [(0,0)]
seen = set()
while(stk):
    n,used_color = stk.pop()
    available_color = 1
    next_stk = []
    for next in edges[n]:
        if(next in seen):
            continue
        if(available_color == used_color):
            available_color += 1
        next_stk.append((next,available_color))
        i = di[(next,n)]
        colors[i] = available_color
        available_color += 1
    stk += next_stk
    seen.add(n)

print(K)
for col in colors:
    print(col)
from numba import njit
N = int(input())
a = list(map(int, input().split()))
@njit()
def main():
  b = 1
  for i in range(N):
    b *= a[i]
    if 0 in a:
      b = 0
      break
    elif b > 10 ** 18:
      b = 'out'
      break
  if b == 'out':
    print(-1)
  else:
    print(b)
main()

### FIXED CODE ###

import sys
n = input()
list_num =list(map(int,input().split()))
output = 1
if 0 in list_num:
    print(0)
    sys.exit()
for i in list_num:
    output = output * i
    if output > 10 ** 18:
        print(-1)
        sys.exit()
print(output)
from collections import defaultdict

N, M = map(int, input().split())
xy = [list(map(int, input().split())) for _ in range(M)]

g = {i:[] for i in range(1, 110000)}
g2 = {i:[] for i in range(1, 110000)}
done = [0] * (N+1)
memo = [0] * (N+1)
for x, y in xy:
    g[x].append(y)
    g2[y].append(x)

def dp2(v):
    max_len = 0
    if done[v] == 1:
        return memo[v]
    
    for i in g2[v]:
        max_len = max(max_len, dp2(i) + 1)
    done[v] = 1
    memo[v] = max_len
    return max_len
    
    
def dp(v):
    max_len = 0
    if done[v] == 1:
        return memo[v]
    else:
        for to in g[v]:
            max_len = max(max_len, dp(to)+1)
        done[v] = 1
        memo[v] = max_len
        return max_len

ans = 0
for v in range(1, N+1):
    ans = max(ans, dp2(v))
print(ans)

### FIXED CODE ###

from collections import defaultdict, deque

def topological_sort(vertex:list, edge:list):
    graph = {i: [] for i in vertex}
    for i, j in edge:
        graph[i].append(j)
        
    inp_cnt = defaultdict(int)
    outs = defaultdict(list)
    for inp, out in edge:
        inp_cnt[out] += 1
        outs[inp].append(out)

    result = []
    queue = deque([i for i in vertex if inp_cnt[i]==0])
    while queue:
        v = queue.popleft()
        result.append(v)
        for v2 in outs[v]:
            inp_cnt[v2] -= 1
            if inp_cnt[v2] == 0:
                queue.append(v2)
    return result

N, M = map(int, input().split())
vertex = list(range(1, N+1))
edge = [list(map(int, input().split())) for _ in range(M)]
graph = {i: [] for i in vertex}
for i, j in edge:
    graph[i].append(j)

sorted_vertecies = topological_sort(vertex, edge)
dp = [0] * (N+1)
for i in sorted_vertecies:
    ends = graph[i]
    for j in ends:
        dp[j] = max(dp[j], dp[i] + 1)
print(max(dp))
def main():
    data = []
    while 1:
        n = input().split()
        ans = int(n[0])
        length = data.__len__()
        data.append(ans)

        if n == 0:
            break

        if length > 10001:
            print("Too Large")
            break
        else:
            for i in range(0,9999):
                d_val = data[i]

                if d_val != 0:
                    print("Case{0}:{1}".format(i+1,d_val))
                else:
                    break

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    data = []
    while 1:
        n = input().split()
        ans = int(n[0])

        if ans == 0:
            break

        data.append(ans)


    length = len(data)
    what_large = length > 10000

    if what_large:
        print("Too Large")
    else:
        for i in range(len(data)):
            d_val = data[i]

            if d_val != 0:
                print("Case {0}: {1}".format(i+1,d_val))
            else:
                break

if __name__ == '__main__':
    main()
n = input()
ti = input().split()
sum_ti = sum(map(int, ti))

m = input()
for m in range(int(m)):
    px = input().split()
    sum_p = sum_ti - int(ti[int(px[0])-1]) + int(px[1])
    print(sum_p)


### FIXED CODE ###

aopb = input().split()

if aopb[1] == '+':
    print(int(aopb[0]) + int(aopb[2]))
else:
    print(int(aopb[0]) - int(aopb[2]))
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    ga, sa, ba = map(int, rl().split())
    gb, sb, bb = map(int, rl().split())
    
    dp1 = [0] * 100000
    dp1[0] = N
    M = N
    for i in range(N + 1):
        dp1[i + ga] = max(dp1[i + ga], dp1[i] - ga + gb)
        dp1[i + sa] = max(dp1[i + sa], dp1[i] - sa + sb)
        dp1[i + ba] = max(dp1[i + ba], dp1[i] - ba + bb)
        M = max(M, dp1[i])
    
    dp2 = [0] * 100000
    dp2[0] = M
    ans = M
    for i in range(M + 1):
        dp2[i + gb] = max(dp2[i + gb], dp2[i] - gb + ga)
        dp2[i + sb] = max(dp2[i + sb], dp2[i] - sb + sa)
        dp2[i + bb] = max(dp2[i + bb], dp2[i] - bb + ba)
        ans = max(ans, dp2[i])
    print(ans)


if __name__ == '__main__':
    solve()


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    N = int(rl())
    ga, sa, ba = map(int, rl().split())
    gb, sb, bb = map(int, rl().split())
    
    dp1 = [0] * 30000000
    dp1[0] = N
    M = N
    for i in range(N + 1):
        dp1[i + ga] = max(dp1[i + ga], dp1[i] - ga + gb)
        dp1[i + sa] = max(dp1[i + sa], dp1[i] - sa + sb)
        dp1[i + ba] = max(dp1[i + ba], dp1[i] - ba + bb)
        M = max(M, dp1[i])
    
    dp2 = [0] * 30000000
    dp2[0] = M
    ans = M
    for i in range(M + 1):
        dp2[i + gb] = max(dp2[i + gb], dp2[i] - gb + ga)
        dp2[i + sb] = max(dp2[i + sb], dp2[i] - sb + sa)
        dp2[i + bb] = max(dp2[i + bb], dp2[i] - bb + ba)
        ans = max(ans, dp2[i])
    print(ans)


if __name__ == '__main__':
    solve()
import fileinput

a, b = [int(i) for i in fileinput.input().next().strip().split()]
if a > b:
	print "a > b"
if a < b:
	print "a < b"
if a == b:
	print "a == b

### FIXED CODE ###

import fileinput
import sys

a, b = [int(i) for i in fileinput.input().next().strip().split()]
if a > b:
    print "a > b"
    sys.exit(0)
if a < b:
    print "a < b"
    sys.exit(0)
if a == b:
    print "a == b"
    sys.exit(0)
import sys
sys.setrecursionlimit(10000000)
S = input()
ans = 0
i = 0
while i < len(S)-3:
    for j in range(i+4, len(S)+1):
        if int(S[i:j]) % 2019 == 0:
            ans += 1
            i += j-5
    i += 1
print(ans)


### FIXED CODE ###

s = input()[::-1]
length = len(s)
a = [0] * length
d = [0] * length
ans = [0] * 2019
x = 10

a[0] = int(s[0])
d[0] = a[0]
ans[d[0]] += 1

for i in range(1, length):
    a[i] = int(s[i]) * x % 2019
    d[i] = (d[i-1] + a[i]) % 2019
    ans[d[i]] += 1
    x = x * 10 % 2019

ans_c = [i for i in ans if i != 0]

print(int(sum([ans_c[i] * (ans_c[i]-1) for i in range(len(ans_c))]) / 2) + ans[0])
def main():

    N,M=map(int,input().split())
    #undivList=[map(int,(input().split())) for _ in range(N)]
    undivList=[]
    for _ in range(M):
        l=map(int,input().split())
        undivList +=l
    atmax=max(undivList[0::2])
    atmin=min(undivList[1::2])
    
    if atmax-atmin < 0:
		print(0)
    else:
		print(abs(atmax-atmin)+1)

    


if __name__== "__main__":
    main() 

### FIXED CODE ###

def main():

    N,M=map(int,input().split())
    #undivList=[map(int,(input().split())) for _ in range(N)]
    undivList=[]
    for _ in range(M):
        l=map(int,input().split())
        undivList +=l
    atmax=max(undivList[0::2])
    atmin=min(undivList[1::2])
    
    if atmax>atmin:
        print(0)
    else:
        print(abs(atmax-atmin)+1)



if __name__== "__main__":
    main()
n, m = map(int, input().split())
c = m - 2*n
if c <= 0:
    pirnt(m//2)
else:
    print(n + c//4)

### FIXED CODE ###

n, m = map(int, input().split())
c = m - 2*n
if c <= 0:
    print(m//2)
else:
    print(n + c//4)
S = include()
a = "Sunny"
b = 'Cloudy'
c = 'Rainy'
if S == a:
    print(b)
elif S == b:
        print(c)
elif S == b:
        print(a)


exit()

### FIXED CODE ###

import sys
S = input()
a = "Sunny"
b = 'Cloudy'
c = 'Rainy'
if S == a:
    print(b)
elif S == b:
        print(c)
elif S == c:
        print(a)
else:
    sys.exit()
sys.exit()
def dp(n,cost):
    global N,h
    if n==N-1:
        return cost
    if n==N-2:
        return dp(n+1,cost+abs(h[n]-h[n+1]))
    else:
        take1 = dp(n+1,cost+abs(h[n]-h[n+1]))
        take2 = dp(n+2,cost+abs(h[n]-h[n+2]))
        return min(take1, take2)
N = int(input())
h = list(map(int,input().split()))
print(dp(0,0))

### FIXED CODE ###

N = int(input())
h = list(map(int,input().split()))
sum = []
sum.append(0)
for i in range(1,N):
    if i>1:
        sum.append(min(sum[i-1]+abs(h[i-1]-h[i]),sum[i-2]+abs(h[i-2]-h[i])))
    else:
        sum.append(sum[i-1]+abs(h[i-1]-h[i]))
print(sum[N-1])
import sys
sys.setrecursionlimit(100000)
class fact():
    def __init__(self, i, mod):
        self.l = [1] * (i+1)
        for i in range(1, i+1):
            self.l[i] = self.l[i-1] * i
        self.mod = mod
        self.g1 = [1, 1]
        self.g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, 2 * (10 ** 5) + 1):
            self.g1.append((self.g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            self.g2.append((self.g2[-1] * inverse[-1]) % mod)


def main():
    N = int(input())
    d = {}
    mod = 10**9 + 7
    f = fact(N, mod)
    for i in range(N-1):
        a, b = map(int, input().split())
        if a in d:
            d[a].append(b)
        else:
            d[a] = [b]
        if b in d:
            d[b].append(a)
        else:
            d[b] = [a]
    for i in range(1, N+1):
        v = set()
        r, t = solve(i, N, v, f, d)
        print(r % mod)
def solve(n, a, v, f, d):
    v.add(n)
    x = 0
    unv = []
    for i in d[n]:
        if i not in v:
            x += 1
            unv.append(i)
    if x == 1:
        r, t = solve(unv[0], a-1, v, f, d)
        return r, t + 1
    if x == 0:
        return 1, 1
    t = 1
    r = 1
    for i in unv:
        rr, tt = solve(i, a-1, v, f, d)
        t += tt
        r *= rr
        r *= f.g2[tt]
    r *= f.l[t-1]
    return r, t
main()


### FIXED CODE ###

import heapq
def main():
    X, Y, A, B, C = map(int, input().split())
    p = list(map(int, input().split()))
    q = list(map(int, input().split()))
    r = list(map(int, input().split()))
    p.sort(reverse=True)
    q.sort(reverse=True)
    r.sort(reverse=True)
    h = []
    for i in p[:X]:
        heapq.heappush(h, (i, 'r'))
    for i in q[:Y]:
        heapq.heappush(h, (i, 'g'))
    a = sum(p[:X]) + sum(q[:Y])
    ra = 0
    ga = 0
    i = 0
    while h:
        t = heapq.heappop(h)
        if r[i] < t[0]:
            break
        if t[1] == 'r' and ra <= X:
            a += r[i]
            a -= t[0]
            ra += 1
            i += 1
        elif t[1] == 'g' and ga <= Y:
            ga += 1
            a += r[i]
            a -= t[0]
            i += 1
        if ra == X and ga == Y:
            break
        if i >= C:
            break
    return a
print(main())
#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):
    preH=alc_H(Cxi,Cyj,px[0],py[0],ph[0])
    for i in range(len(ph)):
        nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
        if nowH!=preH:
            break
        preH=nowH
    else:
        print(Cxi,Cyj,nowH)

### FIXED CODE ###

#112
from itertools import product

N=int(input())
px,py,ph=[],[],[]

for _ in range(N):
    x,y,h=map(int,input().split())
    if h!=0:
        px.append(x)
        py.append(y)
        ph.append(h)
        
def Calc_H(Cxi,Cyj,pxi,pyj,hi):
    return hi+abs(Cxi-pxi)+abs(Cyj-pyj)

for Cxi,Cyj in product(range(101),range(101)):

    if len(ph)!=1:
        preH=Calc_H(Cxi,Cyj,px[0],py[0],ph[0])
        for i in range(len(ph)):
            nowH=Calc_H(Cxi,Cyj,px[i],py[i],ph[i])
            if nowH!=preH:
                break
            preH=nowH
        else:
            print(Cxi,Cyj,nowH)
            break
    else:
        print(px[0],py[0],ph[0])
        break
S = ipnut()
T = input()

if(S==T[:-1]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")
import math

N = int(input())
A = []
B = []
F = []
for i in range(1,int(N/2),1):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))


### FIXED CODE ###

import math

N = int(input())
A = []
B = []
F = []

for i in range(1,int(math.sqrt(N))+1,1):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))
n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)

if len(x_list) >= 3:
  a = []
  for i in range(1,n):
    a.append(x_list[i] - x_list[i-1])
  a = sorted(a)
  c = [a[1],a[0]]
  while c[0]%c[1] != 0:
    c.append(c[0]%c[1])
    c.pop(0)
  else:
    print(c[1])
else:
  print(x_list[1]-x_list[0])

### FIXED CODE ###

n,x = map(int,input().split())
x_list = list(map(int,input().split()))
x_list.append(x)
x_list = sorted(x_list)
def u(o,p):
  c = [a[1],a[0]]
  while c[0]%c[1] != 0:
    c.append(c[0]%c[1])
    c.pop(0)
  else:
    return c[1]
    
if 4 >= len(x_list) >= 3:
  a = []
  for i in range(1,n+1):
    a.append(x_list[i] - x_list[i-1])
  a = sorted(a)
  print(u(a[1],a[0]))

elif len(x_list) > 4:
  a = []
  for i in range(1,n+1):
    a.append(x_list[i] - x_list[i-1])
  a = sorted(a)
  u = u(a[1],a[0])
  for i in a:
    if i/u == int(i/u):
      pass
    else:
      u = i%u
  print(u)
else:
  print(x_list[1]-x_list[0])