Harryxun/stf_run huggingface dataset:
n=int(input())
l=list(map(int,input().split()))
s=[[0]for _ in range(n)]
#print(s)

import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
    
for i in range(n):
    if i==0:
        s[0]=l[1:]
    
    else:
        s[i]=l[:i]+l[i+1:]
ans=1
for i in s:
    ans=max(gcd_list(i),ans)
print(ans)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
s=[[0]for _ in range(n)]
#print(s)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort(reverse=True)
    return divisors

l.sort()
ans=1

b=l[1]
bl=make_divisors(b)
for i in bl:
    check=True
    for j in range(1,n):
        if l[j]%i!=0:
            check=False
            break
    if check:
        ans=max(ans,i)
        break
a=min(l)
al=make_divisors(a)
#print(al)
for i in al:
    cnt=0
    for j in range(n):
        if l[j]%i!=0:
            cnt+=1
        if cnt>1:
            break
    if cnt==0 or cnt==1:
        ans=max(ans,i)
        break
print(ans)
N,K=(int(x) for x in input().split())
S=list(int(i) for i in input())
S[K-1] = S[K-1].lower()
print(' '.join(S))

### FIXED CODE ###

N,K=(int(x) for x in input().split())
S=list(input())
S[K-1] = S[K-1].lower()
print(''.join(S))
import math
n,x=map(int,input().split())
print(3*(n-math.gcd(n,x)))

### FIXED CODE ###

from fractions import gcd
n,x=map(int,input().split())
print(3*(n-gcd(n,x)))
N,W=map(int,input().split(' '))
w=[0]*N ; v=[0]*N
for i in range(N):
    w[i],v[i]=map(int,input().split(' '))
dp=[[0]*(W+1) for _ in range(N+1)]
for i in range(1,N+1):
    for j in range(1,W+1):
        if j<w[i-1]:
            dp[i][j]=dp[i-1][j]
        else:
            dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i-1]]+v[i-1])
print(dp[N][W])

### FIXED CODE ###

N,W=map(int,input().split(' '))
w=[0]*N ; v=[0]*N
for i in range(N):
    w[i],v[i]=map(int,input().split(' '))
S=sum(v)
A=0
dp=[[sum(w)]*S for _ in range(N+1)]
for i in range(N):
    for j in range(S):
        if j<v[i]:
            dp[i+1][j]=min(dp[i][j],w[i])
        else:
            dp[i+1][j]=min(dp[i][j],dp[i][j-v[i]]+w[i])
        if dp[i+1][j]>W:
            A=j
            break
        if j==S-1:
          A=j+1
print(A)
import math
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
S = [0] * N

for i in range(1, N):
  S[i] = min(S[_] + abs(h[i] - h[_]) for range(max(0, i-K), i)]

print(S[N-1])


### FIXED CODE ###

from numba import jit
import math
N, K = map(int, input().split())
h = list(map(int, input().split()))
 
@jit
def nya(N, K, h):
    S = [0] * N
    S[0] = 0
 
    for i in range(1, N):
        value = math.inf
        for step in range(1, K + 1):
            if i - step < 0:
                break
            value = min(value, S[i - step] + abs(h[i] - h[i - step]))
        S[i] = value
    return S[N-1]

print(nya(N, K, h))
p_num = int(input())
p = list(map(int,input().split()))

count = 0
for i in range(p_num):
    for j in range(i+1):
        if p[i] > p[j]:
            break
    else:
        count += 1
        

print(count)


### FIXED CODE ###

n,m = map(int,input().split())
if n == m:
    print('Yes')
else:
    print('No')
a =list(map(int,input().split()))
print(max(a)-min(b))


### FIXED CODE ###

a =list(map(int,input().split()))
print(max(a)-min(a))
n = int(input())
from collections import defaultdict
graph = defaultdict(list)
edge = []
for i in range(n-1):
  a, b = list(map(int, input().split()))
  edge.append((a, b))
  graph[a].append(b)
  graph[b].append(a)
c = list(map(int, input().split()))
c.sort(reverse=True)
visited = [0 for i in range(n+1)]
ans = [0 for i in range(n+1)]
score = 0

def dfs(x):
  visited[x] = 1
  for next_ in graph[x]:
    if visited[next_]:
      continue
    dfs(next_)
  if all(visited[i] for i in graph[x]):
    ans[x] = c.pop()
    return
  visited[x] = 0

dfs(1)
for a, b in edge:
  score += min(ans[a], ans[b])
print(score)
print(*ans[1:])

### FIXED CODE ###

n = int(input())
from collections import defaultdict
import sys
sys.setrecursionlimit(10**7)
graph = defaultdict(list)
edge = []
for i in range(n-1):
  a, b = list(map(int, input().split()))
  edge.append((a, b))
  graph[a].append(b)
  graph[b].append(a)
c = list(map(int, input().split()))
c.sort(reverse=True)
visited = [0 for i in range(n+1)]
ans = [0 for i in range(n+1)]
score = 0

def dfs(x):
  visited[x] = 1
  for next_ in graph[x]:
    if visited[next_]:
      continue
    dfs(next_)
  if all(visited[i] for i in graph[x]):
    ans[x] = c.pop()
    return
  visited[x] = 0

dfs(1)
for a, b in edge:
  score += min(ans[a], ans[b])
print(score)
print(*ans[1:])
N = int(input())
d = list(map(int, input().split())) 

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)+1]-d[int(len(d)/2)])

### FIXED CODE ###

N = int(input())
d = list(map(int, input().split())) 
d.sort()

if(len(d)%2!=0):
    print(0)
else: 
    print(d[int(len(d)/2)]-d[int(len(d)/2)-1])
from math import sqrt


def dfs(remains, elapsed, hx, hy):
    global crystals

    if not remains:
        return True

    remains_c = set()
    for i in remains:
        cx, cy, dfd = crystals[i]
        new_elapsed = elapsed + sqrt((cx - hx) ** 2 + (cy - hy) ** 2)
        if dfd <= new_elapsed:
            return False
        remains_c.add((i, cx, cy, new_elapsed))

    for i, cx, cy, new_elapsed in remains_c:
        remains.remove(i)
        if dfs(remains, new_elapsed, cx, cy):
            return True
        remains.add(i)

    return False


while True:
    n, hx, hy, dx, dy = map(int, input().split())
    if n == 0: break

    crystals = [(cx, cy, sqrt((cx - dx) ** 2 + (cy - dy) ** 2))
                for cx, cy in (map(int, input().split()) for _ in range(n))]

    print('YES' if dfs(set(range(n)), 0, hx, hy) else 'NO')

### FIXED CODE ###

from math import sqrt


def dfs(remains, elapsed, hx, hy, prev):
    global crystals, dc

    if not remains:
        return True

    remains_c = set()
    for i in remains:
        cx, cy, dfd = crystals[i]
        new_elapsed = elapsed + dc[prev][i]
        if dfd <= new_elapsed:
            return False
        remains_c.add((i, cx, cy, new_elapsed))

    for i, cx, cy, new_elapsed in remains_c:
        remains.remove(i)
        if dfs(remains, new_elapsed, cx, cy, i):
            return True
        remains.add(i)

    return False


while True:
    n, hx, hy, dx, dy = map(int, input().split())
    if n == 0: break

    crystals_in = [tuple(map(int, input().split())) for _ in range(n)]
    crystals = [(cx, cy, sqrt((cx - dx) ** 2 + (cy - dy) ** 2)) for cx, cy in crystals_in]
    crystals_in += [(hx, hy)]
    dc = [[sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) for x2, y2 in crystals_in] for x1, y1 in crystals_in]

    print('YES' if dfs(set(range(n)), 0, hx, hy, n) else 'NO')
N,T = map(int,input().split())
ls = []

for i in range(N):
  c,t = map(int,input().split())
  if t <= T:
    ls.append(c)
    
print(min(ls))

### FIXED CODE ###

N,T = map(int,input().split())
ls = []

for i in range(N):
  c,t = map(int,input().split())
  if t <= T:
    ls.append(c)
    
print(min(ls) if ls else "TLE")
x,y=map(int,input().split())
m=list(map(int,input().split())
ans=0
for i in m:
    if m[i]>=y:
        ans += 1
print(ans)
      

### FIXED CODE ###

x,y=map(int,input().split())
m=list(map(int,input().split()))
ans=0
for i in m:
    if i>=y:
        ans += 1
print(ans)
a,b = map(int, input().split())
b = int(b*100)
print(a*b/100)

### FIXED CODE ###

from decimal import Decimal
s = input().split()
a,b = int(s[0]),Decimal(s[1])
print(int(a*b))
N, Q = map(int, input().split())
S = input()
output = []
for i in range(Q):
	l, r = map(int, input().split())
	Slr = S[l - 1:r]
	output.append(Slr.count('AC'))
for i in output:
	print(i)


### FIXED CODE ###

b = input()
if b == 'A':
	print('T')
if b == 'C':
	print('G')
if b == 'T':
	print('A')
if b == 'G':
	print('C')
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
dishes = [a,b,c,d,e]
n = []
ans = 0
for i in range(5):
  if dishes[i]%10==0:
    ans += dishes[i]//10
  else:
    ans += dishes[i]//10+1
    n.append(dishes[i]%10)

ans = ans*10-10+min(n)
print(ans)

### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
dishes = [a,b,c,d,e]
n = []
ans = 0
for i in range(5):
  if dishes[i]%10==0:
    ans += dishes[i]//10
  else:
    ans += dishes[i]//10+1
    n.append(dishes[i]%10)
if len(n)==0:
  print(ans*10)
else:
  ans = ans*10-10+min(n)
  print(ans)
n = int(input())
li = list(map(int,input().split()))
li.sort()
s=0
for i in range(n-1):
  s+=li[i]
if s<=li[-1]:
  print(No)
else:
  print(Yes)

### FIXED CODE ###

n = int(input())
li = map(int,input().split())
li = list(li)
li.sort()
s=0
for i in range(n-1):
  s+=li[i]
if s<=li[-1]:
  print("No")
else:
  print("Yes")
def minchange(s,t):
  m=len(s)
  n=len(t)
  if n!=m:
    return -1
  cnt=[0]*256
  for i in range(n):
    cnt[ord(t[i])]+=1
  for i in range(n):
    cnt[ord(s[i])]-=1
  for i in range(256):
    if cnt[i]:
      return -1
  res=0
  i=n-1
  j=n-1
  while i>=0:
    while i>=0 and s[i]!=t[i]:
      i-=1
      res+=1
    if i>=0:
      i-=1
      j-=1
  return res
s=input()
t=int(input())
print(str(minchange(s,t))
      
  

### FIXED CODE ###

def minchange(s,t):
  m=len(s)
  n=len(t)
  if n!=m:
    return -1
  cnt=[0]*256
  for i in range(n):
    cnt[ord(t[i])]+=1
  for i in range(n):
    cnt[ord(s[i])]-=1
  res=0
  i=n-1
  j=n-1
  while i>=0:
    while i>=0 and s[i]!=t[i]:
      i-=1
      res+=1
    if i>=0:
      i-=1
      j-=1
  return res
s=input()
t=input()
print(str(minchange(s,t)))
a,b=int(input())

a-=1
b-=1

print(a*b)

### FIXED CODE ###

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

print((a-1)*(b-1))
N = int(input())
L = map(int,input().split())
max = 0
count = 0

for i in range(N):
  count += L[i]
  if max < L[i]:
    max = L[i]
    
if count < 2*max:
  print("Yes")
else:
  print("No")
  

### FIXED CODE ###

N = int(input())
L = input().split()
max = 0
count = 0

for i in range(N):
  count += int(L[i])
  if max < int(L[i]):
    max = int(L[i])
    
if count > 2*max:
  print("Yes")
else:
  print("No")
N = int(input())
LR = [list(map(int,input().split())) for _ in range(N)]

ML = max(LR)[0]
mR = min(LR,key=lambda x:x[1])[1]

ans = max(ML-mR+1,0)+max([LR[i][1]-LR[i][0]+1 for i in range(N)])
LR.sort(key=lambda x:[x[1],x[0]])

L_ = [0]*N
for i in range(N):
    L_[i] = max(L[i],L_[i-1])

for i in range(1,N):
    ans = max(ans,max(LR[i][1]-ML+1,0)+max(mR-L_[i-1]+1,0))

print(ans)

### FIXED CODE ###

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

LR.sort(key=lambda x:[-x[0],x[1]])
ML = LR[0][0]
MR = LR[0][1]
LR.sort(key=lambda x:[x[1],-x[0]])
mR = LR[0][1]
mL = LR[0][0]

ans = max(mR-ML+1,0)
for i in range(N):
    if LR[i] not in [[ML,MR],[mL,mR]]:
        ans = max(ans,max(mR-ML+1,0)+max(LR[i][1]-LR[i][0]+1,0))

LR.sort(key=lambda x:[x[1],x[0]])

L_ = [0]*N
for i in range(N):
    L_[i] = max(LR[i][0],L_[i-1])

for i in range(1,N):
    ans = max(ans,max(LR[i][1]-ML+1,0)+max(mR-L_[i-1]+1,0))

print(ans)
def c():
    n = int(input())
    a = list(map(int, input().split()))
    l = list(map(lambda i: min(8, i//400), a))
    over_rate = l.count(8)
    res = set(l)
    try: res.remove(8)

    mi = max(1, len(res))
    ma = len(res) + over_rate
    print(mi, ma)

c()

### FIXED CODE ###

def c():
    n = int(input())
    a = list(map(int, input().split()))
    x = []
    def set_col(rate):
        if rate <= 399:
            return '灰色'
        elif rate <= 799:
            return '茶色'
        elif rate <= 1199:
            return '緑色'
        elif rate <= 1599:
            return '水色'
        elif rate <= 1999:
            return '青色'
        elif rate <= 2399:
            return '黄色'
        elif rate <= 2799:
            return '橙色'
        elif rate <= 3199:
            return '赤色'
        else:
            x.append(1)
            return

    res = set(map(set_col, a))
    if None in res: res.remove(None)
    mi = max(1, len(res))
    ma = len(res) + len(x)
    print(mi, ma)

c()
S=list(input())

A=0
for i in range(N):
    if S[i]=="+":
        A=A+1
    elif S[i]=="-":
        A=A-1
    else:
        pass

print(A)

### FIXED CODE ###

S=list(input())

A=0
for i in range(4):
    if S[i]=="+":
        A=A+1
    elif S[i]=="-":
        A=A-1
    
print(A)
x,n=map(int,input().split())
if n==0:
    print(x)
else:
    P=list(map(int,input().split()))
    N=[i for i in range(1,101)]

    for p in P:
        N.pop(N.index(p))

    L=[]
    for i in range(n):
        l=abs(N[i]-x)
        L.append(l)
    m=L.index(min(L))
    print(N[m])

### FIXED CODE ###

x,n=map(int,input().split())
if n==0:
    print(x)
else:
    P=list(map(int,input().split()))
    N=[i for i in range(0,102)]

    for p in P:
        N.pop(N.index(p))

    L=[]
    for a in N:
        l=abs(a-x)
        L.append(l)
    
    m=L.index(min(L))
    print(N[m])
n = int(input())
d = list(map(int, input().split()))
d.sort()

print(d[n/2] - d[n/2-1])

### FIXED CODE ###

n = int(input())
d = list(map(int, input().split()))
d.sort()
print(d[int(n/2)] - d[int(n/2)-1])
def main():
	N, M = map(int, input().split())
	points = [[] for _ in range(N+1)]
	for i in range(1, M+1):
		a, b, c = map(int, input().split())
		points[a].append([b, c, i])
		points[b].append([a, c, i])
	is_visited = [False]*(N+1)
	is_visited[0] = True
	use = set()
	def dijksta(start):
		is_visited[start] = True
		stack = list(points[start])
		edge = 0
		while stack:
			edge += 1
			stack.sort(key=lambda x: x[1])
			use_edge = stack.pop()
			cur = use_edge[0]
			dist = use_edge[1]
			use.add(use_edge[2])
			is_visited[cur] = True
			if all(is_visited):
				return edge
			add_stack = list(points[cur])
			removes = []
			for i, pair in enumerate(add_stack):
				if is_visited[pair[0]]:
					removes.append(i)
					continue
				add_stack[i][1] += dist
			removes.reverse()
			for i in removes:
				add_stack.pop(i)
			stack.extend(add_stack)
	for i in range(1, M+1):
		dijksta(i)
	ans = M - len(use)
	print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
	INF = 10**9+7
	N, M = map(int, input().split())
	dist = [[INF for _ in range(N+1)] for _ in range(N+1)]
	for i in range(1, N+1):
		for j in range(1, N+1):
			if i == j:
				dist[i][j] = 0
	a, b, c = [0]*M, [0]*M, [0]*M
	for i in range(M):
		a[i], b[i], c[i] = map(int, input().split())
		dist[a[i]][b[i]] = min(dist[a[i]][b[i]], c[i])
		dist[b[i]][a[i]] = min(dist[b[i]][a[i]], c[i])
	for k in range(1, N+1):
		for i in range(1, N+1):
			for j in range(1, N+1):
				dist[i][j] = min(dist[i][j], dist[i][k]+dist[k][j])
	ans = M
	for i in range(M):
		shrotest = False
		for j in range(1, N+1):
			if dist[j][a[i]]+c[i] == dist[j][b[i]]:
				shrotest = True
		if shrotest:
			ans -= 1
	print(ans)

if __name__ == '__main__':
    main()
def main():
    import bisect
    import copy
    import heapq
    import math
    import sys
    from collections import *
    from itertools import accumulate, combinations, permutations, product
    # from math import gcd
    def input():
        return sys.stdin.readline()[:-1]
    def ruiseki(lst):
        return [0]+list(accumulate(lst))
    mod=pow(10,9)+7
    al=[chr(ord('a') + i) for i in range(26)]
    direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

    cnt=0

    itta=[[10**9]*w for i in range(h)]

    d=deque()
    # aaa=d.append
    for i in range(h):
        for j in range(w):
            if a[i][j]=="#":
                d.append((i,j))
                itta[i][j]=0

    # print(d)
    # print(itta)

    while d:
        cnt+=1
        for l in range(len(d)):
            nh,nw=d.popleft()
            for i in range(4):
                d1,d2=direction[i]
                if 0<=nh+d1<h and 0<=nw+d2<w:
                    if itta[nh+d1][nw+d2]==10**9:
                        itta[nh+d1][nw+d2]=cnt
                        d.append((nh+d1,nw+d2))
        # print(d)

    # print(itta)
    print(cnt-1)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
# from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

cnt=0

itta=[[10**9]*w for i in range(h)]

d=deque()
aaa=d.append
for i in range(h):
    for j in range(w):
        if a[i][j]=="#":
            aaa([i,j])
            itta[i][j]=0

# print(d)
# print(itta)

while d:
    cnt+=1
    for l in range(len(d)):
        nh,nw=d.popleft()
        for i in range(4):
            d1,d2=direction[i]
            if 0<=nh+d1<h and 0<=nw+d2<w:
                if itta[nh+d1][nw+d2]==10**9:
                    itta[nh+d1][nw+d2]=cnt
                    aaa([nh+d1,nw+d2])
    # print(d)

# print(itta)
print(cnt-1)
import sys
import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
A = [ri() for _ in range(N)]
B = sorted(np.array(A))
C = [np.where(B == a)[0][0] for a in A]
answer = sum([i%2==1 and x%2!=1 for i, x in enumerate(C)])
print(answer)
# 41


### FIXED CODE ###

import sys
import numpy as np

stdin = sys.stdin

ri = lambda: int(rs())
rl = lambda: list(map(int, stdin.readline().split())) # applies to numbers only
rs = lambda: stdin.readline().rstrip()  # ignore trailing spaces

N = ri()
A = [ri() for _ in range(N)]
B = sorted(A)
B = set(B[1::2])
C = [i%2==1 and a not in B for i, a in enumerate(A)]
print(sum(C))
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
int n;
long long a[N];


long long gcd(long long a, long long b){
    return b ? gcd(b, a % b) : a;
}



int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n;
    
    for (int i = 1; i <= n; i++)cin>>a[i];
    
    long long  lcm = 1;
    
    for (int i = 1; i <= n; i++){
        lcm = lcm/gcd(a[i], lcm)*a[i];
    }
    cout<<lcm<<endl;
    
    
    return 0;
}



### FIXED CODE ###

import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def gcd(a, b):
    return gcd(b, a % b) if b else a


def solve():
    n = f()[0]
    a = []
    for i in range(n):
        a.append(f()[0])

    lcm = a[0]

    for i in range(1,n):
        lcm = lcm*a[i]//gcd(lcm, a[i])

    print(lcm)


solve()
def solve(string):
    n, m, *a = map(int, string.split())
    needs = {i + 1: n for i, n in enumerate(map(int, "2 5 5 4 5 6 3 7 6".split()))}
    if 2 in a and 5 in a:
        a.remove(2)
    if 3 in a and 5 in a:
        a.remove(3)
    if 2 in a and 3 in a:
        a.remove(2)
    if 6 in a and 9 in a:
        a.remove(6)
    b = sorted(a, key=lambda x: needs[x])
    index = 0
    base = str(b[0]) * (n // needs[b[0]])
    n %= needs[b[0]]
    while n > 0:
        use = [_b for _b in b if needs[_b] <= needs[b[0]] + n]
        if max(use) == b[0]:
            tmp_n = use[-1]
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:-tmp_c] + str(tmp_n) * tmp_c
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
        else:
            return base
            tmp_n = max(use)
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:index] + str(tmp_n) * tmp_c + base[index + tmp_c:]
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
            index += tmp_c
    return base


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))


### FIXED CODE ###

def solve(string):
    n, m, *a = map(int, string.split())
    needs = {i + 1: n for i, n in enumerate(map(int, "2 5 5 4 5 6 3 7 6".split()))}
    if 2 in a and 5 in a:
        a.remove(2)
    if 3 in a and 5 in a:
        a.remove(3)
    if 2 in a and 3 in a:
        a.remove(2)
    if 6 in a and 9 in a:
        a.remove(6)
    b = sorted(a, key=lambda x: needs[x])
    index = 0
    base = str(b[0]) * (n // needs[b[0]])
    n %= needs[b[0]]
    while n > 0:
        use = [_b for _b in b if needs[_b] <= needs[b[0]] + n]
        if len(use) == 1:
            base = base[:-1]
            n += needs[b[0]]
        elif max(use) == b[0]:
            tmp_n = use[-1]
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:-tmp_c] + str(tmp_n) * tmp_c
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
        else:
            tmp_n = max(use)
            tmp_c = n // (needs[tmp_n] - needs[b[0]])
            base = base[:index] + str(tmp_n) * tmp_c + base[index + tmp_c:]
            n -= (needs[tmp_n] - needs[b[0]]) * tmp_c
            index += tmp_c
    return base


if __name__ == '__main__':
    print(solve('\n'.join([input(), input()])))
N = int(input())
nums = list(map(int, input().split()))
counts = [0 for _ in range(N+1)]
for num in nums:
  counts[num] += 1
combination = 0
for count in counts:
  if count >= 2
    combination += (count*(count-1))//2
for i in range(1, N+1):
  print(combination-counts[i]+1)


### FIXED CODE ###

N = int(input())
nums = list(map(int, input().split()))
counts = [0 for _ in range(N+1)]
for num in nums:
  counts[num] += 1
combination = 0
for count in counts:
  if count >= 2:
    combination += (count*(count-1))//2
for num in nums:
  print(combination-counts[num]+1)
a, b = map(int, input().split())
if (a+b)% == 0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')


### FIXED CODE ###

a, b = map(int, input().split())
if (a+b)%2 == 0:
  print((a+b)//2)
else:
  print('IMPOSSIBLE')
N = int(input())
num = list(N)
s = 0
for i in range(len(num)):
  s += num[i]
if N % s == 0:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

N = input()
num = list(N)
s = 0
for i in range(len(num)):
  s += int(num[i])
if int(N) % s == 0:
  print("Yes")
else:
  print("No")
import sys
import numpy as np
if __name__ == '__main__':
    NX = [int(n) for n in input().split()]
    X = [int(n) for n in input().split()]
    if len(X) == 1:
        print(abs(X-NX[1]))
        sys.exit(0)

    X.sort()
    diff = [X[i] - X[i-1] for i in range(1, len(X))]
    D = min(diff)
    while any(np.array(diff)%D):
        D -= 1
    print(D)

### FIXED CODE ###

import sys
import functools
import fractions

if __name__ == '__main__':
    NX = [int(n) for n in input().split()]
    X = [int(n) for n in input().split()]
    if len(X) == 1:
        print(abs(X[0]-NX[1]))
        sys.exit(0)

    X.append(NX[1])
    X.sort()
    diff = [X[i] - X[i-1] for i in range(1, len(X))]
    D = functools.reduce(fractions.gcd, diff)
    print(D)
    # D = min(diff)
    # while any(np.array(diff)%D):
    #     D -= 1
    # print(D)