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

import math
A, B, N = map(int, input().split())
ans = []
for x in range(1, N+1):
    cal = math.floor((A*x)/B) - (int(A) * math.floor(x/B))
    ans.append(cal)
print(max(ans))

### FIXED CODE ###

a, b, n = map(int, input().split())
n = min(n, b-1)
 
print(int((a * n) / b) - a * int(n / b))
### BUGGY CODE ###

from collections import deque

N=int(input())
A=[list(map(int,input().split())) for _ in range(N)]
A=list(map(lambda x: deque(x), A))
#print(A)

ans=0
while 1:
  P=[0]*N
  for i in range(N):
    if len(A[i]):
      if i+1==A[A[i][0]-1][0]:
        P[i]=1
  #print(P)
  if sum(P):
    for i in range(N):
      if P[i]:
        A[i].popleft()
    ans+=1
  else:
    tmp=0
    for a in A:
      tmp+=len(a)
    if tmp!=0:
      ans=-1
    break
print(ans)
    

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline

N = int(input())
A = [[]] + [list(map(int, input().split()))[::-1] for _ in range(N)]

pair = [[0 for _ in range(N + 1)] for _ in range(N + 1)]

stack = []
for i in range(1, N + 1):
  a = A[i].pop()
  pair[i][a] += 1
  if pair[i][a] == pair[a][i] == 1:
    stack.append(i)
    stack.append(a)

r = []
answer = 1
while stack:
  while stack:
    i = stack.pop()
    if A[i]:
      a = A[i].pop()
      pair[i][a] += 1
      if pair[i][a] == pair[a][i] == 1:
        r.append(i)
        r.append(a)
  stack = r
  if r:
    answer += 1
  r = []
  
flag = 1
for i in range(1, N + 1):
  if A[i]:
    flag = 0
    break
if flag:
  print(answer)
else:
  print(-1)
### BUGGY CODE ###

N = list(input())
stack = []
count = 0
while N:
    stack.append(N.pop(0))
    i = 0
    while len(stack) >= 2:
        #print(stack, i)
        if stack[-2 - i] != stack[-1 - i]:
            count += 1
            tmp = stack[-2 - i]
            stack[-2 - i] = stack[-1 - i]
            stack[-1 - i] = tmp
            i += 1
            if i == len(stack)-1:
                break
        else:
            break
print(count)

### FIXED CODE ###

N = list(input())
b_n = N.count("B")
point = 0
for i in range(len(N)):
    if N[i] == "B":
        point += i
future_point = (b_n * (len(N) - 1 - b_n + 1 + len(N) - 1)) // 2
print(future_point - point)
### BUGGY CODE ###

import math
mod = 10**9+7
n,k = map(int,input().split())
b = math.factorial(k-1)%mod
def comb(p):
    if p >= k-1:
        a = math.factorial(p)%mod
        c = math.factorial(p-k+1)%mod
        return (a*pow(b*c, mod-2, mod))%mod
    else:
        return 0
A = list(map(int,input().split()))
A.sort()
ans = 0
for i in range(k-1,n):
    ans += comb(i)*(A[i]-A[n-i-1])
    ans %= mod
print(ans)


### FIXED CODE ###

import math
mod = 10**9+7
n,k = map(int,input().split())
b = math.factorial(k-1)%mod
fact = [0]*(n-k+1)
a = math.factorial(k-1)%mod
c = 1
for i in range(k-1, n):
    if i == k-1:
        fact[0] = (a*pow(b*c, mod-2, mod))%mod
    else:
        a = a*i%mod
        c = c*(i-k+1)%mod
        fact[i-k+1] = (a*pow(b*c, mod-2, mod))%mod
A = list(map(int,input().split()))
A.sort()
ans = 0
for i in range(k-1,n):
    ans += fact[i-k+1]*(A[i]-A[n-i-1])
    ans %= mod
print(ans)
### BUGGY CODE ###

def f():
    import sys
    input=sys.stdin.readline
    n,m=[int(i) for i in input().split()]
    s=[int(i) for i in input().split()]
    t=[int(i) for i in input().split()]
    mod=10**9+7
    dp=[[0]*(m+1) for i in range(2)]
    dp[0][0]=1
    for i in range(n+1):
        for j in range(m+1):
            if i!=0:
                dp[i%2][j]=dp[(i-1)%2][j]
            if j!=0:
                dp[i%2][j]+=dp[i%2][j-1]
            if i!=0 and j!=0:
                if s[i-1]!=t[j-1]:
                    dp[i%2][j]-=dp[(i-1)%2][j-1]
            dp[i%2][j]%=mod
    print(dp[n%2][m])


f()




### FIXED CODE ###

n,m=[int(i) for i in input().split()]
s=[int(i) for i in input().split()]
t=[int(i) for i in input().split()]
mod=10**9+7
dp=[[0]*(m+1) for i in range(n+1)]
dp[0][0]=1
for i in range(n+1):
    for j in range(m+1):
        if i!=0:
            dp[i][j]+=dp[i-1][j]
        if j!=0:
            dp[i][j]+=dp[i][j-1]
        if i!=0 and j!=0:
            if s[i-1]!=t[j-1]:
                dp[i][j]-=dp[i-1][j-1]
        dp[i][j]%=mod
print(dp[-1][-1])
### BUGGY CODE ###

import fractions

MOD = 10**9+7

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

n = int(input())
a = [int(_) for _ in input().split()]
LCM = 1
for i in a:
    LCM = lcm(LCM, i)

ans_arr = [0] * n
for i in range(len(a)):
    ans_arr[i] = LCM // a[i]
print(sum(ans_arr) % MOD)

### FIXED CODE ###

from fractions import gcd
from functools import reduce

MOD = 1000000007

def lcm(x, y):
    return (x * y) // gcd(x, y)

n = int(input())
a = [int(_) for _ in input().split()]
LCM = reduce(lcm, a)

arr = [LCM // _ for _ in a]
print(sum(arr) % MOD)
### BUGGY CODE ###

def main():
    N, K = map(int, input().split())
    A_list = list(map(int, input().split()))

    for _ in range(min(K,40)):
        e_list_1 = [0] * N
        l_1 = [0] * N
        v = 0
        for i,a in enumerate(A_list):
            l_1[i] = v 
            e_list_1[min(i + a, N-1)] += 1
            v = v + 1 - e_list_1[i]
        
        e_list_2 = [0] * N
        v = 0
        for _i,a in enumerate(A_list[::-1]):
            i = N-1-_i
            A_list[i] = l_1[i] + v + 1
            e_list_2[max(i-a, 0)] += 1
            v = v + 1 - e_list_2[i]
        
    print(*A_list)
if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    N, K = map(int, input().split())
    A_list = list(map(int, input().split()))

    for _ in range(min(K,50)):
        e_list_1 = [0] * N
        l_1 = [0] * N
        v = 0
        for i,a in enumerate(A_list):
            l_1[i] = v 
            e_list_1[min(i + a, N-1)] += 1
            v = v + 1 - e_list_1[i]
        
        e_list_2 = [0] * N
        v = 0
        for _i,a in enumerate(A_list[::-1]):
            i = N-1-_i
            A_list[i] = l_1[i] + v + 1
            e_list_2[max(i-a, 0)] += 1
            v = v + 1 - e_list_2[i]
        
    print(*A_list)
if __name__ == "__main__":
    main()
### BUGGY CODE ###

import math
import itertools
import collections

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

n = int(input())
li = list(map(int,input().split()))
c = collections.Counter(li)
c = list(sorted(c.items())) #昇順にソート
d = [0]*n #その数が何回出てくるか
x = 0 #全てのボールから、できる組合せの総数

for i in c:
    a = i[0]
    b = i[1]
    if b > 2:
        x += combinations_count(b, 2)
    elif b == 2:
        x += 1
    d[a-1] = b

for i in li:
    y = d[i-1]
    if y > 2:
        ans = x - combinations_count(y, 2) + combinations_count(y-1, 2)
    elif y == 2:
        ans = x - 1
    else:
        ans = x
    print(ans)

### FIXED CODE ###

import collections

def combinations_count(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

n = int(input())
li = list(map(int,input().split()))
c = collections.Counter(li)
ans = [0]*n
x = 0 #全てのボールから、できる組合せの総数

if len(c) == 1:
    ans = [combinations_count(n-1, 2)]*n
    print(*ans)
    exit()

for i in c.items():
    a = i[0]
    b = i[1]
    if b > 2:
        x += combinations_count(b, 2)
    elif b == 2:
        x += 1

for i in c.items():
    a = i[0]
    b = i[1]
    if b > 2:
        y = x - combinations_count(b, 2) + combinations_count(b-1, 2)
    elif b == 2:
        y = x - 1
    else:
        y = x
    ans[a-1] = y

for i in li:
    print(ans[i-1])
### BUGGY CODE ###

from operator import itemgetter
from collections import Counter
import heapq

N, K = [int(v) for v in input().split()]
sushi = [tuple(int(v) for v in input().split()) for i in range(N)]

sushi = sorted(sushi, key=itemgetter(1), reverse=True)

ate_list = sushi[:K]

kind_counter = Counter([s[0] for s in ate_list])
kind_cnt = len(list(kind_counter))

max_pt = sum([s[1] for s in ate_list]) + kind_cnt ** 2

if K >= N:
    print(max_pt)
    exit()

# print(ate_list)

waiting_sushi = []
wait_kind = []
for s in sushi[K:]:
    if kind_counter[s[0]]:  # すでに食べてる種類
        continue

    if not s[0] in wait_kind:
        waiting_sushi.append(s)
        wait_kind.append(s[0])

# 食べた種類を増やしていくフェーズ
idx = K - 1

# print(waiting_sushi)

curr_pt = max_pt
for s in waiting_sushi:
    target = None
    for i in range(idx, -1, -1):
        # 1個しかないものは交換しない
        if kind_counter[ate_list[i][0]] > 1:
            target = ate_list[i]
            idx = i
            break

    if not target:
        break

    # 入れ替えして比較
    val = curr_pt - target[1] + s[1] + ((kind_cnt + 1) ** 2) - (kind_cnt ** 2)
    curr_pt = val

    max_pt = max(curr_pt, max_pt)
    kind_counter[target[0]] -= 1

    kind_cnt += 1
    idx -= 1

# print(kind_cnt)
print(max_pt)


### FIXED CODE ###

from operator import itemgetter
from collections import Counter

N, K = [int(v) for v in input().split()]
sushi = [tuple(int(v) for v in input().split()) for i in range(N)]

sushi = sorted(sushi, key=itemgetter(1), reverse=True)

#
# kind_counter = Counter([s[0] for s in ate_list])
# kind_cnt = len(list(kind_counter))

##
# すでにでてきたかどうかがわかれば良いので Counter を使う必要はない
# (数える必要ない)
##

kind = set()
can_converts = []  # 変更しても良いよリスト
max_pt = 0

for i in range(K):
    if sushi[i][0] in kind:
        can_converts.append(sushi[i])
    else:
        kind.add(sushi[i][0])
    max_pt += sushi[i][1]
max_pt += len(kind) ** 2

# 食べた種類を増やしていくフェーズ
curr_pt = max_pt

for s in sushi[K:]:
    if not can_converts: break
    if s[0] not in kind:
        target = can_converts.pop(-1)
        curr_pt = curr_pt - target[1] + s[1] - len(kind) ** 2 + (len(kind) + 1) ** 2
        max_pt = max(max_pt,curr_pt)

        kind.add(s[0])

print(max_pt)

# kind_cnt_seq = kind_cnt ** 2
# max_pt = sum([s[1] for s in ate_list]) + kind_cnt_seq
#
# if K >= N:
#     print(max_pt)
#     exit()
#
# waiting_sushi = []
# wait_kind = []
# for s in sushi[K:]:
#     if kind_counter[s[0]]:  # すでに食べてる種類
#         continue
#
#     if not s[0] in wait_kind:
#         waiting_sushi.append(s)
#         wait_kind.append(s[0])
#
# # 食べた種類を増やしていくフェーズ
# idx = K - 1
# curr_pt = max_pt
# for s in waiting_sushi:
#     target = None
#     for i in range(idx, -1, -1):
#         # 1個しかないものは交換しない
#         if kind_counter[ate_list[i][0]] > 1:
#             target = ate_list[i]
#             idx = i
#             break
#
#     if not target:
#         break
### BUGGY CODE ###

import math
K = int(input())
sum = 0

for i in range(1, K + 1):
  for j in range(1, K + 1):
    for k in range(1, K + 1):
      gcd1 = math.gcd(j, k)
      gcd2 = math.gcd(i, gcd1)
      sum += gcd2

print(sum)

### FIXED CODE ###

import math
K = int(input())
sum = 0

for i in range(1, K + 1):
  for j in range(1, K + 1):
    gcd1 = math.gcd(i, j)
    for k in range(1, K + 1):
      gcd2 = math.gcd(k, gcd1)
      sum += gcd2

print(sum)
### BUGGY CODE ###

k, s = map(int, input().split())
c = 0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x+y+z == s:
                c += 1

print(c)

### FIXED CODE ###

k, s = map(int, input().split())
c = 0

for x in range(k+1):
    for y in range(x, k+1):
        z = s-x-y
        if y <= z <= k:
            if x == y == z:
                c += 1
            elif x == y or y == z:
                c += 3
            else:
                c += 6

print(c)
### BUGGY CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, M: int, L: "List[int]", R: "List[int]"):
    result = set([i for i in range(int(1e5 + 1))])
    # print(result)
    for i in range(M):
        l_to_r = {j for j in range(L[i], R[i] + 1)}
        result = result & l_to_r
        # print(result)
    print(len(result))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    L = [int()] * (M)  # type: "List[int]"
    R = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        L[i] = int(next(tokens))
        R[i] = int(next(tokens))
    solve(N, M, L, R)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, M: int, L: "List[int]", R: "List[int]"):
    L = max(L)
    R = min(R)

    if L <= R:
        print(R - L + 1)
    elif L > R:
        print(0)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    L = [int()] * (M)  # type: "List[int]"
    R = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        L[i] = int(next(tokens))
        R[i] = int(next(tokens))
    solve(N, M, L, R)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

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

for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  elif a==0 and b==0:
    break

print(a, b)

### FIXED CODE ###

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

if k >= a+b:
  print(0, 0)
elif k >= a:
  print(0, b-(k-a))
elif k == a:
  print(0, b)
elif k < a:
  print(a-k, b)
### BUGGY CODE ###

from sys import stdin, stdout
import math,sys,heapq
from itertools import permutations, combinations
from collections import defaultdict,deque,OrderedDict
from os import path
import bisect as bi
def yes():print('YES')
def no():print('NO')
if (path.exists('input.txt')): 
    #------------------Sublime--------------------------------------#
    sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w');
    def I():return (int(input()))
    def In():return(map(int,input().split()))
else:
    #------------------PYPY FAst I/o--------------------------------#
    def I():return (int(stdin.readline()))
    def In():return(map(int,stdin.readline().split()))

def dict(a):
    d={}
    for x in a:
        if d.get(x,-1)!=-1:
            d[x]+=1
        else:
            d[x]=1
    return d

def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bi.bisect_right(a, x)
    if i != len(a):
        return i
    else:            
        return -1

def main():
    try:
        n,k=In()
        l=list(In())   
        ans=[]
        t=1
        last=1
        for x in range(n):
            if x<k:
                last*=l[x]
            else:
                temp=last//l[x-k]
                temp*=l[x]
                if temp>last:
                    ans.append('Yes')
                else:
                    ans.append('No')
                last=temp
        for x in ans:
            print(x)

    except:
        pass
        
M = 998244353
P = 1000000007
 
if __name__ == '__main__':
    #for _ in range(I()):main()
    for _ in range(1):main()




### FIXED CODE ###

from sys import stdin, stdout
import math,sys,heapq
from itertools import permutations, combinations
from collections import defaultdict,deque,OrderedDict
from os import path
import bisect as bi
def yes():print('YES')
def no():print('NO')
if (path.exists('input.txt')): 
    #------------------Sublime--------------------------------------#
    sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w');
    def I():return (int(input()))
    def In():return(map(int,input().split()))
else:
    #------------------PYPY FAst I/o--------------------------------#
    def I():return (int(stdin.readline()))
    def In():return(map(int,stdin.readline().split()))

def dict(a):
    d={}
    for x in a:
        if d.get(x,-1)!=-1:
            d[x]+=1
        else:
            d[x]=1
    return d

def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bi.bisect_right(a, x)
    if i != len(a):
        return i
    else:            
        return -1

def main():
    try:
        n,k=In()
        l=list(In())   
        ans=[]
        t=1
        last=1
        for x in range(k,n):
            if l[x-k]>=l[x]:
                print('No')
            else:
                print('Yes')


    except:
        pass
        
M = 998244353
P = 1000000007
 
if __name__ == '__main__':
    #for _ in range(I()):main()
    for _ in range(1):main()
### BUGGY CODE ###

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

dp = [0]*n 

for i in range(1,n):
    temp = float('inf')
    for j in range(1,k+1):
        if i-j>=0:
            temp = min(dp[i-j]+abs(h[i]-h[i-j]), temp)
    
    dp[i] = temp
    
print(dp[-1])

### FIXED CODE ###

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

dp = [0]*n 

for i in range(1,n):
    dp[i] = dp[i-1]+abs(h[i]-h[i-1])
    for j in range(2,k+1):
        if i-j>=0:
            dp[i] = min(dp[i-j]+abs(h[i]-h[i-j]), dp[i])
    
print(dp[-1])
### BUGGY CODE ###

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

if max(A) < K:
    print('IMPOSSIBLE')
    exit()

if K in A:
    print('POSSIBLE')
    exit()

arr = []
for i in range(N):
    for j in range(len(A)):
        for k in range(len(A)):
            if j != k:
                arr.append(abs(A[j] - A[k]))
        arr = list(set(arr))
        A += arr
        A = list(set(A))
        if K in A:
            print('POSSIBLE')
            exit()
    arr = []

print('IMPOSSIBLE')


### FIXED CODE ###

import fractions
from functools import reduce

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

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

G = gcd(*A)
M = max(A)

if K % G == 0 and M >= K:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')
### BUGGY CODE ###

from collections import deque 
import math
def calculate(x,y,z):
    n = x**2 + y**2 + z**2 + x*y + y*z + z*x
    return n


def dfs(n,x,y,z):
    queue = deque([[x,y,z]])
    count = 0
    while queue:
        x,y,z = queue.popleft()
        for dx, dy, dz in ([1,0,0],[0,1,0],[0,0,1]):
            newx, newy, newz = x + dx, y + dy, z + dz
            ans = calculate(newx,newy,newz)
            if ans == n and [newx,newy,newz] not in queue:
                count+= 1
            if x > math.sqrt(n) or y > math.sqrt(n) or z > math.sqrt(n):
                queue = []
                break
            else:
                queue.append([newx,newy,newz])
    return count

N = int(input())
list_xyz = (1,1,1)
n = list_xyz[0]**2 + list_xyz[1]**2 + list_xyz[2]**2 + list_xyz[0]*list_xyz[1] + list_xyz[1]*list_xyz[2] + list_xyz[2]*list_xyz[0] 

for i in range(1,N+1):
  count = 0
  n = calculate(list_xyz[0], list_xyz[1], list_xyz[2])
  if n == i:
      count +=1
  # count += bfs(i, list_xyz[0], list_xyz[1], list_xyz[2])
  count += dfs(i, list_xyz[0], list_xyz[1], list_xyz[2])
  print(count)

### FIXED CODE ###

N = int(input())
zeros = [0 for i in range(10050)]
for x in range(1,105):
    for y in range(1,105):
        for z in range(1,105):
            n = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if n < 10050:
                zeros[n]+=1

for i in range(N):
    print(zeros[i+1])
### BUGGY CODE ###

n = int(input())
a = [input() for i in range(n)]
'''
for i in range(n):
    tmp = a[i]
    a.pop(i)
    print(max(a))
    a.insert(i, tmp)
'''
for i in range(n-1):
    if i==0:
        print(max(a[1:]))
    else:
        max1 = max(a[:i])
        max2 = max(a[i+1:])
        print(max(max1, max2))
print(max(a[:n]))


### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
a_sort = sorted(a.copy())
for i in range(n):
    print(a_sort[-2] if a[i] == a_sort[-1] else a_sort[-1])
### BUGGY CODE ###

n,k=map(int,input().split())
x=list(map(int,input().split()))
if (0 in x):
    k-=1
else:
    x.append(0)
    x.sort()
place=x.index(0)
time=[]
def measureTime(i,regX,nowTime,nowPlace):
    if i<k:
        if len(regX)<=1:
            time.append(nowTime)
        else:
            newRegX=regX[:]
            newRegX.pop(nowPlace)
            if nowPlace>0:
                newTimeM=nowTime+abs(regX[nowPlace]-regX[nowPlace-1])
                # print('{},place={},time={}'.format(newRegX,nowPlace-1,newTimeM))
                measureTime(i+1, newRegX, newTimeM, nowPlace-1)
            if nowPlace<len(regX)-1:
                newTimeP=nowTime+abs(regX[nowPlace]-regX[nowPlace+1])
                # print('{},place={},time={}'.format(newRegX,nowPlace,newTimeP))
                measureTime(i+1, newRegX, newTimeP, nowPlace)
    else:
        time.append(nowTime)

measureTime(0,x,0,place)
time.sort()
print(time[0])


### FIXED CODE ###

n,k=map(int,input().split())
x=list(map(int,input().split()))
if (0 in x):
    k-=1
else:
    x.append(0)
    x.sort()

zeroPos=x.index(0)
leftLen=zeroPos
rightLen=len(x)-zeroPos-1
# print(leftLen,zeroPos,rightLen)
# print(x)
left=[]
right=[]
for turn in range(leftLen+1):
    if(turn>k):
        break
    if(k-turn<=rightLen):
        left.append(x[zeroPos-turn]*-2 + x[zeroPos+k-turn])
for turn in range(rightLen+1):
    if(turn>k):
        break
    if(k-turn<=leftLen):
        right.append(2*x[zeroPos+turn] + -1*x[zeroPos-k+turn])
minL=min(left)
minR=min(right)
# print(left,right)
print(minL if minL<minR else minR)
### BUGGY CODE ###

import collections
n = int(input())
s = [0] * n
c = [0] * n
count = 0
for i in range(n):
    s[i] = input()
    c[i] = collections.Counter(s[i])
    for j in range(i):
        if c[i] == c[j]:
            count+=1
print(count)

### FIXED CODE ###

import collections
n = int(input())
s = [0] * n
c = [0] * n

count = 0
for i in range(n):
    s[i] = input()
    c[i] = ''.join(sorted(s[i]))
for i in collections.Counter(c).values():
    count += i*(i-1)//2
print(count)
### BUGGY CODE ###

n = int(input())
values = list(map(int, input().split()))
m = 1


def gcd(x, y):
    if x < y:
        x += y
        y = x - y
        x -= y

    while y > 0:
        r = x % y
        x = y
        y = r

    return x


for i in range(n):
    a = values[:]
    del a[i]
    g = a[0]
    for j in range(n-1):
        if a[j] % g == 0:
            pass
        else:
            g = gcd(g, a[j])
    if m < g:
        m = g

print(m)


### FIXED CODE ###

n = int(input())
v = list(map(int, input().split()))
m = 1
gf = []
gp = []


def gcd(x, y):
    if x < y:
        x += y
        y = x - y
        x -= y

    while y > 0:
        r = x % y
        x = y
        y = r

    return x


gf.append(v[0])
for i in range(n-1):
    gf.append(gcd(gf[i], v[i+1]))

gp.append(v[n-1])
for i in range(n-1):
    gp.append(gcd(gp[i], v[n-2-i]))

m = gp[n-2]

for i in range(n-1):
    b = gcd(gf[i], gp[n-3-i])
    if m < b:
        m = b
if m < gf[n-2]:
    m = gf[n-2]

print(m)