Harryxun/stf_run huggingface dataset:
import numpy as np

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

if N != 0:
    
    p_list = [int(n) for n in input().split()]
    
    X_near = np.array(list(range(int(np.ceil(X - N/2)), int(np.floor(X + N/2)) + 1)))
 
    remain_list = []
 
    for i in X_near:
        if i not in p_list:
            remain_list.append(i)
        

    remain_array = np.array(remain_list)
    min_bool = np.abs(X - remain_array).min() == np.abs(X - remain_array)
    print(remain_array[min_bool].min())
    
else:
    print(X)

### FIXED CODE ###

import numpy as np
 
X,N = map(int,input().split())
p = input()
 
if N != 0:
    
    p_list = [int(n) for n in p.split()]
    
    X_near = np.array(list(range(int(np.ceil(X - N/2 - 1)), int(np.floor(X + N/2)) + 2)))
 
    remain_list = []
 
    for i in X_near:
        if i not in p_list:
            remain_list.append(i)
        
 
    remain_array = np.array(remain_list)
    min_bool = np.abs(X - remain_array).min() == np.abs(X - remain_array)
    print(remain_array[min_bool].min())
    
if N == 0:
    print(X)
N,M=map(int, input().split())
yoi = []
for i in range(N):
  yoi.append(True)
H=list(map(int, input().split()))
for i in ranage(M):
  A,B=map(int, input().split())
  if H[A-1]<=H[B-1]: yoi[A-1]=False
  if H[B-1]<=H[A-1]: yoi[B-1]=False 
print(len([1 for x in yoi if x==True]))

### FIXED CODE ###

N,M=map(int, input().split())
yoi = []
for i in range(N):
  yoi.append(True)
H=list(map(int, input().split()))
for i in range(M):
  A,B=map(int, input().split())
  if H[A-1]<=H[B-1]: yoi[A-1]=False
  if H[B-1]<=H[A-1]: yoi[B-1]=False 
print(len([1 for x in yoi if x==True]))
opt=input()
sum=700
if opt[0] == o:
  sum+=100
if opt[1] == o:
  sum+=100
if opt[2] == o:
  sum+=100
print(sum)

### FIXED CODE ###

opt=input()
sum=700
if opt[0] == 'o':
  sum+=100
if opt[1] == 'o':
  sum+=100
if opt[2] == 'o':
  sum+=100
print(sum)
r = input()
print(pow(r,2))

### FIXED CODE ###

r = int(input())
print(pow(r, 2))
A, B = map(int, input())

for p in range(13, 1250):
	if int(p * 0.08) == A and int(p * 0.1) == B:
		print(p)
		exit()

print(-1)


### FIXED CODE ###

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

for p in range(13, 1250):
	if int(p * 0.08) == A and int(p * 0.1) == B:
		print(p)
		exit()

print(-1)
D, T, S = (int(d) for d in input().split())

if T * s >= D:
    print("Yes")

else:
    print("No")

### FIXED CODE ###

D, T, S = (int(d) for d in input().split())

if T * S >= D:
    print("Yes")

else:
    print("No")
n,q = map(int, input().split())
edge = [[] for _ in range(n)]
counter = [0]*n
for _ in range(n-1):
    a, b = map(int, input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
for _ in range(q):
    a, b = map(int, input().split())
    counter[a-1] += b
def dfs(start, prev):
    for i in edge[start]:
        if i == prev: continue
        counter[i] += counter[start]
        dfs(i, start)
dfs(0, -1)
print(*counter)

### FIXED CODE ###

from collections import deque
n, q = map(int, input().split())
g = [[] for _ in range(n)]
for _ in range(n-1):
    a, b = map(int, input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
count = [0]*n
for i in range(q):
    p, x = map(int, input().split())
    count[p-1] += x
q = deque([0])
d = [0]*n
while q:
    v = q.popleft()
    d[v] = 1
    for i in g[v]:
        if d[i]:
            continue
        count[i] += count[v]
        q.append(i)
print(*count)
N, K = map(int,input().split())
print(int(K * ((K-1)**(N-1))))

### FIXED CODE ###

mylist = input().split()
print(len(set(mylist)))
A, B = [int(i) for i in input().split()]

def gcd(x, y):
    r = x % y
    while r > 0:
        x = y
        y = r
        r = x % y
    
    return y

def cd (x, y):
    a = gcd(x, y)
    cd_list = []

    i = 1
    while i**2 <= a:
        if a % i == 0:
            cd_list.append(i)
            cd_list.append(int(a/i))
        i += 1

    cd_list.sort()

    return cd_list, len(cd_list)

cd_list, length = cd(A, B)
f_list = [0] * length
for i in range(1, length - 1):
    for j in range(i + 1, length):
        if cd_list[j] % cd_list[i] == 0:
            f_list[j] = 1
            count += 1

print(length - count)


### FIXED CODE ###

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

def is_remainder(n):
    if n == 1:
        return True

    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    
    return True
        

A, B = [int(i) for i in input().split()]

import fractions
n = fractions.gcd(A, B)
divisors = make_divisors(n)
N = len(divisors)

count = 0
flag = [0] * N
for item in divisors:
    if is_remainder(item):
        count += 1

print(count)
# coding: utf-8

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

# N = int(input())
# L = [int(x) for x in input().split()]
W, H, x, y = map(int, input().split())
# S = input()

ko = [-1] * 3
ko[0] = min(x * H, (W - x) * H)
ko[1] = min(y * W, (H - y) * W)
if (x, y) == (0, 0) or (x, y) == (0, H) or (x, y) == (W, 0) or (x, y) == (W, H) or y / x == H / W:
    ko[2] = (W * H) / 2

maxm = max(ko)
print(maxm, 1 if ko.count(maxm) > 1 else 0)


### FIXED CODE ###

# coding: utf-8

import sys
import math
import collections
import itertools
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

W, H, x, y = LI()

print((W*H)/2, 1 if x*2 == W and y*2 == H else 0)
n = int(input())
a = kist(map(int,input().split()))
a.sorted
i for i in range(n):
  if a[i-1] == a[i] or a[i] == a[i+1]:
print('No')
  else:
print('Yes')

### FIXED CODE ###

n=int(input())
if len(set(map(int,input().split())))==n:
  print('YES')
else:
  print('NO')
A,op,B = [x for x in input().split()]
A = int(A)
B = int(B)
if(op = '+'):
  print(A+B)
else:
  print(A-B)

### FIXED CODE ###

A,op,B = [x for x in input().split()]
A = int(A)
B = int(B)
if(op == '+'):
  print(A+B)
else:
  print(A-B)
# 2019/07/16
# AtCoder Grand Contest 021 - A
# For the answer: 
# 1. 桁分割、桁数Count
# 2-1. 上位桁から9以外を探索
# 2-2. 9以外があれば、その1つ上桁を-1
# 2-3. ただし先頭の場合は自身を-1
# 3. (桁数-1)*9 + 上位桁-1

# Input
n = int(input())

# 1.
wn = n
ketalist = list()
while wn > 0:
    ketalist.append(wn % 10)
    wn = int(wn / 10)

# 2. 
ketalist.reverse()
for i in range(len(ketalist)):
    if ketalist[i] < 9:
        if i == 0:
            tgtnum = ketalist[i] - 1
        else:
            tgtnum = ketalist[i-1] - 1
        break

# 3.
if ketalist[0] == 1:
    ans = (len(ketalist) - 1) * 9
else:
    ans = (len(ketalist) - 1) * 9 + tgtnum

# Output
print(ans)


### FIXED CODE ###

# 2019/07/17
# AtCoder Grand Contest 021 - A
# For the answer: 
# 1. 桁分割、桁数Count
# 2-1. 上位桁から9以外を探索
# 2-2. 9以外があれば、その1つ上桁を-1
# 2-3. ただし先頭の場合は自身を-1
# 3. (桁数-1)*9 + 上位桁-1

# Input
n = int(input())

# 1.
wn = n
ketalist = list()
defans = 0
while wn > 0:
    remn = wn % 10
    defans = defans + remn
    ketalist.append(remn)
    wn = int(wn / 10)

# 2. 
ketalist.reverse()
allflg = False
for i in range(len(ketalist)):
    if ketalist[i] < 9:
        if i == 0:
            tgtnum = ketalist[i] - 1
        else:
            tgtnum = ketalist[i-1] - 1
        break
    # Case all 9:
    if i == len(ketalist) - 1:
        allflg = True

# 3.
if len(ketalist) > 1 and allflg == False:
    if ketalist[0] == 1:
        ans = (len(ketalist) - 1) * 9
    else:
        ans = (len(ketalist) - 1) * 9 + tgtnum
elif len(ketalist) > 1 and allflg == True:
    ans = len(ketalist) * 9
else:
    ans = n

# Output
print(max(ans, defans))
N=int(input())
a = list(map(int, input().split()))
cnt=[0]*10009
for t in a:
    cnt[t] += 1
    cnt[t-1] += 1
    cnt[t+1] += 1
print(max(cnt))

### FIXED CODE ###

N=int(input())
a = list(map(int, input().split()))
cnt=[0]*100009
for t in a:
    cnt[t] += 1
    cnt[t-1] += 1
    cnt[t+1] += 1
print(max(cnt))
n = int(input())
maxHeight = 0
cnt = 0
for _ in range(n):
  mt = list(map(int, input().split()))
for i in range(n):
  if mt[i] >= maxHeight:
    maxHeight = mt[i]
    cnt += 1
print(cnt)

### FIXED CODE ###

n = int(input())
maxHeight = 0
cnt = 0
mt = list(map(int, input().split()))
for i in range(n):
  if mt[i] >= maxHeight:
    maxHeight = mt[i]
    cnt += 1
print(cnt)
def mcm(M):
  n = len(M)
  m = [[0 for i in range(n)] for j in range(n)]
  
  for l in range(2, n):
    for i in range(1, n-l+1):
      j = i + l - 1
      def cost(i, k ,j):
        return m[i][k] + m[k+1][j] + M[i][0]*M[k][1]*M[j][1]
      m[i][j] = min(cost(i, k, j) for k in range(i, j-1))
  
  return m[0][n-1]

n = input()
for i in range(n):
  M.append(map(int, raw_input().split()))
print mcm(M)

### FIXED CODE ###

def mcm(M):
  n = len(M)
  m = [[0 for i in range(n)] for j in range(n)]
  
  for l in range(2, n+1):
    for i in range(0, n-l+1):
      j = i + l - 1
      def cost(i, k ,j):
        return m[i][k] + m[k+1][j] + M[i][0]*M[k][1]*M[j][1]
      m[i][j] = min(cost(i, k, j) for k in range(i, j))
  
  return m[0][n-1]

n = input()
M = []

for i in range(n):
  M.append(map(int, raw_input().split()))
print mcm(M)
n, q = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(n-1)]
px = [list(map(int, input().split())) for i in range(q)]

cnt = [0] * n
tree = {}
subt = {}
for i in range(n-1):
    tree.setdefault(ab[i][0], [])
    tree[ab[i][0]].append(ab[i][1])

def pt(node, subt):
    if not node in subt:
        part = []
        if node in tree:
            for i in range(len(tree[node])):
                part += pt(tree[node][i], subt)
        subt.setdefault(node, [node]+part)
    return subt[node]

for i in range(q):
    for j in pt(px[i][0], subt):
        cnt[j-1] += px[i][1]
print(" ".join(map(str, cnt)))

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(300000)

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

root = [[] for _ in range(n+1)]
for i in range(n-1):
    a, b = map(int, input().split())
    root[a].append(b)
    root[b].append(a)
    
cnt = [0 for _ in range(n+1)]
for i in range(q):
    p, x = map(int, input().split())
    cnt[p] += x

def rec(node, parent):
    for i in root[node]:
        if i == parent:
            continue
        cnt[i] += cnt[node]
        rec(i, node)

rec(1, 1)
print(" ".join(map(str, cnt[1:])))
a = [*map(int,input().split(' '))]
b = [*map(int,input().split(' '))]
for i in range(4):
	if a[i] == b[i]:
		hit += 1
		elif a[i] == b[i-1]:
			blow += 1
print(hit, blow)


### FIXED CODE ###

while 1:
	hit = blow = 0
	try: a = list(map(int,input().split()))
	except: break
	b = list(map(int,input().split()))
	for i in range(4):
		if a[i] == b[i]:
			hit += 1
		elif a[i] in b:
			blow += 1
	print(hit, blow)
n = int(input())
h = list(map(int, input().split()))
w = 1
for i in range(n-1):
    if h[i] - h[i+1] >= 2:
        w = 0
for j in range(n-2):
    if h[j] - h[j+1]  == 1:
        if h[j+1] - h[j+2] == 1:
            w = 0
if h[n-3] == h[n-2] and h[n-2] == h[n-1] +1:
    w = 0
        
if w == 0:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

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


w = 1
for i in range(n-1):
    if h[i] - h[i+1] >= 2:
        w = 0

for j in range(n-2):
    if h[j] - h[j+1]  == 1:
        for k in range(j,n-2):
            if h[k+1] - h[k+2] == 0:
                continue
            if h[k+1] - h[k+2] == 1:
                w = 0
                break
            break


        
if w == 0:
    print("No")
else:
    print("Yes")
N,M = map( int,input().split())
A = list(map(int,input().split())
print(max(-1),N - sum(A))

### FIXED CODE ###

N,M = map( int, input().split() )
A = list( map(int, input().split() ))
print(max(-1, N - sum(A)))
x1, y1, x2, y2 = map(int, input().split())
nx = x2
ny = y2
l = []
for i in range(2) :
    dx, dy = -dy, dx
    nx += dx
    ny += dy
    l.append(nx)
    l.append(ny)
print(l[0], l[1], l[2], l[3])


### FIXED CODE ###

x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
nx = x2
ny = y2
l = []
for i in range(2) :
    dx, dy = -dy, dx
    nx += dx
    ny += dy
    l.append(nx)
    l.append(ny)
print(l[0], l[1], l[2], l[3])
import math
import sys

def func(a,b,c,d,e,f):
    try:
        aa = a * a
        bb = b * b
        cc = c * c
        dd = d * d
        ee = e * e
        ff = f * f

        py = ((e - a) * (aa + bb - cc - dd) - (c - a) * (aa + bb - ee- ff)) / (2 * (e - a)*(b - d) - 2 * (c - a) * (b - f))

        px = (2 * (b - f) * py - aa - bb + ee + ff) / (2 * (e - a)) \
            if (c == a) else (2 * (b - d) * py - aa - bb + cc + dd) / (2 * (c - a))

        r = math.hypot(px - a, py - b)
        return px,py,r

    except ZeroDivisionError:
        return 0,0,10**6

n=int(input())

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


if n==2:
    print(math.hypot(x[0]-x[1],y[0]-y[1])/2)
    sys.exit()
elif n==3:
    px,py,r=func(x[0],y[0],x[1],y[1],x[2],y[2])
    print(r)
    sys.exit()
    

minr=10**6
for i in range(n-2):
    for j in range(i+1,n-1):
        for k in range(j+1,n):
            px,py,r=func(x[i],y[i],x[j],y[j],x[k],y[k])

            sgn=1
            for p in range(n):
                if math.hypot(x[p]-px,y[p]-py)>r:
                    sgn=0
            if sgn==1: minr=min(minr,r)

print(minr)

### FIXED CODE ###

n=input()
ans=chr(ord(n)+1)

print(ans)
n,r=map(int,input().split())
if n>10:
	print(r)
else:
	print(r-1000+100*k)

### FIXED CODE ###

n,r=map(int,input().split())
if n>10:
	print(r)
else:
	print(r+1000-100*n)
a,b = int(input().split())
S = a*b
L = 2*(a+b)
print(S,end="")
print(L)

### FIXED CODE ###

a,b = map(int,input().split())
S = a*b
L = 2*(a+b)
print(S,end=" ")
print(L)
n, k = map(int, input().split())
p = list(map(int, input().split()))

kitaiti = [0 for _ in range(n)]
ruisekiwa = [0 for _ in range(n)]
r = k - 1
max = 0
ans_list = []

for i in range(n):
    kitaiti[i] = (p[i]+1) / 2
    if i == 0:
        ruisekiwa[0] = kitaiti[0]
    else:
        ruisekiwa[i] = ruisekiwa[i-1] + kitaiti[i]
    if i == r:
        now = ruisekiwa[i]
    elif i > r:
        now = ruisekiwa[i] - ruisekiwa[i-r-1]
    if now > max:
        max = now
print(max)

### FIXED CODE ###

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

kitaiti = [0 for _ in range(n)]
ruisekiwa = [0 for _ in range(n)]
r = k - 1
max = 0
now = 0
ans_list = []

for i in range(n):
    kitaiti[i] = (p[i]+1) / 2
    if i == 0:
        ruisekiwa[0] = kitaiti[0]
    else:
        ruisekiwa[i] = ruisekiwa[i-1] + kitaiti[i]
    if i == r:
        now = ruisekiwa[i]
    elif i > r:
        now = ruisekiwa[i] - ruisekiwa[i-r-1]
    if now > max:
        max = now
print(max)
import math
A,B,K=map(int,input().split())
C=math.gcd(A,B)
cnt=0
for x in range(C,-1,-1):
    if C%x==0:
        cnt+=1
        if cnt==K:
            print(x)
            break



### FIXED CODE ###

import fractions
A,B,K=map(int,input().split())
C=fractions.gcd(A,B)
cnt=0
for x in range(C,0,-1):
    if C%x==0:
        cnt+=1
        if cnt==K:
            print(x)
            break
N, A = map(int, input().split())
x = [int(i) for i in input().split()]

# 3d DP
max_x = max(x)

dp = [[[0] * (max_x * N + 1) for j in range(N + 1)]
                             for i in range(N + 1)]

dp[0][0][0] = 1

for i in range(0, N):
    for k in range(0, N + 1):
        for y in range(max_x * N + 1):
            dp[i + 1][k][y] += dp[i][k][y]
            dp[i + 1][k + 1][y + x[i]] += dp[i][k][y]

cnt = 0
for k in range(1, N + 1):
    for y in range(1, max_x * N + 1):
        if y // k == A and y % k == 0:
            cnt += dp[N][k][y]

print(cnt)

### FIXED CODE ###

import sys
from collections import Counter

def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

def solve():
    N, A = map(int, input().split())
    x = [int(i) for i in input().split()]

    # 3d DP
    max_x = max(x)

    dp = [[[0] * (max_x * N + 1) for j in range(N + 1)]
                                 for i in range(N + 1)]

    dp[0][0][0] = 1

    for i in range(0, N):
        for k in range(0, N + 1):
            for y in range(max_x * N + 1):
                if dp[i][k][y]:
                    dp[i + 1][k][y] += dp[i][k][y]
                    dp[i + 1][k + 1][y + x[i]] += dp[i][k][y]

            # print(dp[i][k])
        # print()

    cnt = 0
    for k in range(1, N + 1):
        for y in range(1, max_x * N + 1):
            if y // k == A and y % k == 0:
                cnt += dp[N][k][y]

    print(cnt)

if __name__ == '__main__':
    solve()
# coding:utf-8
import sys
import datetime

H1 = int(sys.stdin.readline())
M1 = int(sys.stdin.readline())
H2 = int(sys.stdin.readline())
M2 = int(sys.stdin.readline())
K = int(sys.stdin.readline())


while not (0 <= H1 < 23 or 0 <= M1 < 59 or 0 <= H2 < 23 or 0 <= M2 < 59):
    H1 = int(sys.stdin.readline())
    M1 = int(sys.stdin.readline())
    H2 = int(sys.stdin.readline())
    M2 = int(sys.stdin.readline())
    K = int(sys.stdin.readline())

if M2 >= M1:
    a = (H2 - H1) * 60 + M2 - M1
    print(a - K)
if M2 < M1:
    b = (H2 - H1) * 60 + M1 - M2
    print(b - K)

### FIXED CODE ###

import sys
readline = sys.stdin.buffer.readline

h1, m1, h2, m2, k = map(int, readline().split())
print(60 * (h2 - h1) + m2 - m1 - k)
A,B =map(int, raw_input().split())
print(A*B, A*2 + B*2)

### FIXED CODE ###

a, b = map(int, input().split())
print(a*b, a*2 + b*2)
M = 10**9 + 7
a = [1] + [0] * 12
p = 1
for c in reversed(input()):
    r = (0, p * 10) if c == '?' else (int(c), int(c) + 1)
    a = [sum(a[(i - j) % 13] for j in range(*r, p)) % M for i in range(13)]
    p = p * 10 % 13
print(a[5])


### FIXED CODE ###

M = 10**9 + 7
a = [1] + [0] * 12
p = 1
for c in reversed(input()):
    r = range(10) if c == '?' else (int(c),)
    a = [sum(a[(i - p * j) % 13] for j in r) % M for i in range(13)]
    p = p * 10 % 13
print(a[5])
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(map(int,input().split()))
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

N = i()
A = [26**i for i in range(1,100)]
A = [0]+list(itertools.accumulate(A))
cnt = 0
for i in range(N):
    if A[i] >= N:
        p = cnt
        break
    cnt += 1
if p == 1:
    print(chr(N+96))
    exit()
s = []
if N in A:
    print('z'*p)
    exit()
for i in range(p-1):
    if N%26 == 0:
        s.append(chr(97))
    else:
        s.append(chr(N%26+96))
    N = N//26
    print(N%26)
s.append(chr(N+96))
s.reverse()
print(''.join(s))

### FIXED CODE ###

import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7

N = i()
S = []
for i in range(1,100):
    if N < 27:
        break
    N -= 1
    S.append(chr(ord('a')+N%26))
    N = N//26
S.append(chr(ord('a')+N-1))
print(''.join(S[::-1]))
def abs(n, k):
    if n - k >= 0:
        return n-k
    else:
        return k-n
        
N, K = map(int, input().split())
while N > abs(N-K):
    N, K = abs(N-K), K
print(N)


### FIXED CODE ###

N, K = map(int, input().split())
r = N % K
print(min(r, K-r))
x, n = map(int, input().split())
if n == 0:
    print(x)
    exit()
p = list(map(int, input().split()))
ans = 9999999999
lists = []
for i in range(1, 101):
    if i not in p:
        lists.append(i)
for i in lists:
    if ans > abs(x - i):
        ans = abs(x-i)
        m = i

print(m)


### FIXED CODE ###

x,n = map(int,input().split())
p = list(map(int,input().split()))
p.sort()
li = []
ans = []
Min_sa = 9999999999
for i in range(-200,201):
    if i not in p:
        li.append(i)
for i in li:
     Min_sa = min(Min_sa,abs(x-i))
for i in li:
    if abs(x-i) == Min_sa:
        ans.append(i)
print(min(ans))
N, M = map(int, input().split())
drink = []
cost = 0
count = 0
d_count = 0
rest = 0


for i in range(N):
    Drink = list(map(int, input().split()))
    drink.append(Drink)
    drink.sort()
    for j in range(drink[i][1]):
      d_count += 1
      cost += drink[i][0]
      if d_count == M or d_count == drink[i][1]
print(cost)

### FIXED CODE ###

N, M = map(int, input().split())
drink = []
cost = 0
d_count = 0


for _ in range(N):
    drink.append(list(map(int, input().split())))
    
drink = sorted(drink)

for i in range(N):
    cost += drink[i][0] * drink[i][1]
    d_count += drink[i][1] 
    if d_count > M:
      cost -= drink[i][0] * (d_count - M)
      break
      

print(cost)
count = int(input())
 
str_data = {}
 
for i in range(count):
  judge_str = ''.join(sorted(input()))
  if judge_str in str_data:
    str_data[judge_str] += 1
  else:
    str_data[judge_str] = 0
 
print(sum(str_data.values())

### FIXED CODE ###

count = int(input())
 
str_data = dict()
result = 0
for i in range(count):
    judge_str = ''.join(sorted(input()))
    if judge_str in str_data:
        str_data[judge_str] += 1
        result += str_data[judge_str]
    else:
        str_data[judge_str] = 0
    
print(result)
# coding: utf-8
# Here your code !
import math

r = int(input())

print("{0:.8f}".format(r ** 2 * math.pi))

### FIXED CODE ###

from math import pi

r = float(input())
print(r**2 * pi, 2 * r * pi)
x, k, d = map(int,input().split())
x =abs(x)
s = x//d
if x-k*d>0:
  print(x-k*d>0)
else:
    if (K-s)%2==0:
        print(X-s*D)
    else:
        print(-X+(s+1)*D)


### FIXED CODE ###

x, k, d = map(int,input().split())
x =abs(x)
s = x//d
if x-k*d>0:
  print(x-k*d)
else:
    if (k-s)%2==0:
        print(x-s*d)
    else:
        print(-x+(s+1)*d)
import math

A,B,H,M =int(input("A :")),int(input("B :")),int(input("H :")),int(input("M :"))
if 1<=A<=1000 and 1<=B<=1000 and 0<=H<=11 and 0<=M<=59:
    hw=(2*math.pi)/(12*60*60) #時針の角速度[rad/s]
    mw=(2*math.pi)/(60*60) #分針の角速度[rad/s]
    time_h=H*60*60 #Hour時間[s] 
    time_m=M*60 #Min時間[s]
    aw=hw*(time_h+time_m) #Arad[rad] #最後の鬼門だった！！なるほどね！40min経ってる間に時針も進んでるから。。
    bw=mw*time_m #Brad[rad]
    rad=abs(bw-aw)
    # 正弦定理で出力結果を得る(a^2=b^2+c^2-2bccosθ)
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(rad)))
    #確認用
    #print(time_h,time_m,aw,bw,rad) 
else: 
    print("各値の条件は次の通り:1<=A,B<=1000,0<=H<=11,0<=M<=59")
    print("あなたの入力:A={},B={},H={},M={}".format(A,B,H,M))

### FIXED CODE ###

import math

A,B,H,M =map(int, input().split())
if 1<=A<=1000 and 1<=B<=1000 and 0<=H<=11 and 0<=M<=59:
    hw=(2*math.pi)/(12*60*60) #時針の角速度[rad/s]
    mw=(2*math.pi)/(60*60) #分針の角速度[rad/s]
    time_h=H*60*60 #Hour時間[s] 
    time_m=M*60 #Min時間[s]
    aw=hw*(time_h+time_m) #Arad[rad] #最後の鬼門だった！！なるほどね！40min経ってる間に時針も進んでるから。。
    bw=mw*time_m #Brad[rad]
    rad=abs(bw-aw)
    # 正弦定理で出力結果を得る(a^2=b^2+c^2-2bccosθ)
    print(math.sqrt(A**2+B**2-2*A*B*math.cos(rad)))
    #確認用
    #print(time_h,time_m,aw,bw,rad) 
else: 
    print("各値の条件は次の通り:1<=A,B<=1000,0<=H<=11,0<=M<=59")
    print("あなたの入力:A={},B={},H={},M={}".format(A,B,H,M))