Harryxun/stf_run huggingface dataset:
class BITmax:
    def __init__(self, N, init=0):
        self.init = init
        self.tree = [self.init] * (N+1)
    
    def set(self, x, value):
        while x < N + 1:
            old = self.tree[x]
            if value <= old:
                break
            self.tree[x] = value
            x += x & -x
    
    def find_max_to(self, x):
        result = self.init
        while x > 0:
            result = max(result, self.tree[x])
            x -= x & -x
        return result

def main():
    N = int(input())
    dpt = BITmax(N)

    h_list = list(map(int, input().split()))
    b_list = list(map(int, input().split()))

    for h, b in zip(h_list, b_list):
        dpt.set(h, dpt.find_max_to(h-1) + b)

    print(max(dpt.tree))

if __name__ == '__main__':
    main()


### FIXED CODE ###

class BITmax:
    def __init__(self, N, init=0):
        self.init = init
        self.tree = [self.init] * (N+1)
    
    def set(self, x, value):
        while x < N + 1:
            old = self.tree[x]
            if value <= old:
                break
            self.tree[x] = value
            x += x & -x
    
    def find_max_to(self, x):
        result = self.init
        while x > 0:
            result = max(result, self.tree[x])
            x -= x & -x
        return result

N = int(input())
dpt = BITmax(N)

h_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))

for h, b in zip(h_list, b_list):
    dpt.set(h, dpt.find_max_to(h-1) + b)

print(max(dpt.tree))
from collections import deque

def isCLKWISE(ph):
    return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P):
    P = sorted(P)
    phU = [P[0],P[1]]
    for p in P[2:]:
        phU.append(p)
        while(True):
            if isCLKWISE(phU) : break
            else :
                del phU[-2]
                if len(phU) == 2 : break
    phL = [P[-1],P[-2]]
    for p in P[-3::-1]:
        phL.append(p)
        while(True):
            if isCLKWISE(phL) : break
            else :
                del phL[-2]
                if len(phL) == 2 : break
    ph = phU + phL[1:-1]
    return ph
  
n = range(int(input()))
P = []
for i in n : P.append([int(x) for x in input().split()])
Q = deque(ConvexHullScan(P))
Q.reverse()
print(len(Q))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(Q)])[2]
R = Q.rotate(idx)
for r in R : print(r[0],r[1])

### FIXED CODE ###

def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
      
def ConvexHullScan(P):
    P = sorted(P)
    phU = [P[0],P[1]]
    for p in P[2:]:
        phU.append(p)
        while(True):
            try :
                if isCLKWISE(phU) : break
                else : del phU[-2]
            except IndexError : break
    phL = [P[-1],P[-2]]
    for p in P[-3::-1]:
        phL.append(p)
        while(True):
            try :
                if isCLKWISE(phL) : break
                else : del phL[-2]
            except IndexError : break
    ph = phU + phL[1:-1]
    return ph
  
P = [[int(x) for x in input().split()] for _ in range(int(input()))]
P = ConvexHullScan(P)
P.reverse()
print(len(P))
idx = min([[x[1][1],x[1][0],x[0]] for x in enumerate(P)])[2]
for p in P[idx:] + P[:idx] : print(p[0],p[1])
from goto import goto, label

S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    for j in range(i+1, R+1, 1):
        mod = (i*j) % 2019
        if mod < min:
            min = mod

print(min)


### FIXED CODE ###


S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    if flg ==0:
        for j in range(i+1, R+1, 1):
            mod = (i*j) % 2019
            if mod < min:
                min = mod
                if min == 0:
                    flg = 1
                    break
    else:
        break

print(min)
n=int(input())
a=[int(input()) for _ in range(n)]

if a.count(0)==0:
    print(sum(a//2))
else:
    tmp_sum=0
    ans=0
    for i in range(n):
        if a[i]==0:
            ans+=tmp_sum//2
            tmp_sum=0
        else:
            tmp_sum+=a[i]
    ans+=tmp_sum//2

    print(ans)



### FIXED CODE ###

n=int(input())
a=[int(input()) for _ in range(n)]

if a.count(0)==0:
    print(sum(a)//2)
else:
    tmp_sum=0
    ans=0
    for i in range(n):
        if a[i]==0:
            ans+=tmp_sum//2
            tmp_sum=0
        else:
            tmp_sum+=a[i]
    ans+=tmp_sum//2

    print(ans)
print(int(input())*int(input()))

### FIXED CODE ###

a,b = (input().split())
print(int(a)*int(b))
a=int(input())
b=int(input())
c=int(input())

print((a+b)*h/2)

### FIXED CODE ###

a=int(input())
b=int(input())
h=int(input())
print(int((a+b)*h/2))
n = int(input())
a = list(map(int,input().split()))
ans = 0
for v in a:
    while a%2 is 0:
        ans += 1
        a /= 2
print(ans)

### FIXED CODE ###

#!/usr/bin/env python
N = int(input())
A = [int(i) for i in input().split()]
ans = 0
for a in A:
    while a % 2 != 1:
        ans += 1
        a /= 2
print(ans)
N, M = map(int, input().split())
ABs = [input().split() for i in range(M)]
 
 
MPs = {}
for a, b in ABs:
    a = int(a)
    b = int(b)
    if a not in MPs:
        MPs[a] = 1
    else:
        MPs[a] += 1
    if b not in MPs:
        MPs[b] = 1
    else:
        MPs[b] += 1
 
for mp in range(1, N+1):
    if mp not in MPs:
        MPs[mp] = '0'
 
for y in sorted(MPs.values()):
    print(y)

### FIXED CODE ###

from collections import defaultdict
N, M = map(int, input().split())
city_road_nums = defaultdict(int)

for _ in range(M):
    a, b = map(int, input().split())
    city_road_nums[a] += 1
    city_road_nums[b] += 1

for i in range(1, N+1):
    print(city_road_nums[i])
N, M = map(int, input().split())
A = sorted(map(int, input().split()))
C = []
for _ in range(M):
  C.append([int(i) for i in input().split()])
C.sort(key=lambda x: -x[1])
cur = 0
ans = 0
for a in A:
  if C[cur][0] == 0:
    cur += 1
  if cur == len(C):
    ans += a
    continue
  if a < C[cur][1]:
    ans += C[cur][1]
    C[cur][0] -= 1
  else:
    ans += a
print(ans)

### FIXED CODE ###

N, M = map(int, input().split())
A = sorted(map(int, input().split()))
C = []
for _ in range(M):
  C.append([int(i) for i in input().split()])
C.sort(key=lambda x: -x[1])
cur = 0
ans = 0
for a in A:
  if cur != len(C) and C[cur][0] == 0:
    cur += 1
  if cur != len(C) and a < C[cur][1]:
    ans += C[cur][1]
    C[cur][0] -= 1
  else:
    ans += a
print(ans)
n = int(input())
nums = list(map(int,input().split()))
ans = 1

if nums[1] >= nums[0]:
    flag = 1
else:
    flag = 2

i = 1
while i < n:
    if flag == 0:
        if nums[i] > nums[i-1]:
            flag = 1
            ans += 1
        else:
            flag = 2
            ans += 1

    elif flag == 1:
        if nums[i] < nums[i-1]:
            flag = 0
            if i == n-1:
                ans += 1
    elif flag == 2:
        if nums[i] > nums[i-1]:
            flag = 0
            if i == n-1:
                ans += 1

    i += 1

print(ans)

### FIXED CODE ###

n = int(input())
nums = list(map(int,input().split()))
ans = 0
i = 0

while i < n:
    j, k = i, i
    while j < n - 1 and nums[j] <= nums[j+1]:
        j += 1
    while k < n - 1 and nums[k] >= nums[k+1]:
        k += 1
    i = max(j , k) + 1
    ans += 1
print(ans)
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
ls =[]
count = 0
for i in range(len(S)):
    
    if S[i] == 'A' or 'T' or 'C' or'G':
        count += 1
    else:
        ls.append(count)
        count = 0

print(max(ls))



### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
S = list(input())
clst=[]
count = 0
for s in S:
    if s == 'A' or s == 'T' or s =='C' or s == 'G':
        count += 1
        clst.append(count)
    else:
        
        count = 0
        clst.append(count)
print(max(clst))
def gcd(a, b):
    return gcd(b, a % b) if b > 0 else a


n, k = map(int, input().split())
a = list(map(int, input().split())
        
m = max(a)
         
g = a[0]
         
for i in range(n):
    g = gcd(g, a[i])

if k > m:
    print("IMPOSSIBLE")
elif k % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")



### FIXED CODE ###

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


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

m = max(a)

g = a[0]

for i in range(n):
    g = gcd(g, a[i])

if k > m:
    print("IMPOSSIBLE")
elif k % g == 0:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
from operator import itemgetter

n, m  = map(int, input().split())
a = list(map(int, input().split()))
bc = [list(map(int, input().split())) for i in range(m)]
a.sort()
bc.sort(reverse=True, key=itemgetter(1))

j = 0
for i in range(m):
  k = 0
  while k<bc[i][0] and a[k+j]<bc[i][1] and k+j<n:
    a[k+j] = bc[i][1]
    k += 1
  j += k
  if j == n:
    break
    
print(sum(a))

### FIXED CODE ###

n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
cb=[]
for i in range(m):
    b, c = map(int, input().split())
    cb.append([c,b])
cb.sort(reverse=True)
k=0
for i in range(m):
    j=0
    while j<cb[i][1] and k+j<n and a[k+j]<cb[i][0]:
        a[k+j] = cb[i][0]
        j+=1
    k+=j
    if k==n:
        break
print(sum(a))
N,K=map(int, input().split())

t = 0
import math
for x in range(1, min(N,K-1)+1):
    t += (1-pow(0.5, math.ceil(math.log2(K/x))))

print(1 - t / N)

### FIXED CODE ###

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

t = 0
import math
for x in range(1, min(N,K-1)+1):
    t += (1-pow(0.5, math.ceil(math.log2(K/x))))

print(1 - t / N)
n = int(input())
a = list(map(int,input().split()))

from math import gcd
l,r = [0]*(n+1),[0]*(n+1)
for i in range(n):
    l[i+1] = gcd(l[i],a[i])
    r[n-i-1] = gcd(r[i+1],a[n-i-1])

ans = 1
for i in range(n):
    g = gcd(l[i],r[i+1])
    ans = max(ans,g)
print(ans)

### FIXED CODE ###

import fractions
n = int(input())
a = list(map(int,input().split()))
ans = 0
l = [0]*(n+1)
r = [0]*(n+1)
for i in range(n):
    l[i+1] =  fractions.gcd(l[i],a[i])
for i in range(n-1,0,-1):
    r[i] =  fractions.gcd(r[i+1],a[i])
for i in range(n):
    L = l[i]
    R = r[i+1]
    ans = max(ans,fractions.gcd(L,R))
print(ans)
A, B, N = [int(x) for x in input().split()]
array = list(range(A, B+1))

array = list(filter(lambda x: B-(N-1) <= x or x <= A+(N-1), array))

print('\n'.join([str(x) for x in array]))


### FIXED CODE ###

def main():
  A, B, K = [int(x) for x in input().split()]
  for i in range(A, min(B + 1, A + K)):
    print(i)
  for i in range(max(A + K, B - K + 1), B + 1):
    print(i)


if __name__ == "__main__":
  main()
from math import gcd

N, M = map(int, input().split())
A = [int(i) // 2 for i in input().split()]  

A_lcm = 1
for i in range(N):
    A_lcm *= A[i] // gcd(A_lcm, A[i])
    
for i in A:
    if A_lcm // i % 2 == 0:
        print(0)
        exit()

print((M // A_lcm + 1) // 2)

### FIXED CODE ###

from fractions import gcd

N, M = map(int, input().split())
A = [int(i) // 2 for i in input().split()]  

A_lcm = 1
for i in range(N):
    A_lcm *= A[i] // gcd(A_lcm, A[i])
    
for i in A:
    if A_lcm // i % 2 == 0:
        print(0)
        exit()

print((M // A_lcm + 1) // 2)
import numpy as np

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

b = np.tile(a,N).reshape(N,-1).astype('float128')
c = np.tril(b * b.T, k=-1)
d = c + np.tri(N).T * np.max(c)

print(d)
print(int(sorted(d.flatten())[K-1]))

### FIXED CODE ###

import numpy as np
N,K = map(int,input().split())
a = np.array(input().split(),np.int64)
a = np.sort(a)
zero = a[a==0]
pos = a[a>0]
neg = a[a<0]

def f(x):
    count = 0
    c = x // pos
    count += np.searchsorted(a, c, side='right').sum()
    count += N*len(zero) if x >= 0 else 0
    c = -(-x // neg)
    count += (N - np.searchsorted(a, c, side='left')).sum()
    count -= a[a*a <= x].size
    count //= 2
    return count

right = 10**18
left = -10**18
while right-left>1:
    mid = (right + left)//2
    if f(mid)<K:
        left = mid
    else:
        right = mid
        
print(right)
import math

x = int(input())
a = []
for i in range(1,x):
  for j in range(2,10):
    if math.log(i,j).is_integer() == True:
      a.append(i)
print(max(a))

### FIXED CODE ###

x = int(input())
a = []
for i in range(1,32):
  for j in range(2,9):
    if i ** j <= x:
      a.append(i**j)
print(max(a))
n = int(input())
m = 2
z = 0

for i in range(n-2):
    def factorization(n):
        arr = []
        temp = n
        for i in range(2, int(-(-n**0.5//1))+1):
            if temp%i==0:
                cnt=0
                while temp%i==0:
                    cnt+=1
                    temp //= i
                arr.append([i, cnt])

        if temp!=1:
            arr.append([temp, 1])

        if arr==[]:
            arr.append([m, 1])

        return arr

    x = 0
    y = 1

    r = factorization(m)
    l = len(r)

    for i in range(l):
        y = y * (r[x][1]+1)
        x+=1


    m+=1
    z = z + y

print(z+1)

### FIXED CODE ###

s = input()
l = len(s)
x = s[l-1]
if x == "s":
    print(s + "es")
else:
    print(s + "s")
#122 C
from itertools import accumulate
N,Q= map(int,input().split())
S=input()
ans=[0]*(N)

for i,s in enumerate(list(accumulate(S))):
    ans[i]=s.count('AC')
ans
for i in range(Q):
    L1,L2= map(int,input().split())
    print(ans[L2-1]-ans[L1-1])


### FIXED CODE ###

#122 C
N,Q= map(int,input().split())
S=input()
ans=[0]*(N+1)

for i in range(2,N+1):
    ans[i]=ans[i-1]
    if S[i-2:i]=='AC':
        ans[i]+=1
    
for i in range(Q):
    l,r=map(int,input().split())
    print(ans[r]-ans[l])
n = int(input())

for i in range(1, n//4+1):
    for j in range(1, n//7+1):
        if i*4 + j*7 == n:
            print("Yes")
            break
        elif i == n//4 and j == n//7:
            print("No")
            break
    else:
        continue
    break

### FIXED CODE ###

n,k = map(int,input().split())
if n%k>0:
  print(1)
elif n%k==0:
  print(0)
S=[]
T=[]
S_num=int(input())
S=input().split()
T_num=int(input())
T=input().split()
cnt=0

for i in T:
	print(i)
	right=S_num-1
	left=0
	center=int((right+left)/2)
	while left<=center and right>=center:
		if S[center]==T[i]:
			cnt+=1
			break
		elif S[center]>i:
			right=center-1
			center=int((left+right)/2)
		elif S[center]<i:
			left=center+1
			center=int((left+right)/2)
print(cnt)


### FIXED CODE ###

s = int(input())
S = list(map(int, input().split()))
t= int(input())
T = list(map(int, input().split()))
cnt = 0
for i in T:
	a=0
	b=s-1
	while b >= a:
		mid=int((a+b)/2)
		if S[mid]==i:
			cnt+= 1
			break
		elif S[mid]>i:
			b=mid-1
			continue
		else:
			a=mid+1
			continue
print(cnt)
from heapq import heappush, heappop
from collections import defauldict
n,m = map(int,input().split())
a = list(map(int,input().split()))
# edg = [[] for i in range(n)]
rank = [1] * n
par = [i for i in range(n)]
def root(x):
  if x == par[x]:
    return x
  par[x] = root(par[x])
  return par[x]
def union(a,b):
  a = root(a)
  b = root(b)
  if rank[a] < rank[b]:a,b = b,a
  if a == b: return False
  par[b] = a
  rank[a] += rank[b]
  return True
for _ in range(n):
  a,b = map(int,input().split())
  union(a,b)
d = defaultdict(list)
for i in range(n):
  ai = a[i]
  i = root(i)
  heappush(d[i],ai)

ans = 0
forest = []
for i in set(par):
  p = heappop(d[i])
  heappush(forest,(p,i))

for i in range(len(set(par))-1):
  p1,i1 = heappop(forest)
  p2,i2 = heappop(forest)
  ans += p1 + p2
  if d[i1]:
    heappush(forest,(heappop(d[i1]),i1))
  if d[i2]:
    heappush(forest,(heappop(d[i2]),i2))
  if len(forest) < 2:
    ans = "Impossible"
    break
print(ans)

### FIXED CODE ###

from heapq import heappush, heappop
from collections import defaultdict
n,m = map(int,input().split())
a = list(map(int,input().split()))
# edg = [[] for i in range(n)]
rank = [1] * n
par = [i for i in range(n)]
def root(x):
  if x == par[x]:
    return x
  par[x] = root(par[x])
  return par[x]
def union(a,b):
  a = root(a)
  b = root(b)
  if rank[a] < rank[b]:a,b = b,a
  if a == b: return False
  par[b] = a
  rank[a] += rank[b]
  return True
for _ in range(m):
  x,y = map(int, input().split())
  union(x,y)
d = defaultdict(list)
q = []
for i in range(n):
  ai = a[i]
  heappush(q,(ai,i))
  ri = root(i)
  heappush(d[ri],(ai,i))
if len(d.keys()) == 1:
  print(0)
else:
  ans = 0
  tmp = 0
  c = [0] * n

  for i in d.keys():
    tmp += 1
    t,p = heappop(d[i])
    c[p] = 1
    ans += t
  if 2*tmp-2 > n:
    print("Impossible")
  else:
    for _ in range(tmp-2):
      p,i = heappop(q)
      while c[i]:
        p,i = heappop(q)
      ans += p
    print(ans)
n, k = map(int, input().split())
a_l = list(map(int, input().split()))
           
import sys
def g():
    m_l = [0] * (n+1)

    r = 0
    for a in a_l:
        if m_l[a] == 0: r += 1
        m_l[a] += 1

    if r <= k:
        print(0)
        sys.exit(0)

    mn = 0
    
    while True:
        mm = min(i for i in m_l if i > 0)

        for i in range(n+1):
            if mm == m_l[i]:
                mn += mm
                r -= 1
                m_l[i] = 0

                if r <= k: return mn
        
print(g())


### FIXED CODE ###

n, k = map(int, input().split())
a_l = list(map(int, input().split()))
           
import sys
import numpy as np

def g():
    m_l = np.array([0]*(n+1))

    r = 0
    for a in a_l:
        if m_l[a] == 0: r += 1
        m_l[a] += 1

    if r <= k:
        print(0)
        sys.exit(0)

    mn = 0
    while True:
        ma = np.ma.masked_equal(m_l, 0, copy=False)
        a = np.where(m_l == ma.min())[0]

        for i in a:
            mn += m_l[i]
            r -= 1
            m_l[i] = 0

            if r <= k: return mn
        
print(g())
import math
from decimal import Decimal
from sys import stdin


def get_result(data):
    A, B, C = data
    r_a = Decimal(A**0.5)
    r_b = Decimal(B**0.5)
    r_c = Decimal(C**0.5)
    return 'Yes' if r_a + r_b < r_c 'No'


if __name__ == '__main__':
    data = stdin.readline().rstrip().split(' ')
    data = list(map(int, data))
    result = get_result(data)
    print(result)

### FIXED CODE ###

from decimal import Decimal
from sys import stdin
 
 
def get_result(data):
    A, B, C = data
    r_a = Decimal(A**Decimal(0.5))
    r_b = Decimal(B**Decimal(0.5))
    r_c = Decimal(C**Decimal(0.5))
    return 'Yes' if r_a + r_b < r_c else 'No'
 
 
if __name__ == '__main__':
    data = stdin.readline().rstrip().split(' ')
    data = list(map(int, data))
    result = get_result(data)
    print(result)
from sys import exit
import copy
# import numpy as np
from collections import deque

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

cnt=0

a_sum=[0]
b_sum=[0]

a.insert(0, 0)
b.insert(0, 0)


for i in range(1, n+1):
    a_sum[i] += a_sum[i-1]

for i in range(1, m+1):
    b_sum[i] += b_sum[i-1]


for i in range(n+1):
    for j in range(m+1):
        if a_sum[i] + b_sum[j] <= k:
            pass
        else:
            if a_sum[i] + b_sum[j-1] <= k:
                cnt=max(cnt, i + j - 1)
            break
    else:
        if a_sum[i] + b_sum[j] <= k:
            cnt=max(cnt, i + j)
print(cnt)


### FIXED CODE ###

from sys import exit
import copy
# import numpy as np
from collections import deque

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

cnt = 0


a.insert(0, 0)
b.insert(0, 0)


for i in range(1, n+1):
    a[i] += a[i-1]

for i in range(1, m+1):
    b[i] += b[i-1]

tmp = m
for i in range(n+1):
    for j in range(tmp, -1, -1):
        if a[i] + b[j] <= k:
            cnt = max(cnt, i + j)
            tmp = j
            break


print(cnt)
H,W = map(int,input().split())
L = []
for i in range(H):
    l = list(input())
    L.append(l)

def judge(list,i,j):
    if i != 0:
        top = list[i-1][j]
    else:
        top = "."
    if j != 0:
        left = list[i][j-1]
    else:
        left = "."
    if i != W-1:
        bottom = list[i+1][j]
    else:
        bottom = "."
    if j != H-1:
        right = list[i][j+1]
    else:
        right = "."
    return top == "#" or left == "#" or bottom == "#" or right == "#"

for i in range(W):
    for j in range(H):
        if L[i][i] == "#" and judge(L,i,j) is False:
            print("No")
            exit()
print("Yes")

### FIXED CODE ###

H,W = map(int,input().split())
L = []
for i in range(H):
    l = list(input())
    L.append(l)

def judge(list,i,j):
    if i != 0:
        top = list[i-1][j]
    else:
        top = "."
    if j != 0:
        left = list[i][j-1]
    else:
        left = "."
    if i != H-1:
        bottom = list[i+1][j]
    else:
        bottom = "."
    if j != W-1:
        right = list[i][j+1]
    else:
        right = "."
    return top == "#" or left == "#" or bottom == "#" or right == "#"

for i in range(H):
    for j in range(W):
        if L[i][j] == "#" and judge(L,i,j) is False:
            print("No")
            exit()
print("Yes")
def gcd(a, b):
    if a > b:
        a, b = b, a
    if b % a == 0:
        return a
    a, b = b / a, a


def reduce(f, l):
    if len(l) == 1:
        return l[0]
    c = l[0]
    for i in l[1:]:
        c = f(c, i)
    return c


X = int(input().split()[1])
x = [abs(int(x) - X) for x in input().split()]

print(reduce(gcd, x))


### FIXED CODE ###

from functools import reduce
from fractions import gcd

X = int(input().split()[1])
x = [abs(int(x) - X) for x in input().split()]

print(reduce(gcd, x))
r = int(input())

a = 3.14159265359*r*r
c = 2*3.14159265359*r

print("%.6f %.6f" % (a, c))

### FIXED CODE ###

r = input()
r = float(r)

a = 3.14159265359*r*r
c = 2*3.14159265359*r

print("%.6f %.6f" % (a, c))
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k= map(int, input().split())
for i in range(1,k+1):
	t = combinations_count(n-k+1, i) *  combinations_count(k-1, k-i)
	s = t%1000000007
	print(s)

### FIXED CODE ###

import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k= map(int, input().split())
for i in range(1,k+1):
	if n-k+1>=i:
		t = combinations_count(n-k+1, i) *  combinations_count(k-1, k-i)
		s = t%1000000007
		print(s)
	else:
		print(0)
import math
N, D = int(input())
person = math.cell(N / (D*2+1))
print(person)

### FIXED CODE ###

N,D = map(int,input().split())
if N % (D*2+1) != 0:
  p = N // (D*2+1) + 1
else:
  p = N // (D*2+1)
  
print(p)
n, m, k = map(int, input().split())
a = list(map(int, input().split())) + [10 ** 10]
b = list(map(int, input().split())) + [10 ** 10]


def dfs(ai, bi, time, finished=False):
    if finished:
        return ai + bi
    
    if ai == n-1 and bi == n-1:
        return ai + bi
    
    if time >= a[ai]:
        ret1 = dfs(ai + 1, bi, time - a[ai])
    else:
        ret1 = dfs(ai, bi, time, finished=True)

    if time >= b[bi]:
        ret2 = dfs(ai, bi + 1, time - b[bi])
    else:
        ret2 = dfs(ai, bi, time, finished=True)

    return max(ret1, ret2)


print(dfs(0, 0, k))


### FIXED CODE ###

from bisect import bisect_right
n, m, k = map(int, input().split())
a = [0] + list(map(int, input().split()))
b = [0] + list(map(int, input().split()))

for i in range(m):
    b[i+1] += b[i]


def f(time, r):
    ret = bisect_right(r, time) - 1
    return ret


def fa(time):
    return f(time, a)


def fb(time):
    return f(time, b)

ans = 0

for i, ai in enumerate(a):
    k -= ai
    if k < 0:
        break
    ans = max(ans, i + fb(k))

print(ans)
S = input().replace("/", "")
print("Heisei" if S <= 20190430 else "TBD")

### FIXED CODE ###

S = int(input().replace("/", ""))
print("Heisei" if S <= 20190430 else "TBD")
import math

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn = sorted(xn + [x])
gcd = xn[1] - xn[0]
b = xn[1]
for a in xn[2:]:
    gcd = math.gcd(b - a, gcd)
    b = a
print(gcd)

### FIXED CODE ###

import fractions
from functools import reduce
import numpy as np

[n, x] = list(map(int, input().split()))
xn = list(map(int, input().split()))

xn += [x]
xn = np.abs(np.diff(xn))
print(reduce(fractions.gcd, xn))