Harryxun/stf_run huggingface dataset:
x,n = map(int, input().split())

if n == 0:
    print(x)
else:
    p = list(map(int, input().split()))
    d = []
    c=0
    for e in p:
        d.append( abs(e-x))
    d1 = d[0]
    for i in range(len(d)):
        if d[i] < d1:
            d1 = d[i]
            z = p[i]
    for j in range(1,100):
        for g in p:
            if z+j != g:
                c +=1
                w1 = z+j
        if c == n:
            break
        c = 0
    c=0
    for j in range(1,100):
        for g in p:
            if z-j != g:
                c +=1
                w2 = z-j
        if c == n:
            break
        c = 0

    if w2 < 0:
        print(w1)
    elif abs(w1-x) < abs(w2-x):
        print(w1)
    elif abs(w1-x) >= abs(w2-x):
        print(w2)

### FIXED CODE ###

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

if n == 0:
    print(x)
elif n ==100:
    if x >50:
        print(101)
    else:
        print(0)
else:
    p = list(map(int, input().split()))
    d = []
    c=0
    for e in p:
        d.append(abs(e-x))
    d1 = d[0]
    z=p[0]
    for i in range(len(d)):
        if d[i] < d1:
            d1 = d[i]
            z = p[i]
    for j in range(1,100):
        for g in p:
            if z+j != g:
                c +=1
                w1 = z+j
        if c == n:
            break
        c = 0
    c=0
    for j2 in range(1,100):
        for g2 in p:
            if z-j2 != g2:
                c +=1
                w2 = z-j2
        if c == n:
            break
        c = 0
    if w2 < 0:
        print(w1)
    elif abs(w1-x) < abs(w2-x):
        print(w1)
    else:
        print(w2)
# coding: utf-8

nums = list()
for i in range(10):
    num = raw_input().split("?±±?????????")
    nums.append(int(num))

nums = sorted(nums)
print "{}\n{}\n{}".format(nums[0],nums[1],nums[2])

### FIXED CODE ###

mt = list()
for i in range(10):
    mt.append(int(raw_input()))

mt = sorted(mt,reverse=True)
for i in range(3):
    print mt[i]
from itertools import permutations
def read(): return list(map(int, input().split()))
 
 
INF = 114514810
 
 
def wf(d):
    N = len(d[0])
    for k in range(N):
        for i in range(N):
            for j in range(N):
                if d[i][j] > d[i][k] + d[k][j]:
                    d[i][j] = d[i][k] + d[k][j]
    return d
 
 
def calc_dist(p, d):
    dist = 0
    for i in range(len(p) - 1):
        if d[p[i]][p[i + 1]] >= INF:
            return INF
        dist += d[p[i]][p[i + 1]]
    return dist
 
 
def main():
    N, M, R = read()
    r = map(lambda x: x - 1, sorted(read()))
    d = [[INF for i in range(N)] for j in range(N)]
 
    for i in range(M):
        a, b, c, = read()
        a -= 1
        b -= 1
        d[a][b] = d[b][a] = c
 
    d = wf(d)
 
    min_dist = INF
    for p in list(permutations(r)):
        min_dist = min(min_dist, calc_dist(p, d))
 
    print(min_dist)
 
 
if __name__ == '__main__':
    main()

### FIXED CODE ###

n = input()
print("Yes" if n[0]=='9' or n[1]=='9' else "No")
N = int(input())
s = [int(input()) for _ in range(N)]
M = int(input())
t = [int(input()) for _ in range(M)]

ans = 0
for word in set(s):
    given = s.count(word) - t.count(word)
    ans = max(ans, given)
    
print(ans)

### FIXED CODE ###

N = int(input())
s = [input() for _ in range(N)]
M = int(input())
t = [input() for _ in range(M)]

ans = 0
for word in set(s):
    given = s.count(word) - t.count(word)
    ans = max(ans, given)
    
print(ans)
import math

a,b,c= map(int, input().split())
a1 =double(math.sqrt(a))
b1 =double(math.sqrt(b))
c1 =double(math.sqrt(c))
print(a1)

if a1+ b1 ,c1:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

a,b,c=map(int,input().split())
if 4*a*b<(c-a-b)**2 and c-a-b>0:
    print('Yes')
else:
    print('No')
N=int(input())
A=list(map(int,input().split()))
B=[A[i]-A[i-1] for i in range(1,N)]

ans=0
first=B[0]
for i in range(N-1):
    if first*B[i]>=0:
        pass
    else:
        ans+=1
        if i+1<=N-2:
            first=B[i+1]

print(ans+1)

### FIXED CODE ###

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

B=[A[i]-A[i-1] for i in range(1,N)]
ans=0
flag=False
for i in range(N-1):
    if B[i]!=0:
        first=B[i]
        flag=True
    if flag:
        break
for i in range(N-1):
    if first*B[i]>=0:
        pass
    else:
        ans+=1
        j=i+1
        while j<=N-2:
            if B[j]!=0:
                first=B[j]
                break
            else:
                j+=1

print(ans+1)
import math
a,b,x = map(int,input().split())
if(x/(a*a)>b/2):
    print(90 - (math.atan(a/(2*(b -(x/(a*a)))))*180/math.pi))
elif x/(a*a) == b/2:
    print(0)
    
else:
     print(90 - ((math.atan(x/(a*b)/b)*180/math.pi)))

### FIXED CODE ###

import math
a,b,x = map(int,input().split())
if x/(a*a) == b:
    print(0)
elif(x/(a*a)>=b/2):
    print(90 - (math.atan(a/(2*(b -(x/(a*a)))))*180/math.pi))    
else:
     print(90 - ((math.atan(2*x/(a*b*b))*180/math.pi)))
i = input()
N, A, B = i.split(' ')

N = int(N)
A = int(A)
B = int(B)

if abs(A-B)%2==0:
  print(abs(A-B)/2)
else:
  print(min(max(A, B), max(N-A, N-B))

### FIXED CODE ###

i = raw_input()
N, A, B = i.split()

N = int(N)
A = int(A)
B = int(B)

if abs(A-B)%2 == 0:
  print int(abs(A-B)/2)
else:
  e = int(min(A-1, N-B))
  d = (B-A+1) // 2
  print e + d
def digitSum(n):
    # 数値を文字列に変換
    s = str(n)
    # １文字ずつ数値化し配列にする。
    array = list(map(int, s))
    # 合計値を返す
    return sum(array)
S = input()
Scount = 0
for i in range(len(S)):
    for j in range(1,len(S)):
        if (i+j)<=len(S):
            part_S = S[i:i+j]
            num = int(part_S)
            if num % 673 == 0:
                num = int(num/673)
                sum3 = digitSum(num)
                while sum3 != digitSum(sum3):
                    sum3 = digitSum(sum3)
                if sum3 == 3 or sum3 == 6 or sum3 ==9:
                    Scount += 1
print(Scount)

### FIXED CODE ###

S = input()
from collections import defaultdict
d = defaultdict(int)
before = 0
for i in range(1,len(S)+1):
    now = (int(S[-i])*pow(10,i,2019)+before) % 2019
    d[now] += 1
    before = now
d[0] += 1
ans = 0
for i in d.values():
    ans += i*(i-1)//2
print(ans)
n = int(input())
h = list(map(int, input().split()))

c = 0
for i in range(n-1):
    if h[i] <= h[i+1]-1:
        h[i+1] = h[i+1]-1
    elif h[i] == h[i+1]:
        continue
    else:
        c = 1
if c == 1:
    print('No')
else:
    print('Yes')

### FIXED CODE ###

a, b, c = map(int, input().split())
d = a-b
if d >= c:
    re = 0
else:
    re = c-d

print(re)
N, M = map(int,input().split())
state = []
for _ in range(M):
  lst = list(map(int, input().split()))
  state.append(lst[1:])#switch numbers each denkyu
p = list(map(int, input().split()))#numbers switches on %2 == pi 
ans = 0
for i in rage(2**n):
  total = 0
  for j in range(m):
    cnt = 0
    for s in state[j]:
      s -= 1
      if (i >> s) & 1:#全スイッチのパターン一つ一つについて、各電球の各スイッチがオンになっているか
        cnt += 1
    cnt %= 2
    if cnt == p[j]:
      total += 1
  if total == m:
    ans += 1
print(ans)

### FIXED CODE ###

N, M = map(int,input().split())
state = []
for _ in range(M):
  lst = list(map(int, input().split()))
  state.append(lst[1:])#switch numbers each denkyu
p = list(map(int, input().split()))#numbers switches on %2 == pi 
ans = 0
for i in range(2**N):
  total = 0
  for j in range(M):
    cnt = 0
    for s in state[j]:
      s -= 1
      if (i >> s) & 1:#全スイッチのパターン一つ一つについて、各電球の各スイッチがオンになっているか
        cnt += 1
    cnt %= 2
    if cnt == p[j]:
      total += 1
  if total == M:
    ans += 1
print(ans)
c11, c12, c13 = map(int, input())
c21, c22, c23 = map(int, input())
if (c11 == c23) and (c12 == c22) and (c13 == c21):
 print("YES")
else:
 print("NO")
 

### FIXED CODE ###

c1 = input()
c2 = input() 
if c1 == c2[::-1]:
 print("YES")
else:
 print("NO")
N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]

judge = 0
for i in range(N):
  count = 0
  for j in range(i+1,N+1):
    for k in range(M):
      if s[i] == s[j]:
        count += 1
      if s[i] == t[k]:
        count -= 1
      if count > judge:
        judge = count
print(judge)
    

### FIXED CODE ###

N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]

judge = 0
for i in range(N-1):
  count = 1
  for j in range(i+1,N):
    if s[i] == s[j]:
      count += 1
  for k in range(M):
    if s[i] == t[k]:
      count -= 1
  if count > judge:
    judge = count
print(judge)
a = int(input())
b = int(input())

import math
if b < 10:
    c=a*10+b
elif b==100:
    c=a*1000+b
else:
    c=a*100+b

if int(math.sqrt(c)) == float(math.sqrt(c)):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

from math import sqrt
a, b = input().split()
n = int(a+b)
if(int(sqrt(n))**2 == n):
    print("Yes")
else:
    print("No")
d = list(map(int, input().split()))
O = input()

class Dice():
 def __init__(self, d):
  self.dice = d
 def S(self):
  one = self.dice[4]
  two = self.dice[0]
  five = self.dice[5]
  six = self.dice[1]
  InsSN(one, two, five, six)

 def InsSN(self, one, two, five, six):
  self.dice[0] = one
  self.dice[1] = two
  self.dice[4] = five
  self.dice[5] = six

 def N(self):
  one = self.dice[1]
  two = self.dice[5]
  five = self.dice[0]
  six = self.dice[4]
  InsSN(one, two, five, six)
  
 def InsWE(self, one, three, four, six):
  self.dice[0] = one
  self.dice[2] = three
  self.dice[4] = four
  self.dice[5] = six
 
 def W(self):
  one = self.dice[2]
  three = self.dice[5]
  four = self.dice[0]
  six = self.dice[3]
  InsWE(one, three, four, six)

 def E(self):
  one = self.dice[3]
  three = self.dice[0]
  four = self.dice[5]
  six = self.dice[2]
  InsWE(one, three, four, six)

d = Dice(d)

for i in range(len(O)):
 if O[i] == 'S':
  d.S()
 elif O[i] == 'N':
  d.N()
 elif O[i] == 'E':
  d.E()
 elif O[i] == 'W':
  d.W()

print(d.dice[0])





 













  

### FIXED CODE ###

d = list(map(int, input().split()))
order = input()
class Dice():
    def __init__(self, d):
        self.dice = d

    def InsSN(self, one, two, five, six):
        self.dice[0] = one
        self.dice[1] = two
        self.dice[4] = five
        self.dice[5] = six
        
    def InsWE(self, one, three, four, six):
        self.dice[0] = one
        self.dice[2] = three
        self.dice[3] = four
        self.dice[5] = six

    def S(self):
        one = self.dice[4]
        two = self.dice[0]
        five = self.dice[5]
        six = self.dice[1]
        self.InsSN(one, two, five, six)

    def N(self):
        one = self.dice[1]
        two = self.dice[5]
        five = self.dice[0]
        six = self.dice[4]
        self.InsSN(one, two, five, six)
 
    def W(self):
        one = self.dice[2]
        three = self.dice[5]
        four = self.dice[0]
        six = self.dice[3]
        self.InsWE(one, three, four, six)
        
    def E(self):
        one = self.dice[3]
        three = self.dice[0]
        four = self.dice[5]
        six = self.dice[2]
        self.InsWE(one, three, four, six)
        
    def roll(self, order):
        if order == 'S':
            self.S()
        elif order == 'N':
            self.N()
        elif order == 'E':
            self.E()
        elif order == 'W':
            self.W()
d = Dice(d)
for o in order:
    d.roll(o)
print(d.dice[0])
nk = [int(e) for e in input().split(" ")]
h = [int(f) for f in input().split()]
c = 0
for e_h in h: if nk[1] <= e_h: c += 1
print(c)

### FIXED CODE ###

k = int(input().split(" ")[1])
c = 0
for e_h in [int(e) for e in input().split()]:
    if(k <= e_h): c += 1
print(c)
def main():
    import sys
    input = sys.stdin.readline
    N, M = map(int, input().split())
    A = sorted(list(map(int, input().split())))
    BC = sorted([tuple(map(int, input().split())) for _ in range(M)], key=lambda x: x[1], reverse=True)
    ind = 0
    for b, c in BC:
        for i in range(b):
            if A[ind] >= c:
                break
            A[ind] = c
            ind += 1
    print(sum(A))


if __name__ == '__main__':
    main()

### FIXED CODE ###

import heapq
from sys import exit
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = sorted([tuple(map(int, input().split())) for _ in range(M)], key=lambda x: x[1], reverse=True)
heapq.heapify(A)

ans = sum(A)
for b, c in BC:
    for _ in range(b):
        if len(A) == 0:
            print(ans)
            exit()
        a = heapq.heappop(A)
        if a < c:
            ans += c - a
        else:
            print(ans)
            exit()
print(ans)
from math import gcd
A,B=[int(x) for x in input().rstrip().split()]

print(A*B//(gcd(A,B)))

### FIXED CODE ###

a,b=[int(x) for x in input().rstrip().split()]

def gcd(m,n):
    x=max(m,n)
    y=min(m,n)

    if x%y==0:
        return y
    else:
        while x%y!=0:
            z=x%y
            x=y
            y=z
        else:
            return z
def lcm(m,n):
    return int(m*n/gcd(m,n))
print(lcm(a,b))
import math

H,N=map(int,input().split())
A_list=[]
B_list=[]
for i in range(N):
    A,B=map(int,input().split())
    A_list.append(A)
    B_list.append(B)

amax=max(A_list)

inf=float('inf')
dp=np.array([0]+[inf]*(H+amax))

for i in range(N):
    A=A_list[i]
    B=B_list[i]
    for j in range(A,1+H):
        if dp[j-A]+B<dp[j]:
            dp[j]=dp[j-A]+B
    
    minA=np.amin(dp[H-A:])+B
    if minA < dp[-1]:
        dp[-1]=minA

print(dp[-1]))


### FIXED CODE ###

import math

def main():
    H,N=map(int,input().split())

    inf=float('inf')
    dp=[0]+[inf]*H

    for i in range(N):
        A,B=map(int,input().split())
        if A>=H:
            #dp[-1]=min(B,dp[-1])
            if B < dp[-1]:
                dp[-1]=B
        else:
            for j in range(A,H+1):
                #dp[j]=min(dp[j-A]+B,dp[j])
                if dp[j-A]+B<dp[j]:
                    dp[j]=dp[j-A]+B

                if j > H-A:
                    #dp[-1]=min(dp[-1],dp[j]+B)
                    if dp[j]+B < dp[-1]:
                        dp[-1]=dp[j]+B

    print(dp[-1])

main()
n=str(input())
print("Yes" if n%sum(map(int,n))==0 else "No")

### FIXED CODE ###

n=input()
print("Yes" if int(n)%sum(map(int,n))==0 else "No")
# 解説を見ながら
N = int(input())
A = list(map(int,input().split()))

# リストを作って，Amaxまでの数字について，aiの約数ならば足す，最終的には，要素が１のやつが求めるもの
# 一回検討した要素はsetに入れて次出たときは使わないようにする
import numpy as np
#L = np.zeros((10**6+10,))
A.sort()
MAX=10**6+1
L = [0]*MAX
used = set()
first = True
for a in A:
    if L[a] ==2:
        continue
    if a in used and first:
        first = False
        for i in range(0,MAX,a):
            L[i] = 2
        # L[::a] += 1　要素アクセスだから遅くなった?
        continue
    used.add(a)
    # L[1:][::a] += 1こういう書き方はリストではできないので注意
    L[a] = 1
    for i in range(2*a,MAX,a):
        L[i] = 2
    #L[::a] += 1
count = 0
for a in A:
    if L[a] == 1:
        count += 1
print(count)







### FIXED CODE ###

X = map(int,input().split())

for i,x in enumerate(X):
    if x == 0:
        print(i+1)
A,B = map(int,input().split())
if(A>0 && B%A==0):
  print(B+A)
else:
  print(B-A)
  

### FIXED CODE ###

A,B=map(int,input().split())
if(A>0 and B%A==0):
  print(B+A)
else:
  print(B-A)
N, Q = map(int, input().split())
S = input()


t = [0] * (N+1)
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2]=='AC' else 0)
for i in range(Q):
    print(t[R[i]] - t[L[i]])

### FIXED CODE ###


N, Q = map(int, input().split())
S = list(input())
lr = []
for i in range(Q):
    l, r = map(int, input().split())
    lr.append([l-1, r-1])
AC = []
pre = None
cnt = 0
for c in S:
    if c == "A":
        pre = "A"
    elif pre == "A" and c == "C":
        cnt += 1
        pre = None
    elif pre == "A":
        pre = None
    AC.append(cnt)
for l, r in lr:
    print(AC[r] - AC[l])
import sys
input = sys.stdin.readline

import numpy as np
import fractions
from functools import reduce

from copy import deepcopy


def gcd_list(nums):
    return reduce(fractions.gcd, nums)

def main():
    N = int(input())
    A = np.array(list(map(int, input().split())))

    bools = np.ones(N, dtype=bool)

    gcd_val = 0
    ans = 0
    for i in range(N):
        A_cop = deepcopy(A)
        bl_cop = deepcopy(bools)

        fal = [i]
        bl_cop[fal] = False

        gcd_val = gcd_list(A_cop[bl_cop])

        if ans == 0 or ans < gcd_val:
            ans = gcd_val

    print(ans)

main()

### FIXED CODE ###

import sys
input = sys.stdin.readline
import fractions


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

    L_gcds = [0] * N
    L_gcd_tmp = L_gcds[0]
    for i in range(1, N):
        L_gcd_tmp = fractions.gcd(L_gcd_tmp, A[i-1])
        L_gcds[i] = L_gcd_tmp

    R_gcds = [0] * N
    R_gcd_tmp = R_gcds[0]
    for j in range(1, N):
        R_gcd_tmp = fractions.gcd(R_gcd_tmp, A[N-j])
        R_gcds[j] = R_gcd_tmp
    R_gcds.reverse()

    LR_gcds = [0] * N
    for k in range(0, N):
        LR_gcds[k] = fractions.gcd(L_gcds[k], R_gcds[k])

    print(max(LR_gcds))

main()
# -*- coding: utf-8 -*-

import fractions

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

ans = 0

Cans = fractions.floor(B/C) - fractions.ceil(A/C) + 1
Dans = fractions.floor(B/D) - fractions.ceil(A/D) + 1

CD = C * D / fractions.gcd(C,D)
CDans = fractions.floor(B/CD) - fractions.ceil(A/CD) + 1

ans = (B-A+1) - (Cans + Dans - CDans)

print(ans)

### FIXED CODE ###

# -*- coding: utf-8 -*-

from fractions import gcd
from math import ceil,floor

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

Cans = B//C - (A-1)//C
Dans = B//D - (A-1)//D

CD = C * D // gcd(C,D)
CDans = B//CD - (A-1)//CD

ans = (B-A+1) - (Cans + Dans - CDans)

print(ans)
import sys
sys.setrecursionlimit(10**6)

table = {}

def dfs(v, e):
    glabal table
    if (v, e) in table:
        return table[(v, e)]
    res = 0
    for next_v in e[v]:
        res = max(dfs(next_v, e) + 1, res)
    table[(v,e)] = res
    return res


def main():
    N, M = map(int, input().split())
    e = [[] for _ in range(N)]
    for i in range(M):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        e[u].append(v)
    ans = -1
    for v in range(N):
        ans = max(ans, dfs(v, e))
    print(ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

from collections import deque


def main():
    N, M = map(int, input().split())
    e = [[] for _ in range(N)]
    input_edges = [0]*N
    for i in range(M):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        e[u].append(v)
        input_edges[v] += 1
    queue = deque()
    dp = [-1] * N
    for i, input_edge in enumerate(input_edges):
        if input_edge == 0:
            queue.appendleft(i)
            dp[i] = 0
    topological_sorted = []
    while queue:
        v = queue.pop()
        topological_sorted.append(v)
        for other_side in e[v]:
            input_edges[other_side] -= 1
            if input_edges[other_side] == 0:
                queue.appendleft(other_side)
    for v in topological_sorted:
        for other_side in e[v]:
            dp[other_side] = max(dp[v] + 1, dp[other_side])
    print(max(dp))


if __name__ == "__main__":
    main()
N = input()
A = input().split()
count=0
for i in range(N):
  if A[i]%2==1:
    count+=1
if conut%2=1:
  print("NO")
else:
  print("YES")

### FIXED CODE ###

N = input()
A = input().split()
count=0
for i in range(int(N)):
  if int(A[i]) % 2==1:
    count+=1
if count%2==1:
  print("NO")
else:
  print("YES")
def sum_digits(number):
    total = 0
    while number > 0:
        total += n % 10
        n //= 10
    return total


def main():
    n, a, b = map(int, open(0).read().split())
    res = 0
    for i in range(1, n+1):
        total = sum_digits(i)
        if a <= total and total <= b:
            res += total
    print(res)


if __name__ == "__main__":
    main()


### FIXED CODE ###

def sum_digits(n):
    total = 0
    while n > 0:
        total += n % 10
        n //= 10
    return total


def main():
    n, a, b = map(int, open(0).read().split())
    res = 0
    for i in range(1, n+1):
        total = sum_digits(i)
        if a <= total and total <= b:
            res += i
    print(res)


if __name__ == "__main__":
    main()
a, b = [int(x) for x in input().split()]
# a = [int(input()) for _ in range(m)]
# a = [int(x) for x in input().split()]

import math


print((a*b)//math.gcd(a, b))

### FIXED CODE ###

a, b = [int(x) for x in input().split()]
# a = [int(input()) for _ in range(m)]
# a = [int(x) for x in input().split()]

from fractions import gcd



print((a*b)//gcd(a, b))
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**9]*n

dp[0]=0
for i in range(1,n):
    for j in range(1,max(k+1,n)):
        dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))
    
print(dp[n-1])

### FIXED CODE ###

n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[10**9]*n

dp[0]=0
for i in range(1,n):
    for j in range(1,min(k+1,i+1)):
        dp[i]=min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))
    
print(dp[n-1])
n,*a,t=map(int,open(0).read().split()),sum(a)
v=w=1
for q in a:
  w=min(2*(w-q),t:=t-q);(v:=v+w)
  if w<0:print(-1);exit()
print(v)

### FIXED CODE ###

from itertools import accumulate
n=int(input())
a=list(map(int,input().split()))
c=list(accumulate(a))
b=[0]*(n+1)
#大きくしすぎてしまう場合がある
#いや上限を考えろや
def f():
    global n,a,b
    for i in range(n+1):
        if i==0:
            b[0]=min(c[n]-c[0],1)
        else:
            b[i]=min(2*(b[i-1]-a[i-1]),c[n]-c[i-1])

    if n==0:
        if a[0]!=1:
            print(-1)
        else:
            print(1)
    elif b[n]!=a[n]:
        print(-1)
    else:
        print(sum(b))
        #print(b)
f()
k = int(input())
from math import gcd
ans = 0
for i in range(k+1):
    for j in range(k+1):
        n = math.gcd(i,j)
        for m in range(k+1):
            a = math.gcd(n,m)
            ans += a
print(ans)


### FIXED CODE ###

from math import gcd
k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        ans_=gcd(i,j)
        for l in range(1,k+1):
            ans+=gcd(ans_,l)
print(ans)
N = int(input())
L =[]

guzai=int(input())
L.append(guzai)

L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))


### FIXED CODE ###

N = [int(v) for v in input().split()]
L = [int(v) for v in input().split()]
L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))
a,b,c,d=map(int,input().split())
if abs(a-c)<=d or abs(a-b)<=d>=abs(b-c):print("Yes")
else:print("No")

### FIXED CODE ###

a,b=map(int,input().split());print(max(max(a+b,a-b),a*b))