Harryxun/stf_run huggingface dataset:
A, B = map(int, input().split())

for i in range(11):
    if B <= A*i-(i-1):
        count = i
        break

print(count)


### FIXED CODE ###

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

for i in range(20):
    if B <= A*i-(i-1):
        count = i
        break

print(count)
n = int(input())

edge = [[] for i in range(n)]
ans = [-1] * n
odd = []
even =[]
nums = [[],[],[]]
for i in range(1,n+1):
    nums[i % 3].append(i)

def dfs(x, last = -1, d = 0):
    if d % 2 == 0: even.append(x)
    else: odd.append(x)
    for nxt in edge[x]:
        if nxt == last:continue
        dfs(nxt, x, d + 1)

for i in range(n-1):
    a, b = map(int, input().split())
    a-=1
    b-=1
    edge[a].append(b)
    edge[b].append(a)

dfs(0)

zerocnt = len(nums[0])

if len(even) <= zerocnt:
    for even_node in even:
        ans[even_node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for odd_node in odd:
        ans[odd_node] = rest.pop()

elif len(odd) <= zerocnt:
    for odd_node in odd:
        ans[odd_node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for even_node in even:
        ans[even_node] = rest.pop()

else:
    for num in nums[1]:
        ans[even.pop()] = num
    for num in nums[2]:
        ans[odd.pop()] = num
    rest = nums[0]
    for even_node in even:
        ans[even_node] = rest.pop()
    for odd_node in odd:
        ans[odd_node] = rest.pop()

print(*ans)

### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
n = int(input())

edge = [[] for i in range(n)]
ans = [-1] * n
odd = []
even =[]
nums = [[],[],[]]
for i in range(1,n+1):
    nums[i % 3].append(i)

def dfs(x, last = -1, d = 0):
    if d % 2 == 0: even.append(x)
    else: odd.append(x)
    for nxt in edge[x]:
        if nxt == last:continue
        dfs(nxt, x, d + 1)

for i in range(n-1):
    a, b = map(int, input().split())
    a-=1
    b-=1
    edge[a].append(b)
    edge[b].append(a)

dfs(0)

zerocnt = len(nums[0])

if len(even) <= zerocnt:
    for even_node in even:
        ans[even_node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for odd_node in odd:
        ans[odd_node] = rest.pop()

elif len(odd) <= zerocnt:
    for odd_node in odd:
        ans[odd_node] = nums[0].pop()
    rest = nums[0] + nums[1] + nums[2]
    for even_node in even:
        ans[even_node] = rest.pop()

# len
# nums[1] >= nums[2] >= nums[0] >= nums[1]-1
else:
    for num in nums[1]:
        ans[even.pop()] = num
    for num in nums[2]:
        ans[odd.pop()] = num
    rest = nums[0]
    for even_node in even:
        ans[even_node] = rest.pop()
    for odd_node in odd:
        ans[odd_node] = rest.pop()

print(*ans)
n = input().split()
print(int((n[2] + 0.5 ) / n[0]) * n[1])

### FIXED CODE ###

n = input().split()
ans = int( (int(n[2]) + 0.5) / int(n[0])) * int(n[1])
print(ans)
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 += [[c,b]]
cb = sorted(cb)[::-1]

def solve():
    p = 0
    q = 0
    ans = 0
    while p < n and q < m:
        if a[p] < cb[q][0]:
            if a [p + cb[q][1] - 1] < cb[q][0] and p + cb[q][1] - 1 < n:
                ans += cb[q][0] * cb[q][1]
                p = p + cb[q][1]
                q += 1
            else:
                for i in range(cb[q][1]):
                    if p + i == n:
                        return(ans)
                    elif a[p + i] < cb[q][0]:
                        ans += cb[q][0]
                    else:
                        ans += sum(a[p + i:])
                        return(ans)
        else:
            ans += sum(a[p:])
            return(ans)
    if p == n:
        return(ans)
    else:
        ans += sum(a[p:])
        return(ans)
print(solve())

### FIXED CODE ###

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

cb = []
for _ in range(m):
    b,c = map(int, input().split())
    cb.append([c, b])

a.sort()
cb.sort()

now = 0
finish = False
for i in range(m):
    b = cb[m - 1 - i][1]
    c = cb[m - 1 - i][0]
    for j in range(b):
        if now < n and a[now] < c:
            a[now] = c
            now += 1
        else:
            finish = True
            break
    if finish:
        break

print(sum(a))
#! /usr/bin/env python
# coding: UTF-8


def sad(list, b):
    value = 0
    n = 1
    for a in list:
        value += abs(a - (b+n))
        n += 1
    return value


def main():
    mn = 1000000
    n = (int)(input())
    lst = list(int(i) for i in input().split())
    mx = max(lst)
    for i in range(mx):
        if(sad(lst, i) < mn):
            mn = sad(lst, i)
    print(mn)

if __name__ == '__main__':
    main()

### FIXED CODE ###

#! /usr/bin/env python
# coding: UTF-8

def gcd(m, n):
    if n == 0:
        return m
    else:
        return gcd(n, m%n)

def main():
    n = int(input())

    print(int(n*2/gcd(n,2)))

if __name__ == '__main__':
    main()
s=input()
s.split()
if (int(s[0])+int(s[1]))>=int(s[3]):
  print('YES')
else:
  print('NO')

### FIXED CODE ###

s=input().split()
if (int(s[0])+int(s[1]))>=int(s[2]):
  print('Yes')
else:
  print('No')
n=int(input());print(+(n%100/(n//100)<=5))

### FIXED CODE ###

n=int(input())
try:print(+(n%100/(n//100)<=5))
except:print(+(n<1))
n, m, l = map(int,input().split())

x = []
y = []

for i in range(n):
    a = list(map(int,input().split()))
    x.append(a)
    
for i in range(m):
    b = list(map(int,input().split()))
    y.append(b)

#print(x)
a = 0
b = []
ans = []

for i in range(n):
    for j in range(m):
        for k in range(l):
            a += x[i][k]*y[k][j]
        #print(a)
        b.append(a)
        a = 0
    b = list(map(str, b))
    b = ' '.join(b)
    ans.append(b)
    b = []
        
[print(ans[i]) for i in range(len(ans))]


### FIXED CODE ###

n, m, l = map(int,input().split())

x = []
y = []

for i in range(n):
    a = list(map(int,input().split()))
    x.append(a)
    
for i in range(m):
    b = list(map(int,input().split()))
    y.append(b)

#print(x)
a = 0
b = []
ans = []

for i in range(n):
    for j in range(l):
        for k in range(m):
            a += x[i][k]*y[k][j]
        #print(a)
        b.append(a)
        a = 0
    b = list(map(str, b))
    b = ' '.join(b)
    ans.append(b)
    b = []
        
[print(ans[i]) for i in range(len(ans))]
n = int(input())
h = list(map(int,input().split()))

dp = [None]*n

for i in range(n):
  if i == 0:
    dp[i] = 0

  if i == 1:
    dp[1] = abs(h[1] - h[0])

  dp[i] = min(dp[i-2] + abs(h[i] - h[i-2]), dp[i-1] + abs(h[i] - h[i-1]))
  
  
print(dp[n-1])

### FIXED CODE ###

n = int(input())
h = list(map(int,input().split()))
 
dp = [None]*n
 
for i in range(n):
  if i == 0:
    dp[0] = 0
    continue
    
  if i == 1:
    dp[1] = abs(h[1] - h[0])
    continue
    
  dp[i] = min(dp[i-2] + abs(h[i] - h[i-2]), dp[i-1] + abs(h[i] - h[i-1]))
  
  
print(dp[n-1])
l,r=map(int,input().split())
k=min(l%2019,(r+1)%2019)
m=max(l%2019,(r+1)%2019)
a=list(range(k,m))
a.sort()
print(a[0]*a[1])

### FIXED CODE ###

l,r=map(int,input().split())
a=range(l,r+1)[:673]
print(min(i*j % 2019 for i in a for j in a if i<j))
X, t = list(map(int,input().split()))
print(max(X-t),0)

### FIXED CODE ###

X, t = list(map(int,input().split()))
print(max(X-t,0))
n=input()
l=map(int,input().split())
li=sorted(l)
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if li[i]!=li[j]!=li[k] and li[i]+li[j]>li[k]:
                ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
ans=0
l=map(int,input().split())
li=sorted(l)
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if li[i]!=li[j]!=li[k] and li[i]+li[j]>li[k]:
                ans+=1
print(ans)
x, t = map(int,input().split())

if x <= t:
  print(0)
else;
  print(x-t)


### FIXED CODE ###

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

if x <= t:
  print(0)
else:
  print(x-t)
A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for a in A:
  for b in B:
    for c in C:
      if a*500+b*100+c*50 == X:
        cnt += 1
print(cnt)


### FIXED CODE ###

A = int(input())
B = int(input())
C = int(input())
X = int(input())
cnt = 0
for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      if a*500+b*100+c*50 == X:
        cnt += 1
print(cnt)
import math

input()

vx = [int(i) for i in input().split()]
vy = [int(i) for i in input().split()]

Dxy = []
for p in range(1, 4):
    Dxy.append(sum([abs(xv[i] - vy[i]) ** p for i in range(len(vx))]) ** (1 / p))

Dxy.append(max([abs(vx[i] - vy[i]) for i in range(len(vx))]))

for res in Dxy:
    print('{0:5f}'.format(res))

### FIXED CODE ###

import math

input()

vx = [int(i) for i in input().split()]
vy = [int(i) for i in input().split()]

Dxy = []
for p in range(1, 4):
    Dxy.append(sum([abs(vx[i] - vy[i]) ** p for i in range(len(vx))]) ** (1 / p))

Dxy.append(max([abs(vx[i] - vy[i]) for i in range(len(vx))]))

for res in Dxy:
    print('{0:5f}'.format(res))
import numpy as np
n = int(input())

dp = np.zeros(n+1,np.int64)
#dp[1]=1
for i in range(1,n+1):
    for j in range(i,n+1,i):
        dp[j]+=1
dp*=np.arange(n+1)
print(dp.sum())


### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1,n+1):
    ans+=n//i*(n//i+1)//2*i
print(ans)
import math
a,b,c,d = map(int,input().split(' '))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
    
l_c = int((a-1)/c)
l_d = int((a-1)/d)
l_c_d = int((a-1)/lcm(c, d))

l_ans = a - 1 - (l_c + l_d - l_c_d)


g_c = int(b/c)
g_d = int(b/d)
g_c_d = int(b/lcm(c, d))
g_ans = b - (g_c + g_d - g_c_d)

print(g_ans - l_ans)


### FIXED CODE ###

a,b,c,d = map(int,input().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(x, y):
    ans = (x * y) // gcd(x, y)
    return ans

l_c = (a-1)//c
l_d = (a-1)//d
l_c_d = (a-1)//lcm(c, d)

l_ans = a - 1 - (l_c + l_d - l_c_d)


g_c = b//c
g_d = b//d
g_c_d = b//lcm(c, d)
g_ans = b - (g_c + g_d - g_c_d)

print(g_ans - l_ans)
n,x=map(int,input().split())
L = list(map(int, input().split()))
c = 0
D = 0
for i in L:
  	c = c + 1
    D = D + i
    if D > x:
        print(c)
        exit()
if D > x:
  print(c)
else:
  print(c+1)


### FIXED CODE ###

n,x=map(int,input().split())
L = list(map(int, input().split()))
c = 1
D = 0
for i in L:	
    D = D + i
    if D > x:
        print(c)
        exit()
    c = c + 1
print(c)
a = list(input())
b = list(input())
c = list(input())
x = "d"
a_idx = 0
b_idx = 0
c_idx = 0
while True:
    if x == "a":
        if a_idx == len(a):
            print("A")
            break
        else:
            x = str(a[a_idx])
            a_idx += 1
    elif x == "b":
        if b_idx == len(b):
            print(B)
            break
        else:
            x = str(b[b_idx])
            b_idx += 1
    elif x == "c":
        if c_idx == len(c):
            print("C")
            break
        else:
            x = str(c[c_idx])
            c_idx += 1
    else:
        x = "a"

### FIXED CODE ###

s=[input() for i in range(3)]
l=[len(s[i]) for i in range(3)]
abc=[0,0,0]
now=0
while abc[now]!=l[now]:
    s_sub=s[now][abc[now]]
    abc[now]+=1
    now=(0 if s_sub=="a" else 1 if s_sub=="b" else 2)
print("A" if now==0 else "B" if now==1 else "C")
n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0　and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print(ab+ba-1)
else:
    print(min(a,b)+ab+ba)

### FIXED CODE ###

n = int(input())
l = [input() for i in range(n)]
a = 0
b = 0
ba = 0
ab = 0
for i in range(n):
    if 'AB' in l[i]:
        for j in range(len(l[i])-1):
            if l[i][j] == 'A' and l[i][j+1] == 'B':
                ab += 1
    if l[i][0] =='B' and l[i][-1] == 'A':
        ba += 1
    elif l[i][-1] == 'A':
        a += 1
    elif l[i][0] == 'B':
        b += 1
if max(a,b) == 0 and ba <= 1:
    print(ab)
elif max(a,b) == 0:
    print(ab+ba-1)
else:
    print(min(a,b)+ab+ba)
import sys
def input(): return sys.stdin.readline().strip()

n=int(input())
xs=input()
xj=xs.count("1")

x=int(xs,2)
xip=x%(xj+1)
xim=x%(xj-1)

i1=1<<n
for i in range(n-1,-1,-1):
    i1=i1>>1
    xi=x^i1
    if xi==0:
        print(0)
        continue
    if xs[n-1-i]=="0":
        pxi=xj+1
#        xi=(xip+i1%pxi)%pxi
        xi=(xip+i1)%pxi
    else:
        pxi=xj-1
#        xi=(xim-i1%pxi)%pxi
        xi=(xim-i1)%pxi
#    xi=xi%pxi
    if xi==0:
        print(1)
        continue
    icnt=1
    while xi>0:
#        print("i",i,"xi",xi,"icnt",icnt)
        icnt+=1
        xi=xi%(bin(xi).count("1"))
    print(icnt)


### FIXED CODE ###

import sys
def input(): return sys.stdin.readline().strip()

n=int(input())
xs=input()
xj=xs.count("1")

x=int(xs,2)
xip=x%(xj+1)
if xj!=1:
    xim=x%(xj-1)

for i in range(n-1,-1,-1):
    if xs[n-1-i]=="0":
        pxi=xj+1
        i2=pow(2,i,pxi)
        xi=(xip+i2)%pxi
    elif xj==1:
        print(0)
        continue
    else:
        pxi=xj-1
        i2=pow(2,i,pxi)
        xi=(xim-i2)%pxi
    xi=xi%pxi
    if xi==0:
        print(1)
        continue
    icnt=1
    while xi>0:
#        print("i",i,"xi",xi,"icnt",icnt)
        icnt+=1
        xi=xi%(bin(xi).count("1"))
    print(icnt)
n,k=map(int,input().split())
a=[0]+[int(input())-k for i in range(n)]
for i in range(1,n+1):
	a[i]+=a[i-1]
b=sorted(a)+[-2e9-1]
c,d=0,dict()
for i in range(n+1):
	if b[i]!=b[i-1]:
		c+=1
		d[b[i]]=c
bit=[0]*n
def sum(i):
	res=0
	while i>0:
		res+=bit[i]
		i-=i&-i
	return res
def add(i):
	while i<=c:
		bit[i]+=1
		i+=i&-i
ans=0
for i in range(n+1):
	ans+=sum(d[a[i]])
	add(d[a[i]])
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
a=[0]+[int(input())-k for i in range(n)]
for i in range(1,n+1):
	a[i]+=a[i-1]
b=sorted(a)+[-2e9-1]
c,d=0,dict()
for i in range(n+1):
	if b[i]!=b[i-1]:
		c+=1
		d[b[i]]=c
bit=[0]*(n+5)
def sum(i):
	res=0
	while i>0:
		res+=bit[i]
		i-=i&-i
	return res
def add(i):
	while i<=c:
		bit[i]+=1
		i+=i&-i
ans=0
for i in range(n+1):
	ans+=sum(d[a[i]])
	add(d[a[i]])
print(ans)
import sys

s=list(input())
q=int(input())

for i in range(1,q+1):
    q_i=stdin.readline().rstrip().split()
    if q_i[0]=="1":
        s=s[::-1]
    else:
        if q_i[1]=="1":
            s=[q_i[2]]+s
        else:
            s=s+[q_i[2]]

s="".join(s)
print(s)

### FIXED CODE ###

from collections import deque

s=list(input())
s=deque(s)
q=int(input())

re=False
for i in range(1,q+1):
    q_i=input().split()
    if q_i[0]=="1":
        re= not re
    else:
        if q_i[1]=="1" and re==False:
            s.appendleft(q_i[2])
        elif q_i[1]=="2" and re==True:
            s.appendleft(q_i[2])
        else:
            s.append(q_i[2])

s=list(s)

if re==True:
    s=s[::-1]

s="".join(s)
print(s)
N, M = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for _ in range(M)]

UF = list(range(N + 1))
SIZE = [0] + [1] * N  # 1-indexed


def find(x):
    if UF[x] != x:
        UF[x] = find(UF[x])
    return UF[x]


def unite(x, y):
    if not is_same(x, y):
        X, Y = find(x), find(y)
        SX, SY = SIZE[X], SIZE[Y]
        if SX > SY:
            m = UF[X] = Y
        else:
            m = UF[Y] = X
        SIZE[m] = SX + SY
        SIZE[X + Y - m] = 0


def is_same(x, y):
    return find(x) == find(y)


def scan_uf():
    for i in range(len(UF)):
        find(i)


ans = [N * (N - 1) // 2]
for a, b in AB[::-1]:
    if not is_same(a, b):
        ans += [ans[-1] - SIZE[find(a)] * SIZE[find(b)]]
        unite(a, b)
    else:
        ans += [ans[-1]]
print(*ans[M - 1::-1], sep='\n')


### FIXED CODE ###

N, M = [int(_) for _ in input().split()]
AB = [[int(_) for _ in input().split()] for _ in range(M)]

UF = list(range(N + 1))
SIZE = [1] * (N + 1)


def find(x):
    if UF[x] != x:
        UF[x] = find(UF[x])
    return UF[x]


def unite(x, y):
    m = min(find(x), find(y))
    SIZE[m] = SIZE[find(x)] + SIZE[find(y)]
    UF[find(x)] = m
    UF[find(y)] = m


def is_same(x, y):
    return find(x) == find(y)


ans = [N * (N - 1) // 2]
for a, b in AB[::-1]:
    if not is_same(a, b):
        ans += [ans[-1] - SIZE[find(a)] * SIZE[find(b)]]
        unite(a, b)
    else:
        ans += [ans[-1]]
print(*ans[M - 1::-1], sep='\n')
from numpy import *

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

if len(A[A<0])%2 == 0:
    print(sum(abs(A)))
else:
    A = abs(A).sort()
    print(sum(A[1:]) - A[0])

### FIXED CODE ###

n = int(input())
*a, = map(int, input().split())
*a_abs, = map(abs, a)
if len([i for i in a if i<0])%2==0:
    print(sum(a_abs))
else:
    print(sum(a_abs)-2*min(a_abs))
inv=[0,1]
mod=10**9+7
for i in range(2,1000001):
  inv.append((m-inv[mod%i]*(m//i))%m)


### FIXED CODE ###

from copy import copy
def prime_table(n):
  n+=1
  table=[i if i%2 else 2 for i in range(n)]
  for i in range(3,n,2):
    if table[i]==i:
      for j in range(i*i,n,2*i):
        if table[j]==j:
          table[j]=i
  return table


def prime_fact(n,table):
  p=[]
  while n!=1:
    pp=table[n]
    p.append(pp)
    n//=pp
  r={}
  for i in p:
    if i in r:
      r[i]+=1
    else:
      r[i]=1
  return r



n=int(input())
t=prime_table(10**6)
a=list(map(lambda x:prime_fact(int(x),t),input().split()))

mx=copy(a[0])
for i in a[1:]:
  for j in i:
    if j in mx:
      mx[j]=max(mx[j],i[j])
    else:
      mx[j]=i[j]


sm=0
mod=10**9+7
for i in a:
  r=1
  for j in i:
    r=(r*pow(j,i[j],mod))%mod
  sm=(sm+pow(r,mod-2,mod))%mod

  
p=1
for i in mx:
  p=(p*pow(i,mx[i],mod))%mod

print((sm*p)%mod)
from math import gcd
n = int(input())
a = [int(x) for x in input().split()]

if n == 2:
    print(max(a))
else:
    x, y, z = a[0], a[1], a[2]
    p, q, r = gcd(x, y), gcd(y, z), gcd(z, x)
    gcd_max = max(p, q, r)
    if gcd_max == p:
        without = z
    elif gcd_max == q:
        without = x
    else:
        without = y

    k = gcd(gcd_max, without)   
    for i in range(3, n):
        a_i = a[i]
        if a_i % gcd_max != 0:
            l = gcd(gcd_max, a_i)
            if l >= k:
                gcd_max = l
            else:
                gcd_max = k
                without = a_i
        k = gcd(k, a_i)
    print(gcd_max)

### FIXED CODE ###

def gcd(p, q):
    if p < q:
        p, q = q, p
    while q > 0:
        p, q = q, p%q
    return p

n = int(input())
a = [int(x) for x in input().split()]

if n == 2:
    print(max(a))
else:
    x, y, z = a[0], a[1], a[2]
    p, q, r = gcd(x, y), gcd(y, z), gcd(z, x)
    gcd_max = max(p, q, r)
    if gcd_max == p:
        without = z
    elif gcd_max == q:
        without = x
    else:
        without = y

    k = gcd(gcd_max, without)   
    for i in range(3, n):
        a_i = a[i]
        if a_i % gcd_max != 0:
            l = gcd(gcd_max, a_i)
            if l >= k:
                gcd_max = l
            else:
                gcd_max = k
                without = a_i
        k = gcd(k, a_i)
    print(gcd_max)
#abc104c All Green
#全てとかない問いは一種類以下になるので、各問いに対し解く/解かないを決める

def dfs(i, sum, count, rest):
    global ans
    if i == d:
        if sum < g:
            rest_max = max(rest)
            n = min(l[rest_max-1][0], -(-(g-sum)//(rest_max*100)))
            count += n
            sum += n * rest_max * 100
        if sum >= g:
            ans = min(ans, count)
    else :
        dfs(i+1, sum, count, rest) #二分岐のうち解かない選択
        dfs(i+1, sum + l[i][0]*(i+1)*100, count + l[i][0], rest - {i+1}) #解く選択

d, g = map(int, input().split())
l = [list((map(int, input().split()))) for _ in range(d)]
ans = float("inf")
dfs(0, 0, 0, set(range(1, d+1)))
print(ans)



### FIXED CODE ###

#abc104c all green 
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
all_sum = []
for bit in range(1<<d):
    s = 0
    a = 0
    rest = []
    for i in range(d):
        if bit & (1<<i):
            s += pc[i][0]*100*(i+1) + pc[i][1]
            a += pc[i][0]
        else :
            rest.append(i)
    
    if s >= g :
        all_sum.append(a)
    else :
        k = max(rest)
        diff = g - s
        for j in range(pc[k][0]):
            if j*(k+1)*100 >= diff:
                all_sum.append(a+j)
print(min(all_sum))
n,k = int(input())
if n % k == 0:
    print(0)
else:
    print(1)

### FIXED CODE ###

n,k = map(int,input().split())
if n % k == 0:
    print(0)
else:
    print(1)
import sys


class UnionFind:
    def __init__(self, n):
        self.table = [-1] * n

    def _root(self, x):
        stack = []
        tbl = self.table
        while tbl[x] >= 0:
            stack.append(x)
            x = tbl[x]
        for y in stack:
            tbl[y] = x
        return x

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            self.table[r1] += d2
        else:
            self.table[r1] = r2
            self.table[r2] += d1


def main():
    n, m, k = map(int, sys.stdin.buffer.readline().split())
    uf = UnionFind(n)
    fb = [0]*n
    i = 0
    for x in sys.stdin.buffer.readlines():
        print(uf.table)
        if i < m:
            a, b = map(int, x.split())
            fb[a-1] += 1
            fb[b-1] += 1
            uf.union(a-1, b-1)
        else:
            c, d = map(int, x.split())
            if uf._root(c-1) == uf._root(d-1):
                fb[c-1] += 1
                fb[d-1] += 1
        i += 1

    ans = [-uf.table[uf._root(i)]-1-fb[i] for i in range(n)]
    print(*ans)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys


class UnionFind:
    def __init__(self, n):
        self.table = [-1] * n

    def _root(self, x):
        stack = []
        tbl = self.table
        while tbl[x] >= 0:
            stack.append(x)
            x = tbl[x]
        for y in stack:
            tbl[y] = x
        return x

    def find(self, x, y):
        return self._root(x) == self._root(y)

    def union(self, x, y):
        r1 = self._root(x)
        r2 = self._root(y)
        if r1 == r2:
            return
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            self.table[r1] += d2
        else:
            self.table[r1] = r2
            self.table[r2] += d1


def main():
    n, m, k = map(int, sys.stdin.buffer.readline().split())
    uf = UnionFind(n)
    fb = [0]*n
    i = 0
    for x in sys.stdin.buffer.readlines():
        if i < m:
            a, b = map(int, x.split())
            fb[a-1] += 1
            fb[b-1] += 1
            uf.union(a-1, b-1)
        else:
            c, d = map(int, x.split())
            if uf._root(c-1) == uf._root(d-1):
                fb[c-1] += 1
                fb[d-1] += 1
        i += 1

    ans = [-uf.table[uf._root(i)]-1-fb[i] for i in range(n)]
    print(*ans)


if __name__ == "__main__":
    main()
X,N = map(int,input().split())
P = list(map(int,input().split()))

result = 0
if N == 0:
    result = X
else:
    list = [i for i in range(101)]
    for i in P:
        list.remove(i)
    for i in range(len(list)):
        list[i] = abs(list[i] - X)
    list.sort()
    if list[0] == list[1]:
        result = X - list[0]
    else:
        result = X + list[0]
print(result)

### FIXED CODE ###

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

result = 0
if N == 0:
    result = X
else:
    list = [i for i in range(201)]
    for i in P:
        list.remove(i)
    if len(list) == 0:
        result = 0
    else:
        min = 100
        for i in list:
            if min > abs(X-i):
                min = abs(X - i)
                result = i
print(result)