Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip()

n = int(input())
a = [int(x) for x in input().split()]
a_set = set(a)
#約数の列挙
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()
    return divisors
from collections import Counter
c = Counter(a)
cnt = 0
for i in a:
    prime = make_divisors(i)
    flag = 1
    if c[i] > 1:
        continue
    for j in prime:
        if j == i:
            continue
        if j in a_set:
            flag = 0
            break
    if flag:
        cnt += 1
print(cnt)

### FIXED CODE ###

import sys
input = lambda: sys.stdin.readline().rstrip()

n = int(input())
a = [int(x) for x in input().split()]
a.sort()
max_a = a[-1]
is_True = [1]*(max_a + 1)
for i in a:
    if is_True[i]:
        for j in range(2*i, max_a + 1, i):
            is_True[j] = False
cnt = 0
from collections import Counter
c = Counter(a)
for i in a:
    if is_True[i] and c[i] == 1:
        cnt += 1
print(cnt)
### BUGGY CODE ###

def query1(string):
    return string[::-1]

def query2(F, C, string):
    if F == '1':
        return C + string
    elif F == '2':
        return string + C

S = input()
Q = int(input())
for i in range(Q):
    Query = input().split()
    if len(Query) == 1:
        S = query1(S)
    else:
        S = query2(Query[1], Query[2], S)

print(S)

### FIXED CODE ###

start = []
end = []

def query1(b):
    return not b

def query2(F, C, string, b):
    if (F == '1' and b) or (F == '2' and not b):
        start.append(C)
        return C + string
    else:
        end.append(C)

S = input()
Q = int(input())
direction = True

for i in range(Q):
    Query = input().split()
    if len(Query) == 1:
        direction = query1(direction)
    else:
        query2(Query[1], Query[2], S, direction)

if direction:
    print(''.join(start[::-1]) + S + ''.join(end))
else:
    print(''.join(end[::-1]) + S[::-1] + ''.join(start))
### BUGGY CODE ###

#セグメント木のverify

class SegTree():
    def __init__(self, lists, function, basement):
        self.n = len(lists)
        self.K = (self.n-1).bit_length()
        self.func = function
        self.basement = basement
        self.seg = [basement]*2**(self.K+1)

        for i in range(self.n):
            self.seg[i+2**self.K-1] = lists[i]

        for i in range(2**(self.K)-2, -1, -1):
            self.seg[i] = self.func(self.seg[2*i+1], self.seg[2*i+2])

    def update(self, k, value):
        # 0-indexでa[k]の値をvalueに変更
        k += 2**self.K-1
        self.seg[k] = value
        while k:
            k = (k-1)//2
            self.seg[k] = self.func(self.seg[k*2+1], self.seg[k*2+2])

    def query(self, p, q):
        # 0-indexで[p,q)の値を取得する
        if q <= p:
            return self.basement
        num = 2**self.K
        p += num-1
        q += num-2
        res = self.basement
        while q-p > 1:
            if p & 1 == 0:
                res = self.func(res, self.seg[p])
            if q & 1 == 1:
                res = self.func(res, self.seg[q])
                q -= 1
            p = p//2
            q = (q-1)//2
        if p == q:
            res = self.func(res, self.seg[p])
        else:
            res = self.func(self.func(res, self.seg[p]), self.seg[q])
        return res

import sys
input=sys.stdin.readline
N=int(input())
S=list(input())
Q=int(input())
que=[tuple(input().split()) for i in range(Q)]
alpha="abcdefghijklmnopqrstuvwxyz"
Data={alpha[i]:[0]*N for i in range(26)}
for i in range(N):
    Data[S[i]][i]+=1
SEG={alpha[i]:SegTree(Data[alpha[i]],max,0) for i in range(26)}
for X,u,v in que:
    if X=="1":
        u=int(u)-1
        NOW=S[u]
        S[u]=v
        SEG[NOW].update(u,0)
        SEG[v].update(u,1)
    else:
        u,v=int(u)-1,int(v)-1
        res=0
        for j in range(26):
            res+=SEG[alpha[j]].query(u,v+1)
        print(res)
            
        
    
    

### FIXED CODE ###

#segtree ライブラリ
#BITライブラリの作成
#リストの要素を1,0で長さをｎとした時に使える
class BIT:
    def __init__(self,n):
        self.n=n
        self.data=[0]*(n+1)
    def to_sum(self,i):
        s=0     
        while i>0:
            s+=self.data[i]
            i-=(i& -i)
        return s
    def add(self,i,x):
        while i<=self.n:
            self.data[i]+=x
            i+=(i & -i)
    def get(self,i,j):
        return self.to_sum(j)-self.to_sum(i-1)
n=int(input())
s=list(input())
q=int(input())
que=[]

for i in range(q):
    p=list(input().split())
    que.append(p)
alpha="abcdefghijklmnopqrstuvwxyz"
segtree={alpha[i]:BIT(n) for i in range(26)}  
for i in range(n):
    segtree[s[i]].add(i+1,1)
for q in que:
    x,y,z=q[0],q[1],q[2]
    if int(x)==1:
        #y文字目をzに変更する
        y=int(y)  
        for i in range(26):
            if segtree[alpha[i]].get(y,y)==1:
                segtree[alpha[i]].add(y,-1)
                break
        segtree[z].add(y,1)
    else:
        ans=0
        for i in range(26):
            if segtree[alpha[i]].get(int(y),int(z))>0:
                ans+=1
        print(ans)
### BUGGY CODE ###

def resolve():
    import sys
    input=sys.stdin.readline
    N = int(input().rstrip())
    S = input().rstrip()

    def z_algo(s):
        """
        param s:str
        return list of int with length len(s)
        """
        # initialization
        n=len(s)
        z=[0]*n
        z[0]=n
        # construct
        L,R=0,0
        for i in range(1,n):
            if i>R: # 過去の結果が全く使えない
                L=R=i
                while(R<n and s[R-L]==s[R]): R+=1
                z[i]=R-L
                R-=1 # 0-indexedでiと比較するため
            elif z[i-L]<R-i+1:
                z[i]=z[i-L]
            else:
                L=i
                R+=1 # Rまでは確定しているので、R+1から確認
                while(R<n and s[R-L]==s[R]): R+=1
                z[i]=R-L
                R-=1
        return z

    ans = 0
    #for i in range(N-1):
    #    z = z_algo(S[i:])
    #    z = z[(len(z)+1)//2:]
    #    max_z = max(z)
    #    ans = max(ans, max_z)
    for i in range(N-1):
        z = z_algo(S[i:])
        for j in range(len(z)):
            ans=max(ans,min(j,z[j]))
    print(ans)

resolve()

### FIXED CODE ###

def resolve():
    import sys
    input=sys.stdin.readline
    N = int(input().rstrip())
    S = input().rstrip()

    def z_algo(s):
        """
        param s:str
        return list of int with length len(s)
        """
        # initialization
        n=len(s)
        z=[0]*n
        z[0]=n
        # construct
        L,R=0,0
        for i in range(1,n):
            if i>R: # 過去の結果が全く使えない
                L=R=i
                while(R<n and s[R-L]==s[R]): R+=1
                z[i]=R-L
                R-=1 # 0-indexedでiと比較するため
            elif z[i-L]<R-i+1:
                z[i]=z[i-L]
            else:
                L=i
                R+=1 # Rまでは確定しているので、R+1から確認
                while(R<n and s[R-L]==s[R]): R+=1
                z[i]=R-L
                R-=1
        return z

    ans = 0
    for i in range(N-1):
        z = z_algo(S[i:])
        for j, _z in enumerate(z):
            ans=max(ans,min(j,z[j]))
    print(ans)

resolve()
### BUGGY CODE ###

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

is_prime = [True] * (10**6 + 1)
pre_a = 0
for a in A:
    if a == pre_a:
        is_prime[a] = False
    j = 2 * a
    while j <= 10**6:
        is_prime[j] = False
        j += a
    
    pre_a = a

ans = 0
for a in A:
    if is_prime[a]:
        ans += 1

print(ans)

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
S = set(A)
M = max(A)
A.sort()

pre_a = 0
for a in A:
    if a == pre_a:
        S.discard(a)
    if a in S:
        j = a * 2
        while j <= M:
            S.discard(j)
            j += a
    pre_a = a

print(len(S))
### BUGGY CODE ###

x,y=map(int,input().split())
M=max([abs(x),abs(y)])
T=[-1 for i in range(2*M+1)]
T[M+x]=0
k=1
S=[set([M+x])]
#print(T)
while(T[M+y]==-1):
    S.append(set())
    for i in S[k-1]:
        if i!=2*M:
            T[i+1]=k
            S[k].add(i+1)
        T[2*M-i]=k
        S[k].add(2*M-i)
    k+=1
    #print(T)
print(k-1)


### FIXED CODE ###

x,y=map(int,input().split())
a=[0 for i in range(4)]
a[0]=y-x
a[1]=y+x+1
a[2]=-y-x+1
a[3]=-y+x+2
b=[]
for i in range(4):
    if a[i]>0:
        b.append(a[i])
print(min(b))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
r = []
tmp = [2 * k + 1 for k in range(n//2)]
c = 0
for j in range(n):
  if j in tmp:
    c -= a[j]
  else:
    c += a[j]
r.append(c)
for i in range(n-1):
  r.append((a[i] - r[i] // 2) * 2)
print(*r)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
r = []
c = 0
for j in range(n):
  if j % 2 == 1:
    c -= a[j]
  else:
    c += a[j]
r.append(c)
for i in range(n-1):
  r.append((a[i] - r[i] // 2) * 2)
print(*r)
### BUGGY CODE ###

def resolve():
    A, B, N = map(int, input().split())

    ans = 0
    for i in range(min(N, B), 1, -1):
        tmp = (A * i // B) - A * (i // B)
        ans = max(tmp, ans)

    print(ans)


resolve()

### FIXED CODE ###

def resolve():
    A, B, N = map(int, input().split())
    print(A * min(N, B - 1) // B)


resolve()
### BUGGY CODE ###

n=int(input())
s=list(map(int,input().split()))

for i in range(1,n+1):
  print(1+s.index(i),end=" ")

### FIXED CODE ###

n=int(input())
s=[ int(i) for i in  input().split()]
l=[0]*n

for i in range(n):
  l[s[i]-1]=str(i+1)
print(' '.join(l))
### BUGGY CODE ###

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


import random


def is_prime(q, k=50):
    q = abs(q)
    # 計算するまでもなく判定できるものははじく
    if q == 2:
        return True
    if q < 2 or q & 1 == 0:
        return False

    # n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q - 1) >> 1
    while d & 1 == 0:
        d >>= 1

    # 判定をk回繰り返す
    for i in range(k):
        a = random.randint(1, q - 1)
        t = d
        y = pow(a, t, q)
        #[0,s-1]の範囲すべてをチェック
        while t != q - 1 and y != 1 and y != q - 1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q - 1 and t & 1 == 0:
            return False
    return True


ans = 1
tmp = P
start = P // (2 ** N) + 1
# for i in range(start, 1, -1):
#     newtmp, rest = divmod(tmp, (i**N))
#     print(i, tmp, rest, ans)
#     if rest == 0:
#         ans = ans * i
#         tmp = newtmp

for i in range(2, P):
    if not is_prime(i):
        continue
    while True:
        rest = tmp % (i ** N)
        newtmp = tmp // (i ** N)
        # print(i, tmp, rest, ans)
        if rest == 0:
            ans = ans * i
            tmp = newtmp
        else:
            break
    if newtmp == 0:
        break

print(ans)


### FIXED CODE ###

N, P = list(map(int, input().split()))
if N == 1:
    print(P)
    exit()
elif P == 1:
    print("1")
    exit()

ans = 1
tmp = P

for i in range(2, int(pow(P, 1 / N)) + 1):
    po = pow(i, N)
    while tmp % po == 0:
        tmp = tmp // po
        ans = ans * i
        # print(i, tmp, ans)

    if tmp < po:
        break

print(ans)
### BUGGY CODE ###

from numba import njit
N = int(input())
a = list(map(int, input().split()))

@njit
def fnc(N,a):
    a.sort(reverse = True)
    p=0
    ppl = [a[0]]*2
    best_index = 1
    best_point = a[0]
    for i in a[1:]:
        p += best_point
        ppl = ppl[:best_index]+[i]+ppl[best_index:]
        #print(ppl)
        point_list = [min(ppl[i],ppl[i+1]) for i in range(0,len(ppl)-1)]
        #print(point_list)
        best_point = max(point_list)
        for j,q  in enumerate(point_list):
            if q == best_point:
                best_index = j+1
                continue
    return p     

print(fnc(N,a))

### FIXED CODE ###

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

a.sort(reverse = True)
p = a[0]
for i in range(N-2): #-1は上記a[0]分、もう-1は最初の要素挿入は加点されないため。
    p += a[(i//2)+1]

print(p)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(int(1e6))

N = int(input())

M_sum = 0
M_sum = sum(range(1, N))
M_sum += N % 1
print(M_sum)


### FIXED CODE ###

import sys
sys.setrecursionlimit(int(1e6))

N = int(input())

n = N - 1
if bool(n%2):
    ans = (n//2) * (n) + n
else:
    ans = (n//2) * (n+1)

print(ans)
### BUGGY CODE ###

a, b, c, d = [int(x) for x in input().split()]
dp = [[0 for i in range(d + 1)] for j in range(c + 1)]
for i in range(a+1):
    for j in range(b+1):
        dp[i][j]=1
for i in range(a, c + 1):
    for j in range(b, d + 1):
        if i == a and j == b:
            continue
        if i - 1 >= a:
            dp[i][j] += (dp[i - 1][j] * j)
        if j - 1 >= b:
            dp[i][j] += (dp[i][j - 1] * i)
        if (i - 1) >= a and (j - 1) >= b:
            dp[i][j] -= dp[i-1][j-1]*(i-1)*(j-1)
        dp[i][j] %= 998244353

print(dp[c][d])


### FIXED CODE ###

a, b, c, d = [int(x) for x in input().split()]
dp = [[0 for i in range(d + 1)] for j in range(c + 1)]
for i in range(a+1):
    for j in range(b+1):
        dp[i][j]=1
for i in range(a, c + 1):
    for j in range(b, d + 1):
        if i == a and j == b:
            continue
        if i - 1 >= a:
            dp[i][j] += (dp[i - 1][j] * j)
        if j - 1 >= b:
            dp[i][j] += (dp[i][j - 1] * i)
        if (i - 1) >= a and (j - 1) >= b:
            dp[i][j] -= dp[i-1][j-1]*(i-1)*(j-1)
        dp[i][j] %= 998244353

print(dp[c][d])
### BUGGY CODE ###

s=input()
n=len(s)

result = 0
  
for i in range(1,2019):
  c = len([x for x in range(n) if int(s[x:])%2019 == i])
  result += c*(c-1)/2

d = len([x for x in range(n) if int(s[x:])%2019 == 0])
result += d*(d+1)/2

print(int(result))

### FIXED CODE ###

s = input()[::-1]

dp = [0]*2019
dp[0]=1
total = 0
a = 1

for i in list(s):
  total += int(i)*a
  total %= 2019
  dp[total] += 1
  a *= 10
  a %= 2019
count=0
  
for i in range(2019):
    count += dp[i]*(dp[i]-1)//2
 
print(count)
### BUGGY CODE ###

N, C = map(int, input().split())
D = [list(map(int, input().split())) for _ in range(C)]
grid = [list(map(int, input().split())) for _ in range(N)]
grid1 = []
grid2 = []
grid3 = []
ans = float('inf')
for i in range(N):
    for k in range(N):
        tmp = grid[i][k]
        tmp2 = i + k
        if tmp2 % 3 == 1:
            grid1.append(tmp)
        elif tmp2 % 3 == 2:
            grid2.append(tmp)
        else:
            grid3.append(tmp)
for i in range(C):
    sum1 = sum(grid1)
    for ii in grid1:
        sum1 = sum1 - ii + D[ii-1][i]
    for k in range(C):
        if i == k:
            continue
        sum2 = sum(grid2)
        for kk in grid2:
            sum2 = sum2 - kk + D[kk-1][k]
        for l in range(C):
            if i == l or k == l:
                continue
            sum3 = sum(grid3)
            for ll in grid3:
                sum3 = sum3 - ll + D[ll-1][l]
            ans = min(ans,sum1+sum2+sum3)
print(ans)

### FIXED CODE ###

N, C = map(int, input().split())
D = [list(map(int, input().split())) for _ in range(C)]
grid = [list(map(int, input().split())) for _ in range(N)]
grid1 = []
grid2 = []
grid3 = []
ans = float('inf')
for i in range(N):
    for k in range(N):
        tmp = grid[i][k]
        tmp2 = i + k
        if tmp2 % 3 == 1:
            grid1.append(tmp)
        elif tmp2 % 3 == 2:
            grid2.append(tmp)
        else:
            grid3.append(tmp)
sum1 = sum(grid1)
sum2 = sum(grid2)
sum3 = sum(grid3)
tmp1 = [sum1]*C
tmp2 = [sum2]*C
tmp3 = [sum3]*C
for i in range(C):
    for k in grid1:
        tmp1[i] = tmp1[i] - k + D[k-1][i]
for i in range(C):
    for k in grid2:
        tmp2[i] = tmp2[i] - k + D[k-1][i]
for i in range(C):
    for k in grid3:
        tmp3[i] = tmp3[i] - k + D[k-1][i]
for i in range(C):
    for k in range(C):
        if i == k:
            continue
        for l in range(C):
            if i == l or k == l:
                continue
            ans = min(ans,tmp1[i]+tmp2[k]+tmp3[l])
print(ans)
### BUGGY CODE ###

import sys
input = sys.stdin.readline
n = int(input())
s = list(input())

def segfunc(x,y):
    return (len(x[1]|y[1]),x[1]|y[1])

def init(init_val):
    #set_val
    for i in range(n):
        seg[i+num-1]=init_val[i]    
    #built
    for i in range(num-2,-1,-1) :
        seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
    
def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
    
def query(p,q):
    if q<=p:
        return ide_ele
    p += num-1
    q += num-2
    res=ide_ele
    while q-p>1:
        if p&1 == 0:
            res = segfunc(res,seg[p])
        if q&1 == 1:
            res = segfunc(res,seg[q])
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res = segfunc(res,seg[p])
    else:
        res = segfunc(segfunc(res,seg[p]),seg[q])
    return res

#####単位元######
ide_ele = [0,set()]

#num:n以上の最小の2のべき乗
num =2**(n-1).bit_length()
seg=[ide_ele]*2*num

A = []
for i in range(n):
  A.append((1,set(s[i])))
init(A)
q = int(input())
for _ in range(q):
  p,a,b = input().split()
  if p == "1":
    update(int(a)-1,(1,set(b)))
  if p == "2":
    print(query(int(a)-1,int(b))[0])
    

### FIXED CODE ###

def main():
  import sys
  input = sys.stdin.readline
  n = int(input())
  s = list(input())

  def segfunc(x,y):
      return x|y

  def init(init_val):
      #set_val
      for i in range(n):
          seg[i+num-1]=init_val[i]    
      #built
      for i in range(num-2,-1,-1) :
          seg[i]=segfunc(seg[2*i+1],seg[2*i+2]) 
      
  def update(k,x):
      k += num-1
      seg[k] = x
      while k:
          k = (k-1)//2
          seg[k] = segfunc(seg[k*2+1],seg[k*2+2])
      
  def query(p,q):
      if q<=p:
          return ide_ele
      p += num-1
      q += num-2
      res=ide_ele
      while q-p>1:
          if p&1 == 0:
              res = segfunc(res,seg[p])
          if q&1 == 1:
              res = segfunc(res,seg[q])
              q -= 1
          p = p//2
          q = (q-1)//2
      if p == q:
          res = segfunc(res,seg[p])
      else:
          res = segfunc(segfunc(res,seg[p]),seg[q])
      return res

  #####単位元######
  ide_ele = 0

  #num:n以上の最小の2のべき乗
  num =2**(n-1).bit_length()
  seg=[ide_ele]*2*num

  A = []
  for i in range(n):
    A.append(1<<(ord(s[i])-96))
  init(A)
  q = int(input())
  for _ in range(q):
    p,a,b = input().split()
    if p == "1":
      update(int(a)-1,1<<(ord(b)-96))
    if p == "2":
      print(bin(query(int(a)-1,int(b))).count("1"))
main()
### BUGGY CODE ###

N = int(input())
a=list(map(int,input().split()))
ans=2020202020
for i in range(1,N):
    mae=sum(a[:i])
    ato=sum(a)-mae
    ans=min(ans,abs(mae-ato))
print(ans)

### FIXED CODE ###

N = int(input())
a=list(map(int,input().split()))
ans=2020202020
s=sum(a)
mae=a[0]
for i in range(1,N):
    mae+=a[i]
    ato=s-mae
    if mae-ato>0:
        ans=min(abs(sum(a[:i])-sum(a[i:])),abs(sum(a[:i+1])-sum(a[i+1:])))
        break
    else:
        ans=min(ans,abs(mae-ato))
print(ans)
### BUGGY CODE ###

from bisect import bisect_right

class SegmentTree:
    """
    0-indexed
    query : [L, R)
    """
    def __init__(self, size, initValue, cmpFunc):
        self.size = 1 << (size.bit_length())  # 完全二分木にする
        self.data = [initValue] * (2 * self.size - 1)
        self.initValue = initValue
        self.cmpFunc = cmpFunc

    def build(self, rawData):
        self.data[self.size - 1: self.size - 1 + len(rawData)] = rawData
        for i in range(self.size - 1)[:: -1]:
            self.data[i] = self.cmpFunc(self.data[2 * i + 1], self.data[2 * i + 2])

    def update(self, index, value):
        index += self.size - 1
        self.data[index] = value
        while index >= 0:
            index = (index - 1) // 2
            self.data[index] = self.cmpFunc(self.data[2 * index + 1], self.data[2 * index + 2])

    def query(self, left, right):
        L = left + self.size
        R = right + self.size
        ret = self.initValue
        while L < R:
            if R & 1:
                R -= 1
                ret = self.cmpFunc(ret, self.data[R - 1])
            if L & 1:
                ret = self.cmpFunc(ret, self.data[L - 1])
                L += 1
            L >>= 1
            R >>= 1
        return ret

N, D, A = map(int, input().split())
XH = [tuple(map(int, input().split())) for _ in range(N)]
XH.sort()
X = [x for x, _ in XH]

tree = SegmentTree(N + 1, 0, lambda a, b: a + b)

ans = 0
for i, (x, h) in enumerate(XH):
    cnt = tree.query(0, i + 1)
    h -= cnt * A

    if h <= 0:
        continue

    ness = -(-h // A)
    ans += ness
    tree.update(i, tree.query(i, i + 1) + ness)
    j = bisect_right(X, x + 2 * D)
    tree.update(j, tree.query(j, j + 1) - ness)

print(ans)

### FIXED CODE ###

from bisect import bisect_right

N, D, A = map(int, input().split())
XH = [tuple(map(int, input().split())) for _ in range(N)]
XH.sort()

X = [x for x, _ in XH]

ans = 0
ims = [0] * (N + 1)
cnt = 0

for now, (x, h) in enumerate(XH):
    cnt += ims[now]
    if cnt * A >= h:
        continue
    ness = -(-(h - cnt * A) // A)
    cnt += ness

    i = bisect_right(X, x + D * 2)
    ims[now] += ness
    ims[i] -= ness
    ans += ness

print(ans)
### BUGGY CODE ###

import copy
from functools import reduce
from fractions import gcd

N = int(input())
nums = [int(i) for i in input().split()]
nums2 = copy.copy(nums)
ans = []

def gcds(numlist):
    return reduce(gcd, numlist)


for i in range(N):
   nums.pop(i)
   ans.append(gcds(nums))
   nums = copy.copy(nums2)

print(max(ans))


### FIXED CODE ###

from fractions import gcd

N = int(input())
nums = [int(i) for i in input().split()]

fort = [nums[0], gcd(nums[0], nums[1])]
back = [nums[N-1], gcd(nums[N-1], nums[N-2])]
ans = []

for i in range(N-2):
    fort.append(gcd(fort[i+1], nums[i+2]))
                
for i in range(N-2):
    back.append(gcd(back[i+1], nums[N-(i+3)]))
    
for i in range(1, N-1):
    ans.append(gcd(fort[i-1], back[N-2-i]))

ans.append(fort[N-2])
ans.append(back[N-2])

print(max(ans))
### BUGGY CODE ###

*s, = input()
*t, = input()

dp = [[""]*(len(t)+1) for _ in range(len(s)+1)]

for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = dp[i][j] + s[i]
        else:
            if len(dp[i+1][j]) <= len(dp[i][j+1]):
                dp[i+1][j+1] = dp[i][j+1]
            else:
                dp[i+1][j+1] = dp[i+1][j]

print(dp[len(s)][len(t)])


### FIXED CODE ###

*s, = input()
*t, = input()

dp = [[0]*(len(t)+1) for _ in range(len(s)+1)]

for i in range(len(s)):
    for j in range(len(t)):
        if s[i] == t[j]:
            dp[i+1][j+1] = dp[i][j] + 1
        else:
            dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1])

ans = ""

i, j = len(s), len(t)
while i > 0 and j > 0:
    if dp[i][j] == dp[i-1][j]:
        i -= 1
    elif dp[i][j] == dp[i][j-1]:
        j -= 1
    else:
        ans = s[i-1] + ans
        i -= 1
        j -= 1

print(ans)
### BUGGY CODE ###

n,c,k = list(map(int, input().split()))
t = []
for i in range(n):
	t.append(int(input()))
t.sort()

ans = 0
while len(t)>0:
	pi = t[0]
	mens = 1
	for i in range(1,len(t)):
		if pi+k>=t[i]:
			mens+=1
		else:
			break
	bus = mens//c
	if bus!=0:
		ans+=bus
		t = t[bus*c:]
	else:
		ans+=1
		t = t[mens:]
print(ans)

### FIXED CODE ###

import bisect

n,c,k = list(map(int, input().split()))
t = []
for i in range(n):
	t.append(int(input()))
t.sort()

ans = 0
remain = c-1
if c==1:
	print(n)
	exit()
time = t[0]
for i in range(1,len(t)):
	if time+k<t[i]:
		time = t[i]
		remain = c
		ans+=1
	if remain==0:
		remain=c
		time = t[i]
		ans+=1
	remain-=1

print(ans+1)
### BUGGY CODE ###

L, R = map(int, input().split())

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


print(r)

### FIXED CODE ###

import sys
L, R = map(int, input().split())

r = 2019
for i in range(L, R):
    for j in range(i+1, R+1):
        r = min(r, (i*j)%2019)
        if r == 0:
            print(r)
            sys.exit()

print(r)