Harryxun/stf_run huggingface dataset:
n = int(input())
m = 10**12
for i in n:
  for j in n:
    if i*j==n:
      m=min(m,(i+j-2))
print(m)

### FIXED CODE ###

n = int(input())
 
b = 10**12
a = int((n**0.5)//1)
for i in range(1,a+1):
  if n%i==0:
    b = min(b,int(i+(n//i)-2))
print(b)
#coding:utf-8

a = list(map(int,input().split("/")))   

if a[0]=2019 and a[1]>=4:
  print("TBD")
elif a[0]<2019:
  print("TBD")
else:
  print("Heisei")

### FIXED CODE ###

#coding:utf-8

a = list(map(int,input().split("/")))   

if a[0]==2019 and a[1]>4:
  print("TBD")
elif a[0]>2019:
  print("TBD")
else:
  print("Heisei")
p = 0
n, a, b = map(int, input().split())
for i in input():
    if i == "a" and p < a+b:
        p += 1
        print("Yes")
    elif i == "b" and p < a+b and f < b:
        f += 1
        p += 1
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

p = 0
f = 0
n, a, b = map(int, input().split())
for i in input():
    if i == "a" and p < a+b:
        p += 1
        print("Yes")
    elif i == "b" and p < a+b and f < b:
        p += 1
        f += 1
        print("Yes")
    else:
        print("No")
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

def calcans(ans, a_list):  
  sm = 0
  for a in a_list:
    sm += a^ans
  print(sm)

def solve():
  N, K = LI()
  a_list = LI()
  if K == 0:
    calcans(0, a_list)
    return
  # Kの可能な最大桁（1オリジン）
  import math
  nk = math.floor(math.log2(K)) + 1
  bink = '{0:030b}'.format(K)
  bin_list = []
  for a in a_list:
    bin_list.append('{0:030b}'.format(a))

  # 最大の桁から順に決める nk桁目～1桁目
  bind = True
  ans = ''
  for i in range(nk, 0, -1):
    n1 = 0
    for b in bin_list:
      # i桁目の数字は string の index で見て -i
      if b[-i] == '1':
        n1 += 1

    if n1 > N // 2:
      optimal = '0'
    else:
      optimal = '1'

    if bink[-i] == '1':
      ans += optimal
      if optimal == '0':
        bind = False
    else:
      if bind == True:
        ans += '0'
      else:
        ans += optimal

  ansint = int(ans, 2)
  calcans(ansint, a_list)
  
solve()

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

def calcans(ans, a_list):  
  sm = 0
  for a in a_list:
    sm += a^ans
  print(sm)

def solve():
  N, K = LI()
  a_list = LI()
  if K == 0:
    calcans(0, a_list)
    return
  # Kの可能な最大桁（1オリジン）
  import math
  nk = math.floor(math.log2(K)) + 1
  bink = '{0:050b}'.format(K)
  bin_list = []
  for a in a_list:
    bin_list.append('{0:050b}'.format(a))

  # 最大の桁から順に決める nk桁目～1桁目
  bind = True
  ans = ''
  for i in range(nk, 0, -1):
    n1 = 0
    for b in bin_list:
      # i桁目の数字は string の index で見て -i
      if b[-i] == '1':
        n1 += 1

    if n1 > N // 2:
      optimal = '0'
    else:
      optimal = '1'

    if bink[-i] == '1':
      ans += optimal
      if optimal == '0':
        bind = False
    else:
      if bind == True:
        ans += '0'
      else:
        ans += optimal

  ansint = int(ans, 2)
  calcans(ansint, a_list)
  
solve()
from bisect import besect_left

N,D,A = map(int,input().split())
data = []
for i in range(N):
    X,H = map(int,input().split())
    if H % A == 0:
        data.append([X,H//A])
    else:
        data.append([X,H//A + 1])

data.sort()

X = []
H = []
for i in range(N):
    X.append(data[i][0])
    H.append(data[i][1])

count = 0
for i in range(N):
    if H[i] <= 0:
        continue
    count += H[i]
    p = bisect_left(X,X[i]+2*D+1)
    for j in range(i+1,min(p,N)):
        H[j] -= H[i]

print(count)

### FIXED CODE ###

from bisect import bisect_right

N, D, A = map(int, input().split())
xh = sorted([list(map(int, input().split())) for _ in range(N)])
ds = [0]*(N+2)
b = 0
for i, (x, h) in enumerate(xh, 1):
  ds[i] += ds[i-1]###(*)
  ###これまでのやつに与えたダメージは引き継がれるものとする
  d = ds[i]
  if d>=h:
    continue###すでに体力以上のダメージを与えた敵
  h -= d###ダメージを与える
  times = h//A if h%A==0 else h//A+1
  ds[i] += times*A
  ds[bisect_right(xh, [x+2*D, float('inf')])+1] -= times*A
  ###(*)のせいで, 2Dよりも向こう側にも、今考えたダメージの影響が
  ###出てしまうので. それを打ち消すために与えるダメージを引いておく
  b += times
print(b)
a=list(input())
c=reverse(a)
b=a.index(a[0])
d=c.index(c[0])
g=b-d
g-=1
print(a[0]+str(g)+c[0])

### FIXED CODE ###

s = input()
print(s[0] + str(len(s)-2) + s[-1])
x = int(input())
for a in range(100):
    for b in range(-100,100):
        if a**5 - b**5 == X:
            print(a,b)
            break
    else:
        continue
    break

### FIXED CODE ###

X = int(input())
for a in range(10**4):
    for b in range(-10**4,10**4):
        if a**5 - b**5 == X:
            print(a,b)
            break
    else:
        continue
    break
# -*- coding: utf-8 -*-
from sys import stdin

s_in = lambda: stdin.readline()[:-1] # s = s_in()
d_in = lambda: int(stdin.readline()) # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split())) # List = ds_in()

N = d_in()

cand = [[i,j,0] for i in range(0, 101) for j in range(0, 101)]

info = []
for _ in range(N):
    info.append(ds_in())

for i in range(len(cand)):
    x, y, h = info[0]
    cand[i][2] = h + abs(x-cand[i][0]) + abs(y-cand[i][1])

if N > 1:
    idx = 1
    while len(cand) > 1:
        temp = []
        x, y, h = info[idx]
        for c in cand:
            if h == max(0, c[2] - abs(x-c[0]) - abs(y-c[1])):
                temp.append(c)
        cand = temp.copy()
        idx += 1

print(cand[0][0], cand[0][1], cand[0][2])



### FIXED CODE ###

# -*- coding: utf-8 -*-
from sys import stdin

s_in = lambda: stdin.readline()[:-1] # s = s_in()
d_in = lambda: int(stdin.readline()) # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split())) # List = ds_in()

N = d_in()

cand = [[i,j,0] for i in range(0, 101) for j in range(0, 101)]

info = []
for _ in range(N):
    info.append(ds_in())

info.sort(key=lambda x: x[2], reverse=True)

for i in range(len(cand)):
    x, y, h = info[0]
    cand[i][2] = h + abs(x-cand[i][0]) + abs(y-cand[i][1])

if N > 1:
    idx = 1
    while len(cand) > 1 and idx < N:
        temp = []
        x, y, h = info[idx]
        for c in cand:
            if h == max(0, c[2] - abs(x-c[0]) - abs(y-c[1])):
                temp.append(c)
        cand = temp.copy()
        idx += 1

print(cand[0][0], cand[0][1], cand[0][2])
if W >= S:print('unsafe')
else: print('safe')

### FIXED CODE ###

S,W = list(map(int,input().split()))
if W >= S:print('unsafe')
else: print('safe')
a,b =map(int, input().split())
x = list(map(int, input().split()))
m = abs(x[0]-b)
for i in range(a):
    m = math.gcd(m,abs(x[i]-b))
print(m)

### FIXED CODE ###

import fractions
a,b =map(int, input().split())
x = list(map(int, input().split()))
m = abs(x[0]-b)
for i in range(a):
    m = fractions.gcd(m,abs(x[i]-b))
print(m)
S, W = map(int,input().split())
input('unsafe' if S <= W else 'safe')

### FIXED CODE ###

S, W = map(int,input().split())
print('unsafe' if S <= W else 'safe')
n=int(input())
s=input()
if type(n/2)=='int':
    if s[0:n/2]=s[n/2:n]:
        print('Yes')
    else:
        print('No')
else:
    print('No')

### FIXED CODE ###

n=int(input())
s=input()
a=(s[0:int(n/2)])
b=(s[int(n/2):n])
if n%2==0:
    if a==b:
        print('Yes') 
    else:
        print('No')
else:
    print('No')
n,m=map(int,input().split())
a=[0]*(n)
if m>0:
  for _ in range(m):
    a[int(input())]+=1
dp=[0]*(n+1)
dp[0]=1
if a[1]!=1:
  dp[1]=1
for i in range(2,n+1):
  if a[i-2]==0 and a[i-1]==0:
    dp[i]=dp[i-2]+dp[i-1]
  elif a[i-1]!=0 and a[i-2]==0:
    dp[i]=dp[i-2]
  elif a[i-2]!=0 and a[i-1]==0:
    dp[i]=dp[i-1]
  else:
    dp[i]=0
print(dp[n]%(10**9+7))    

### FIXED CODE ###

n,m=map(int,input().split())
a=[0]*(n)
if n==1:
  print(1)
  exit()
if m>0:
  for _ in range(m):
    a[int(input())]+=1
dp=[0]*(n+1)
dp[0]=1
if a[1]!=1:
  dp[1]=1
for i in range(2,n+1):
  if a[i-2]==0 and a[i-1]==0:
    dp[i]=dp[i-2]+dp[i-1]
  elif a[i-1]!=0 and a[i-2]==0:
    dp[i]=dp[i-2]
  elif a[i-2]!=0 and a[i-1]==0:
    dp[i]=dp[i-1]
  else:
    dp[i]=0
print(dp[n]%(10**9+7))
taxed_price = int(input())
raw_price = taxed_price // 1.08

if int(raw_price * 1.08) == taxed_price:
  print(raw_price)
 elif int((raw_price + 1) * 1.08) == taxed_price:
  print(raw_price + 1)
 else:
  print(':\(')


### FIXED CODE ###

taxed_price = int(input())
raw_price = taxed_price // 1.08

if int(raw_price * 1.08) == taxed_price:
    print(int(raw_price))
elif int((raw_price + 1) * 1.08) == taxed_price:
    print(int(raw_price + 1))
else:
    print(':(')
n, k, s =map(int, input().split())

if s == 10 ** 9:
    for i in range(k):
        print(s, end="")
    for i in range(n-k)
        print(1, end="")
else:
    for i in range(k):
        print(s, end="")
    for i in range(n-k)
        print(s+1, end="")

### FIXED CODE ###

n, k, s =map(int, input().split())

if s == 10 ** 9:
    for i in range(k):
        print(s, end=" ")
    for i in range(n-k):
        print(1, end=" ")
else:
    for i in range(k):
        print(s, end=" ")
    for i in range(n-k):
        print(s+1, end=" ")
import math
import functools


def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm_list(numbers):
    return functools.reduce(lcm_base, numbers, 1)

def lcm_list(*numbers):
    return functools.reduce(lcm_base, numbers, 1)

def main() :
    n = int(input())
    a = list(map(int, input().split()))
    lcm = lcm_list(*a)

    ans = 0
    for aa in a :
        ans += (lcm-1) % aa

    print(ans)

main()

### FIXED CODE ###

a = list(map(int, input().split()))
a = sorted(a)
ans = 0
L = len(a)
for i in range(1,L) :
    ans += abs(a[i]-a[i-1])

print(ans)
N = int(input())
final = ""
digits = []
temp = N

while temp > 0:
    res = temp%26
    temp //= 26
    digits.append(res)
    
chars = "abcdefghijklmnopqrstuvwxyz"
dic = {i: chars[i] for i in range(26)}
for j in range(len(digits)):
    char = dic[digits[j] - 1]
    final = char + final
print(final)

### FIXED CODE ###

N = int(input())
final = ""
chars = "abcdefghijklmnopqrstuvwxyz"
dic = {i: chars[i] for i in range(0, 26)}
pw_26 = [26**i for i in range(13)]
cum = 0
digit = 0
for i in range(13):
    cum += pw_26[i]
    if N < cum:
        digit = i
        break
start_from = cum - pw_26[digit]
temp = N - start_from
digits = []
counter = 0
while counter < digit:
    res = temp % 26
    temp //= 26
    digits.append(res)
    counter += 1

for j in range(len(digits)):
    char = dic[digits[j]]
    final = char + final
print(final)
yandy
N = int(input())

count = [0] * 201
count[105] = 1
for i in range(105, 201):
    if i % 2 == 1:
        num = 0
        for n in range(1, i+1):
            if i % n == 0:
                num += 1
        if num == 8:
            count[i] = count[i-1]+1
        else:
            count[i] = count[i-1]
    else:
        count[i] = count[i-1]

print(count[N])


### FIXED CODE ###

n=int(input())
ans=0
for i in range(1,n+1):
  count=0
  for j in range(1,i+1):
    if i%j==0:
      count+=1
  if count==8 and i%2==1:
    ans+=1
print(ans)
N = int(input())
S = input()
a = 0
sum_a = 0

for i in range(N):
  if S[i]=="I":
    sum_a += 1 
    a = max (a , sum_a)
  else:
    sum_a- = 1
print(a)

### FIXED CODE ###

N = int(input())
S = input()
a = 0
sum_a = 0

for i in range(N):
  if S[i]=="I":
    sum_a += 1 
    a = max (a , sum_a)
  else:
    sum_a -= 1
print(a)
def mina(t, i, L):
  return True

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

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

t = [2, 5, 5, 4, 5, 6, 3, 7, 6]

A.sort(reverse = True)
D = {}
L = []
X = []
for i in A:
  if t[i - 1] not in D:
    D[t[i - 1]] = i
    L.append(t[i - 1])
    X.append([i, t[i - 1]])

L.sort()

Lmin = N // L[0]
Lmod = N % L[0]

F = True
if Lmod != 0:
  while F:
    Lmin -= 1
    Lmod += L[0]
    t = Lmod
    for i in L[1:]:
      if mina(t, i, L[1:]) == True:
        F = False
        break
  
  X.sort(reverse = True)
  for i in X:
    if i != L[0]:
      k = t - i[1]
      if k == 0:
        List = [i[0]]
        break
      elif k > 0:
        for j in X:
          if i != L[0]:
            if k - j[1] == 0:
              List = [i[0], j[0]]
              F = True
              break
        if F:
          break

Ans = [str(D[L[0]]) for i in range(Lmin)]
if Lmod != 0:
  if len(List) == 1:
    if L[0] < List[0]:
      Ans = [str(List[0])] + Ans
    else:
      Ans = Ans + [str(List[0])]
  else:
    List.sort(reverse = True)
    if L[0] > List[0]:
      Ans += [str(List[0]), str(List[1])]
    elif L[0] < List[1]:
      Ans = [str(List[0]), str(List[1])] + Ans
    else:
      Ans = [str(List[0])] + Ans + [str(List[1])]

print("".join(Ans))


### FIXED CODE ###

import copy

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

t = [0, 2, 5, 5, 4, 5, 6, 3, 7, 6]
L = {}
for i in A:
  if t[i] in L:
    if L[t[i]] < i:
      L[t[i]] = i
  else:
    L[t[i]] = i

dp = [[0 for j in range(10)] for i in range(N)]
for i in L.items():
  if i[0] - 1 < N:
    dp[i[0] - 1][i[1]] = 1
for i in range(N):
  if max(dp[i]) == 0:
    continue
  for j in L.items():
    k = i + j[0]
    if k < N:
      t = copy.deepcopy(dp[i])
      t[j[1]] += 1
      if sum(t) > sum(dp[k]):
        dp[k] = t
      else:
        for ii in range(9, 0, -1):
          if t[ii] > dp[k][ii]:
            dp[k] = t
            break
          elif t[ii] < dp[k][ii]:
            break
          
t = dp[-1]
Ans = ""
for i in range(9, 0, -1):
  for j in range(t[i]):
    Ans += str(i)
    
print(Ans)
x = int(input())

def func():
    for a in range(-10**2 - 100, 10**2 + 100):
        for b in range(-10**2, 10**2):
            if a**5 - b**5 == x:
                k = [a, b]
                return k
    

k = func()
for i in range(2):
    print(k[i], end=" ")

### FIXED CODE ###

x = int(input())

def func():
    for a in range(-10**2 - 200, 10**2 + 200):
        for b in range(-10**2 - 200, 10**2 + 200):
            if a**5 - b**5 == x:
                k = [a, b]
                return k
    

k = func()
for i in range(2):
    print(k[i], end=" ")
k,t=map(int,input().split())
l=[0]*t
a=list(map(int,input().split()))
for i in a:
  l[i-1]+=1
print(max(0,max(l)-(k+1)//2))

### FIXED CODE ###

k,t=map(int,input().split())
print(max(0,2*max(list(map(int,input().split())))-k-1))
import datetime as d
a,b = d.timedelta(seconds=int(input())).d.datetime(1,1,1)
print(((a+b).hour, (a+b).minute, (a+b).second, sep=':')


### FIXED CODE ###

import datetime as d
a,b = d.timedelta(seconds=int(input())),d.datetime(1,1,1)
print((a+b).hour, (a+b).minute, (a+b).second, sep=':')
if'__main__'==__name__:s()
def s():
 n=int(input())+1
 e=[input().split()for _  in[0]*~-n]
 p=[int(e[0][0])]+list(int(x[1])for x in e)
 m=[[0]*n for _ in[0]*n]
 for l in range(2,n):
  for i in range(1,n-l+1):
   j=i+l-1;m[i][j]=1e6
   for k in range(i,j):m[i][j]=min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j])
 print(m[1][n-1])


### FIXED CODE ###

def s():
 n=int(input())+1
 e=[input().split()for _  in[0]*~-n]
 p=[int(e[0][0])]+list(int(x[1])for x in e)
 m=[[0]*n for _ in[0]*n]
 for i in range(n):
  for r in range(n-i-1):
   c=r+i+1
   for j in range(r+1,c):
    x=m[r][j]+m[j][c]+p[r]*p[j]*p[c]
    if not 0<m[r][c]<=x:m[r][c]=x
 print(m[r][c])
if'__main__'==__name__:s()
x, y = input().split()
print(x * y)


### FIXED CODE ###

x, y = map(int, input().split())
print(x * y)
import sys

q=input()
x=[int(i) for i in input().split()]
cnt=input()
j=0
y=[int(i) for i in input().split()]

if max(x) >= max(y): MAX=max(x)
else : MAX=max(y)

z=[0]*MAX

for k in x :
    z[k-1] += 1
    
for i in y :
    z[i-1] -= 1
    if z[i-1] == -1 :
        print('NO')
        sys.exit()
        
print('YES')


### FIXED CODE ###


q=input()
x=[int(i) for i in input().split()]
cnt=input()
y=[int(i) for i in input().split()]

if max(x) >= max(y):
    MAX=max(x)
else:
    MAX=max(y)

dic = {}

for k in x :
    if k in dic.keys() :
        dic[k] += 1
    else :
        dic[k] = 1
    
for i in y :
    if i in dic.keys() :
        dic[i] -= 1
        if dic[i] == -1 :
            print('NO')
            exit()
    else :
        print('NO')
        exit()
print('YES')
def main():
    s = sys.stdin.readline().rstrip().split()
    a = int(s[0])

    b = int(float(s[1])*100)

    ans=a*b//100
    l = []
    while ans!=0:
        p = ans%10
        ans //=10
        l.append(p)
        
    for i in l[::-1]:
        print(i,end="")
main()

### FIXED CODE ###

import io,sys
sys.setrecursionlimit(10**6)

def main():
    s = sys.stdin.readline().rstrip().split()
    a = int(s[0])

    b = int(float(s[1])*100+0.1)

    print(a*b//100)
main()
ma = lambda :map(int,input().split())

n,a,b = ma()
if (b-a)%2 ==0:
    print((b-a)//2)
else:
    print(min(a+ (b-a-1)//2, (n-b+1)+(b-a-1)//2)


### FIXED CODE ###

ma = lambda :map(int,input().split())

n,a,b = ma()
if (b-a)%2 ==0:
    print((b-a)//2)
else:
    print(min(a+ (b-a-1)//2, (n-b+1)+(b-a-1)//2))
n=int(input())
ans=n
s=0
while n!=0:
    a=n%10
    s+=a
    n=n//10
if ans%s==0:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

n=input()
ans=0
for i in range(0,len(n)):
    if n[i]=='+':
        ans+=1
    else:
        ans-=1
print(ans)
import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    #print("top", x, count)
            

    for d in directions:
        nx = d+x
        #print(nx)
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "#":
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count

N=int(input())
X=np.array(acinput())

u = round(np.mean(X))


res=0

print(int(np.sum((u-X)**2)))


### FIXED CODE ###


import numpy as np
from functools import *
import sys
sys.setrecursionlimit(100000)



def acinput():
    return list(map(int, input().split(" ")))


def II():
    return int(input())

directions=np.array([[1,0],[0,1],[-1,0],[0,-1]])
directions = list(map(np.array, directions))

mod = 10**9+7


def factorial(n):
    fact = 1
    for integer in range(1, n + 1):
        fact *= integer
    return fact



def serch(x, count):
    #print("top", x, count)
            

    for d in directions:
        nx = d+x
        #print(nx)
        if np.all(0 <= nx) and np.all(nx < (H, W)):
            if field[nx[0]][nx[1]] == "E":
                count += 1 
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)  
                continue
            if field[nx[0]][nx[1]] == "#":
                field[nx[0]][nx[1]] = "V"
                count = serch(nx, count)    
                 
    return count

N=int(input())
X=np.array(acinput())

u = round(np.mean(X))


res=0

print(int(np.sum((u-X)**2)))
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
temp,temp2=0,0
Sa,Sb=[0]*n,[0]*m
for i in range(n):
    temp+=a[i]
    Sa[i]=temp
for i in range(m):
    temp2+=b[i]
    Sb[i]=temp2
ans,j=0,m-1
for i in range(n):
    if a[i]>k: break
    while a[i]+b[j]>k: j-=1
    ans=max(ans,i+j)
print(ans)

### FIXED CODE ###

n,m,k=map(int,input().split())
a=[0]+list(map(int,input().split()))
b=[0]+list(map(int,input().split()))

for i in range(1,n+1): a[i]=a[i]+a[i-1]
for i in range(1,m+1): b[i]=b[i]+b[i-1]
j=m
ans=0
for i in range(n+1):
    if j<0: break
    while a[i]+b[j]>k and j>=0: j-=1
    ans=max(i+j,ans)
print(ans)
n=int(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')
def a(v1,v2):
    if v1[0]!=v2[0]:
        return (v2[1]-v1[1])/(v2[0]-v1[0])
    else:
        return (v2[1]-v1[1])*(10**10)

def dlt(p,v,sign):
    while len(p)>2:
        if sign*(a(v[p[-3]],v[p[-2]])-a(v[p[-2]],v[p[-1]]))<0:
            del p[-2]
        else:
            break
    return p

def convex(v,n):
    d,u=[],[]
    for i in range(n):
        d=dlt(d+[i],v,1)
        u=dlt(u+[i],v,-1)
    return n-len(set(d+u))

while 1:
    n=int(raw_input())
    if n==0:
        break
    v=[map(float,raw_input().splirt(',')) for i in range(n)]
    v=sorted(sorted(v,key=lambda x:x[1]))
    print convex(v,n)

### FIXED CODE ###

def a(v1,v2):
    if v1[0]!=v2[0]:
        return (v2[1]-v1[1])/(v2[0]-v1[0])
    else:
        return (v2[1]-v1[1])*(10**10)

def dlt(p,v,sign):
    while len(p)>2:
        if sign*(a(v[p[-3]],v[p[-2]])-a(v[p[-2]],v[p[-1]]))<0:
            del p[-2]
        else:
            break
    return p

def convex(v,n):
    d,u=[],[]
    for i in range(n):
        d=dlt(d+[i],v,1)
        u=dlt(u+[i],v,-1)
    return n-len(set(d+u))

while 1:
    n=int(raw_input())
    if n==0:
        break
    v=[map(float,raw_input().split(',')) for i in range(n)]
    v=sorted(sorted(v,key=lambda x:x[1]))
    print convex(v,n)
n, k = map(int, input().split())
d_i = set(map(int, input().split()))
full = set(range(10))
useableList = full - d_i
useable_Top = full - d_i - set([0])
answer = []
isTop = True
for x in str(n):
    if int(x) in useableList: answer.append(x)
    elif isTop: answer.append(min(useable_Top - set(range(int(x) + 1))))
    else: answer.append(min(useableList))
    if isTop: isTop = False;
ans = ''
for x in range(len(answer)):
    ans += str(answer[x])
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
d_k = set(map(int, input().split()))
ans = n
while ans <= n * 10:
    isOK = True
    for x in range(len(str(ans))):
        if int(str(ans)[x]) in d_k: 
            isOK = False
            break
    if isOK == True: break
    ans += 1
print(ans)
from heapq import heappush, heappop
from collections import deque
import itertools
from itertools import permutations
import sys
import bisect
sys.setrecursionlimit(10**6)
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
YNeos='YNeos'
mo=10**9+7
imp='IMPOSSIBLE'

input=sys.stdin.readline
s=input()
t=list(s)[::-1]
ans=0
dp=[0]*13
dp[0]=1
for d in range(len(t)):
    
    if t[d]=='?':
        tm=[0]*13
        for x in range(10):
            r=int(x)*(10**d)
            for i in range(13):
                tm[(i+r)%13]+=dp[i]
        dp=[j%mo for j in tm]
    else:
        tm=[0]*13
        r=int(t[d])*(10**d)
        for i in range(13):
            tm[(i+r)%13]=dp[i]
        dp=[j for j in tm]

print(dp[5]%mo)


### FIXED CODE ###

from heapq import heappush, heappop
from collections import deque
import itertools
from itertools import permutations
import sys
import bisect
sys.setrecursionlimit(10**6)
#input=sys.stdin.readline
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
YNeos='YNeos'
mo=10**9+7
imp='IMPOSSIBLE'


s=input()
t=list(s)[::-1]
ans=0
dp=[0]*13
dp[0]=1
for d in range(len(t)):
    
    if t[d]=='?':
        tm=[0]*13
        for x in range(10):
            r=int(x)*pow(10,d,13)
            for i in range(13):
                tm[(i+r)%13]+=dp[i]
        dp=[j%mo for j in tm]
    else:
        tm=[0]*13
        r=int(t[d])*pow(10,d,13)
        for i in range(13):
            tm[(i+r)%13]=dp[i]
        dp=[j for j in tm]
    #print(dp)

print(dp[5]%mo)