Harryxun/stf_run huggingface dataset:
a, b = input().split()
A = int(a)
B_list = list(b)
 
count = -1
check = -1
B = ""
 
for char in B_list:
  if char == ".":
    count = 0
    check = 0
  else:
    if check == 0:
      if count >= 0:
        count += 1
    B += char
 
result = A * int(B)  
result_list = list(str(result))
if count >= len(result_list):
  for n in range(count - len(result_list) + 1):
    result_list.insert("0", 0)
else:
  result_list.insert(- count, ".")
answer = ""
for char in result_list:
  if char == ".":
  	break
  answer += char
print(answer)

### FIXED CODE ###

from decimal import*
a,b=map(Decimal,input().split())
print(int(a*b))
dic={}
a=[[0 for i in range(3)]for j in range(3)]
for i in range(1,100):
    dic[i]=[-1,-1]
for i in range(3):
    a[i]= list(map(int,input().split()))
    for j in range(3):
        dic[a[i][j]]=[i,j]
n=int(input())
for i in range(n):
    x=int(input())
    if(dic[x]!=[-1,-1]):
        a[dic[x][0],dic[x][1]]=0
flag=0
for i in range(3):
    if(max(a[i][1],a[i][2],a[i][0])==0):
        flag=1
        break
    elif(max(a[1][i],a[2][i],a[0][i])==0):
        flag=1
        break
if(max(a[0][0],a[1][1],a[2][2])==0):
    flag=1
elif(max(a[0][2],a[1][1],a[2][0])==0):
    flag=1
if(flag==1):
    print ('Yes')
else:
    print ('No')

### FIXED CODE ###

dic={}
a=[]
for i in range(1,100):
    dic[i]=[-1,-1]
for i in range(3):
    a.append(list(map(int,input().split())))
    for j in range(3):
        dic[a[i][j]]=[i,j]
n=int(input())
for i in range(n):
    x=int(input())
    if(dic[x]!=[-1,-1]):
        a[dic[x][0]][dic[x][1]]=0
flag=0
for i in range(3):
    if(max(a[i][1],a[i][2],a[i][0])==0):
        flag=1
        break
    elif(max(a[1][i],a[2][i],a[0][i])==0):
        flag=1
        break
if(max(a[0][0],a[1][1],a[2][2])==0):
    flag=1
elif(max(a[0][2],a[1][1],a[2][0])==0):
    flag=1
if(flag==1):
    print ('Yes')
else:
    print ('No')
def dot(a, b):
    return (a.real*b.real - a.imag*b.imag)
def cross(a, b):
    return (a.real*b.imag - a.imag*b.real)

EPS = 10**(-7)

def isIntersectedLS(a1, a2, b1, b2):
    return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1)) < EPS and
            (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1)) < EPS)

while 1:
    try:
        x1,y1,x2,y2,x3,y3 = (0,0,0,0,0,0)
        a = []
        xp,yp = (0,0)
        x1,y1,x2,y2,x3,y3,xp,yp = map(float, raw_input().split())
        a.append(x1+(y1)*1j)
        a.append(x2+(y2)*1j)
        a.append(x3+(y3)*1j)
        c = (x1+x2+x3)/3+((y1+y2+y3)/3)*1j
        p = xp+yp*1j
            
        for i in xrange(3):
            #print a, c, p
            if isIntersectedLS(a[i-1], a[i], c, p) is True:
                print "NO"
                break
        else:
            print "YES"
            
    except EOFError:
        break

### FIXED CODE ###

def dot(a, b):
    return (a.real*b.real - a.imag*b.imag)
def cross(a, b):
    return (a.real*b.imag - a.imag*b.real)

EPS = 10**(-7)

def isIntersectedLS(a1, a2, b1, b2):
    return ((cross(a2-a1, b1-a1) * cross(a2-a1, b2-a1)) < EPS and
            (cross(b2-b1, a1-b1) * cross(b2-b1, a2-b1)) < EPS)

while 1:
    try:
        x,y = [[0. for i in xrange(3)] for j in xrange(2)]
        a = []
        z = [0. for i in xrange(2)]
        line = raw_input().split()
        if line == []: break
        x[0],y[0],x[1],y[1],x[2],y[2],z[0],z[1] = map(float, line)
        for i in xrange(3):
            a.append((x[i]+(y[i])*1j))
        c = (sum(x)/3)+(sum(y)/3)*1j
        p = z[0]+z[1]*1j
           
        for i in xrange(3):
            #print a, c, p
            if isIntersectedLS(a[i-1], a[i], c, p) is True:
                print "NO"
                break
        else:
            print "YES"
           
    except EOFError:
        break
N=int(input())
li = list(map(int,input().split()))

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag = 0:
  print('APPROVED')

### FIXED CODE ###

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

flag = 0

for i in li:
  if i%2 ==0:
    if i%3 != 0 and i%5 != 0:
      print('DENIED')
      flag = 1
      break
    else:
      continue
      
if flag == 0:
  print('APPROVED')
s = input()
n = len(s)

def dfs(tmp, s):
    if len(s) == 1:
        return int(tmp)+int(s)+int(tmp+s)
    
    return int(tmp)*2**(len(s)-1)+dfs(s[0], s[1:]) + dfs(tmp+s[0], s[1:])

print(dfs(s[0], s[1:]))

### FIXED CODE ###

s = input()
n = len(s)

def dfs(tmp, s):
    if len(s) == 1:
        return int(tmp)+int(s)+int(tmp+s)
    
    return int(tmp)*2**(len(s)-1)+dfs(s[0], s[1:]) + dfs(tmp+s[0], s[1:])

if n > 1:
    print(dfs(s[0], s[1:]))
else:
    print(int(s))
str=input()
S=print(str)
if  S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input()

if  S[2] == S[3] and S[4] == S[5]:
    print("Yes")
else:
    print("No")
a = input()
b = input()

seki = int(a) * int(b)
sa = int(a) - int(b)
wa = int(a) + int(b)

if wa >= seki and wa >= sa:
    print(str(wa))
elif sa >= wa and sa >= seki:
    print(str(sa))
else:
    print(str(seki))


### FIXED CODE ###

a, b = input().split()

seki = int(a) * int(b)
sa = int(a) - int(b)
wa = int(a) + int(b)

if wa >= seki and wa >= sa:
    print(wa)
elif sa >= wa and sa >= seki:
    print(sa)
else:
    print(seki)
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
A,B = map(int, input().split())
print(lcm(A, B))

### FIXED CODE ###

from fractions import gcd

def lcm(x, y):
    return (x * y) // gcd(x, y)
A,B = map(int, input().split())
print(lcm(A, B))
n = int(input())
a = [0] * n
b = [0] * n
task = []

for i in range(n):
  a[i],b[i] = map(int, input().split())
  temp = [a[i],b[i]]
  task.append(temp)
  
task.sort(key=lambda x: x[1])
suma = 0
output = 'Yes'

for i in range(n):
  suma += task[i][0]
  if suma > task[i][i]:
    output = 'No'
    break

print(output)


### FIXED CODE ###

n = int(input())
a = [0] * n
b = [0] * n
task = []

for i in range(n):
  a[i],b[i] = map(int, input().split())
  temp = [a[i],b[i]]
  task.append(temp)
  
task.sort(key=lambda x: x[1])
suma = 0
output = 'Yes'

for i in range(n):
  suma += task[i][0]
  if suma > task[i][1]:
    output = 'No'
    break

print(output)
S = input()
count_B = 0
right_W = 0
for i in S:
  if i == "B":
    count_B += 1
  else:
    right_W = i
rb = len(S) - right_W - 1
print(count_B - rb)

### FIXED CODE ###

S = input()
count_ans = 0
count_B = 0
right_W = 0
for i, c in enumerate(S):
	if c == "W":
		count_ans += count_B
	else:
		count_B += 1
print(count_ans)
from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
dp = [1 for i in range(N+1)]
MOD = 1000000007
for _ in range(M):
  a = int(stdin.readline().rstrip())
  dp[a] = 0
for i in range(2, n+1):
    if dp[i] == 0:
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[N] % MOD)


### FIXED CODE ###

from sys import stdin
N, M = [int(_) for _ in stdin.readline().rstrip().split()]
dp = [1 for i in range(N+1)]
MOD = 1000000007
for _ in range(M):
  a = int(stdin.readline().rstrip())
  dp[a] = 0
for i in range(2, N+1):
    if dp[i] == 0:
        continue
    dp[i] = dp[i-1]+dp[i-2]
print(dp[N] % MOD)
import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs= sys.stdin.buffer.readlines
#rstrip().decode('utf-8')

#import math
#import numpy as np
#import operator
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#sys.setrecursionlimit(10**7)

#map(int,input().split())

def main():
	N,K=map(int,input().split())
	A=list(map(int,input().split()))
	F=sorted(list(map(int,input().split())))
	
	cost=sum(A)-K
	if cost<=0:
		print(0)
		exit(0)
	
	FF=[]
	for i in range(1,N+1):
		FF.append(F[0]*i)
	
	for i in range(1,N):
		for j in range(1,N+1):
			tmp=F[i]*j
			if tmp<FF[N-1]:
				FF.append(tmp)
			else:
				break
	FF.sort()
	print(FF[cost-1])
	

if __name__ == '__main__':
	main()

### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs= sys.stdin.buffer.readlines
#rstrip().decode('utf-8')

#import math
import numpy as np
#import operator
#from heapq import heapify,heappop,heappush
#from math import gcd
#from fractions import gcd
#from collections import deque
#from collections import defaultdict
#from collections import Counter
#from itertools import accumulate
#from itertools import groupby
#from itertools import permutations
#from itertools import combinations
#from scipy.sparse import csr_matrix
#from scipy.sparse.csgraph import floyd_warshall
#from scipy.sparse.csgraph import csgraph_from_dense
#from scipy.sparse.csgraph import dijkstra
#sys.setrecursionlimit(10**7)

#map(int,input().split())

def main():
	NKAF=np.array(read().split(),np.int64)
	N=NKAF[0]
	K=NKAF[1]
	AF=NKAF[2:]
	A,F=np.split(AF,2)
	A.sort()
	F.sort()
	F=F[::-1]
	
	lt=0
	rt=10**12+1
	
	Asum=sum(A)
	
	while rt-lt>1:
		mid=(rt+lt)//2
		if Asum-np.minimum(A,mid//F).sum()<=K:
			rt=mid
		else:
			lt=mid
	print(rt if Asum-K>0 else 0)
	
if __name__ == '__main__':
	main()
N=int(input())
l=[list(map(int,input().split())) for _ in range(N)]
m=[list(map(int,input().split())) for _ in range(N)]
o=[[i for (i,j) in enumerate(m) if j[0]>k[0] and j[1]>k[1]] for k in l]
s=set()
for i in p:
  for l in i:
    if not l in s:
      s.add(l)
      break
print(len(s))

### FIXED CODE ###

n=int(input())
a={tuple(map(int,input().split())):False for _ in range(n)}
b=sorted([tuple(map(int,input().split())) for _ in range(n)])

ak=sorted(a.keys(),key=lambda x:x[1])[::-1]

for i in b:
  for j in ak:
    if i[0]<j[0] or i[1]<j[1] or a[j]:continue
    else:
      a[j]=True
      break

print(sum(a.values()))
n = int(input())
a = set(list(map(int, input().split())))
mod = 1000000007
res = 0


for i in range(n - 1):
    main = a.pop(0)
    res =  (res + main * sum(a) % mod) % mod
print(res)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
mod = 1000000007
res = 0
a_sum = sum(a)

for i in range(n - 1):
    main = a[i]
    a_sum = a_sum - main
    res =  (res + main * a_sum % mod) % mod
print(res)
import itertools
N = int(input())
A = list(map(int, input().split()))
count = {}
for a in A:
  if a not in count:
    count[a] = 0
  count[a] += 1

def check(a):
  if count[a] > 1:
    return 0

  if 1 in count:
    if a == 1 and count[1] == 1:
      return 1
    return 0

  #print(a)
  ok = True
  sqr_a = 1 + int(a**0.5)
  for s in itertools.chain([2], range(3, sqr_a, 2)):
    if a % s:
      continue
    c = s
    while c < sq_a:
      if a % c == 0 and (c in count or (a//c) in count):
        #print(a, c)
        ok = False
        break
      c *= 2
  return ok
  
ans = 0
for a in A:
  ans += check(a)
print(ans)
    
    



### FIXED CODE ###

import itertools
N = int(input())
A = list(map(int, input().split()))
count = {}
for a in A:
  if a not in count:
    count[a] = 0
  count[a] += 1

def check(a):
  if count[a] > 1:
    return 0

  if 1 in count:
    if a == 1 and count[1] == 1:
      return 1
    return 0

  #print(a)
  ok = True
  sqr_a = 1 + int(a**0.5)
  for s in itertools.chain([2], range(3, sqr_a, 2)):
    if a % s:
      continue
    c = s
    while c < sqr_a:
      if a % c == 0 and (c in count or (a//c) in count):
        #print(a, c)
        ok = False
        break
      c *= 2
  return ok
  
ans = 0
for a in A:
  ans += check(a)
print(ans)
ans = 0
for i in range(1, int(input()) + 1):
  t = 0
  z = i
  while z > 0:
    t = t + z % 10
    z = z // 10
  if t >= a and t <= b:
    ans = ans + i
print(ans)

### FIXED CODE ###

ans = 0
n, a, b = map(int, input().split())
for i in range(1, n + 1):
  t = 0
  z = i
  while z > 0:
    t = t + z % 10
    z = z // 10
  if t >= a and t <= b:
    ans = ans + i
print(ans)
N = int(input())
A, B, C = [0]*N, [0]*N, [0]*N 
for i in range(N):
    A[i], B[i], C[i] = [int(j) for j in input().split()]

dp = [[0]*3 for _ in range(N+1)]
for i in range(N):
    for j in range(3):
        dp[i+1][j] = max(dp[i][j-1], dp[i][j-2]) + ABC[i][j]

print(max(dp[-1]))

### FIXED CODE ###

N = int(input())
A, B, C = [0]*N, [0]*N, [0]*N 
for i in range(N):
    A[i], B[i], C[i] = [int(j) for j in input().split()]
    
dp = [[0]*3 for _ in range(N+1)]

for i in range(N):
    dp[i+1][0] = max(dp[i][1], dp[i][2]) + A[i]
    dp[i+1][1] = max(dp[i][0], dp[i][2]) + B[i]
    dp[i+1][2] = max(dp[i][0], dp[i][1]) + C[i]
    
print(max(dp[-1]))
N = int(input())
H,=map(int, input().split())

dp = [0]*N

for i in range(1, N, 1):
  if i==1:
    dp[i] = abs(H[i-1]-H[i])
      cost1 = dp[i-1]+abs(H[i-1]-H[i])
      cost2 = dp[i-2]+abs(H[i-2]-H[i])
      dp[i] = min(dp[i-1], dp[i-2])

   
print(dp[N-1])

### FIXED CODE ###

N = int(input())
*h, = map(int, input().split())

dp = [0] * N

for i in range(1, N, 1):
        if i==1:
                dp[i]=abs(h[i]-h[i-1])
        else:
                dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))

print(dp[N-1])
#-*- coding:utf-8 -*-
N=int(input())
S=input()
c=0
for i in range(N):
  if S[i]=="A" and S[i+1]=="B" and S[i+2]=="C":
    c+=1
print(c)

### FIXED CODE ###

N=int(input())
S=input()
c=0
if len(S)>2:
  for i in range(1,N-1):
    if S[i-1]=="A" and S[i]=="B" and S[i+1]=="C":
      c+=1
print(c)
s = [int(i) for i in input().strip()]
k = int(input())
ind = 0
while k > 0:
    if s[ind] == 1:
        k -= 1
        ind += 1
    else:
        k = 0
print(s[ind])

### FIXED CODE ###

s = [int(i) for i in input().strip()]
k = int(input())
ind = -1
while k > 0:
    ind += 1
    if s[ind] == 1:
        k -= 1
    else:
        k = 0
print(s[ind])
N=int(input())
S=input()
x = 0
max_x = 0
for s_i in S:
  if s_i = "I":
    x += 1
  else:
    x -= 1
  max_x = max(max_x, x)
print(max_x)

### FIXED CODE ###

N=int(input())
S=input()
x = 0
max_x = 0
for s_i in S:
  if s_i == "I":
    x += 1
  else:
    x -= 1
  max_x = max(max_x, x)
print(max_x)
import math

a,b=map(float(input().split()))

b=100*b

print(math.floor(a*b/100))

### FIXED CODE ###

from decimal import Decimal

a,b=map(Decimal,input().split())

print(a*b//1)
A,B,T = map(int,input().split)
print(int(((T+0.5)//A)*B))

### FIXED CODE ###

A,B,T = map(int,input().split())
print(int(((T+0.5)//A)*B))
a=input('a=')
b=input('b=')
c=int(a)*int(b)
if c % 2 == 0:
    print('Even')
else:
    print('Odd')


### FIXED CODE ###

a,b=map(int,input().split())
if a*b%2 == 0:
    print('Even')
else:
    print('Odd')
n=map(int,input())
print('Yes' if sum(n)%n==0 else 'No')

### FIXED CODE ###

n=input()
N=sum(list(map(int,n)))
print('Yes') if int(n)%N==0 else print('No')
n,m=map(int,input().split())
x = [list(map(int, input().split())) for _ in range(n)]
from itertools import *
res = 0
for a in product([-1, 1], [-1, 1], [-1, 1]):
    ts =[]
    for t in x:
        t = 0
        for i,j in zip(a,t):
            t+=i*j
        ts.append(t)
    s = sum(sorted(ts,reverse=True)[:m])
    res = max(res, s)
print(res)

### FIXED CODE ###

n,m=map(int,input().split())
x = [tuple(map(int, input().split())) for _ in range(n)]
from itertools import *
res = 0
for a in product([-1, 1], [-1, 1], [-1, 1]):
    ts = (sum(i*j for i,j in zip(a,t)) for t in x)
    s = sum(sorted(ts,reverse=True)[:m])
    res = max(res, s)
print(res)
A=["k","e","y","e","n","c","e"]
f=-1;p=0;q=0;r=0
S=list(map(str,input()))
if S[0:7]==A or S[len(S)-7:len(S)]==A:
  f=1
else:
  if S[0]!=A[0]:
    f=0
  else:    
    for i in range(len(S)):
      if S[i]==A[i-q]:
        p=p+1
        r=0
      else:
        if q>0 and r==0:
          f=0
          break
        else:
          r=1
          q=q+1
if f==0:
  print("NO")
  
elif f==1:
  print("YES")
  
else:
  if p==7 and (p+q)==len(S):
    print("YES")
    
  else:
    print("NO")

### FIXED CODE ###

A=["k","e","y","e","n","c","e"]
f=-1;p=0;q=0;r=0
S=list(map(str,input()))
if S[0:7]==A or S[len(S)-7:len(S)]==A:
  f=1
else:
  if S[0]!=A[0]:
    f=0
  else:    
    for i in range(len(S)):
      if S[i]==A[i]:
        p=p+1
      else:
        if A[0:p]+S[len(S)-(len(A)-p):len(S)]==A:
          #print(A[0:p]+S[len(S)-(len(A)-p):len(S)])
          f=1
          break
        else:
          f=0
          break
print("YES" if f==1 else "NO")
n, k = list(map(int, input().split()))
s = input()

data = []
cnt = 0
curr = '1'
for i in range(len(s)):
    if s[i] != curr:
        data.append(cnt)
        curr = s[i]
        cnt = 1
    else:
        cnt += 1
data.append(cnt)
data.append(0)

current_sum = sum(data[0:0 + 2*k+1])
ret = current_sum
for start in range(2, len(data), 2):
    if (start + 2*k-1) < len(data): 
        diff = -data[start-2]-data[start-1]+data[start + 2*k]+data[start + 2*k-1]
        current_sum += diff

    #     print(start, val)
        if current_sum > ret:
            ret = current_sum
    else:
        break
print(ret)

### FIXED CODE ###

n, k = list(map(int, input().split()))
s = input()
 
data = []
cnt = 0
curr = '1'
for i in range(len(s)):
    if s[i] != curr:
        data.append(cnt)
        curr = s[i]
        cnt = 1
    else:
        cnt += 1
data.append(cnt)
data.append(0)
data.append(0)
 
current_sum = sum(data[0:0 + 2*k+1])
ret = current_sum
for start in range(2, len(data)-k-2, 2):
    if start + 2*k >= len(data):
        break
    diff = -data[start-2]-data[start-1]+data[start + 2*k]+data[start + 2*k-1]
    current_sum += diff
 
#     print(start, val)
    if current_sum > ret:
        ret = current_sum
print(ret)
#! /usr/bin/env python3
     
    from fractions import gcd
    from collections import Counter, deque, defaultdict
    from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
    from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
    from itertools import accumulate, product, permutations, combinations
     
    from fractions import gcd
    from collections import Counter, deque, defaultdict
    from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
    from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
    from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
     
    N, M, Q = [int(_) for _ in input().split()]
    abcd = [[int(_) for _ in input().split()] for i in range(Q)]
     
    com = combinations_with_replacement(range(1, M+1), N)
     
    ma = 0
    scores = []
    for i in com:
        score = 0
        for j in abcd:
            if i[j[1]-1] - i[j[0]-1] == j[2]:
                score += j[3]
        if score > ma:
            ma = score
    print(ma)

### FIXED CODE ###

#! /usr/bin/env python3

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement

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

com = combinations_with_replacement(range(1, M+1), N)

ma = 0
scores = []
for i in com:
    score = 0
    for j in abcd:
        if i[j[1]-1] - i[j[0]-1] == j[2]:
            score += j[3]
    if score > ma:
        ma = score
print(ma)
import sys
from io import StringIO
import unittest
import itertools

sys.setrecursionlimit(500*500*500)

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,m,q=map(int, readline().rstrip().split())

    aa=[0]*q
    bb=[0]*q
    cc=[0]*q
    dd=[0]*q

    for i in range(q):
        aa[i],bb[i],cc[i],dd[i]=map(int, readline().rstrip().split())

    max_score=0

    for a in itertools.combinations_with_replacement(list(range(1,m+1)),m):
        score=0
        for i in range(q):
            if (a[bb[i]-1]-a[aa[i]-1])==cc[i]:
                score+=dd[i]
        max_score=max(max_score,score)

    print(max_score)

    return
  
resolve()

### FIXED CODE ###

### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest
import itertools

sys.setrecursionlimit(500*500)

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,m,q=map(int, readline().rstrip().split())

    aa=[0]*q
    bb=[0]*q
    cc=[0]*q
    dd=[0]*q

    for i in range(q):
        aa[i],bb[i],cc[i],dd[i]=map(int, readline().rstrip().split())

    max_score=0

    for a in itertools.combinations_with_replacement(list(range(1,m+1)),n):
        score=0
        for i in range(q):
            if (a[bb[i]-1]-a[aa[i]-1])==cc[i]:
                score+=dd[i]
        max_score=max(max_score,score)

    print(max_score)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()


### ----------------
### ここまで 
### ----------------
import math
n=int(input())
for i in range(1,n+1):
    nn=int(math.sqrt(i))
    min=int((nn+1)/math.sqrt(3))
    min1=int((nn+1)/math.sqrt(2))
    count=0
    for x in range(1,min+1):
        for y in range(x,min1+1):
            for z in range(y,nn+1):
                #print(x*x+y*y+z*z+x*y+y*z+z*x)
                if (x*x+y*y+z*z+x*y+y*z+z*x)==i:
                    if x==y and y==z and z==x:
                        count=count+1
                    elif x!=y and y!=z and z!=x:
                        count=count+6
                    else:
                        count=count+3
    print(count)


### FIXED CODE ###

a = list(map(int,input().split()))
answer=int(a[1]/a[2])-int(a[0]/a[2])
if a[0]%a[2]==0:
    answer=answer+1
print(answer)
N, M = map(int, input().split())
A = list(map(int, input().split()))
D = []
for i in range(M):
  B,C = map(int, input().split())
  for j in range(B):
  D.append(C)

import bisect
from collections import deque

D = sorted(D,reverse=True)
A = sorted(A)

for i in range(min(len(D),N)):
  if D[i]>A[i]:
    A[i] = D[i]
  else:
    break
    
print(sum(A))


### FIXED CODE ###

N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [[] for _ in range(M)]
for i in range(M):
  BC[i] = list(map(int, input().split()))

BC.sort(key=lambda x: x[1], reverse=True)

for i in BC:
  A.extend([i[1]]*i[0])
  if len(A) > 2*N:
    break
    
A = sorted(A,reverse=True)
print(sum(A[:N]))
from collections import Counter

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

if N >= 3:
    counter = Counter(A)
    m = min(A)
    M = max(A)
    cnt = []
    for i in range(m, M - 1):
        ans = counter[i] + counter[i + 1] + counter[i + 2]
        if ans:
            cnt.append(ans)
        print(cnt)
    print(max(cnt))

elif N == 2:
    if abs(A[0] - A[1]) <= 2:
        print(2)
    else:
        print(1)

elif N == 1:
    print(1)


### FIXED CODE ###

import numpy as np

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

B = A.copy()
B[1:] += A[:-1]
B[:-1] += A[1:]

answer = B.max()
print(answer)
import bisect
X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
P.sort()
kari=[]
if len(P)==0:
    print(100)
    exit()
if X<P[0]:
    print(X)
    exit()
if X>P[-1]:
    print(X)
    exit()
for i in range(101):
    if i not in hako:
        kari.append(i)
#print(kari)
tekitpu=kari[bisect.bisect_left(kari,X)]
aho=kari[bisect.bisect_left(kari,X)-1]
#print(tekitpu,aho)
if abs(tekitpu-X)<abs(X-aho):
    print(tekitpu)
else:
    print(aho)

### FIXED CODE ###

X,N=map(int,input().split())
P=list(map(int,input().split()))
hako=set(P)
#print(hako)
ans=[]
P.sort()
kari=[]
for i in range(102):
    if i not in hako:
        kari.append(i)
for i in range(len(kari)):
    ans.append([abs(X-kari[i]),kari[i]])
ans.sort()
print(ans[0][1])