peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
o = str(input())
e = str(input())
s = []
for i in range(len(e)):
    s.append(o[i])
    s.append(e[i])
if len(o) > len(e):
    s.append(o[-1])
print(*s, sep = "")
# Judge status: Wrong Answer
S = input()
T = input()
L = [c for c in S if c not in T]
L2 = [c for c in T if c not in S]
if len(L) != len(L2):
  print("No")
else:
  print("Yes")
# Judge status: Wrong Answer
n,a,b=map(int,input().split())
s=input().strip()
njp=0
nop=0
for i in range(len(s)):
  if s[i]=='a':
    if njp<(a+b):
      njp+=1
      print('Yes')
    else:
      print('No')
  elif s[i]=='b':
    if njp<(a+b):
      if nop<=b:
        nop+=1
        njp+=1
        print('yes')
      else:
        print('No')
    else:
      print('No')
  else:
    print('No')
# Judge status: Wrong Answer
li = ["0","1","2","3","4","5","6","7","8","9"]
a,b = map(int,input().split())
s = input()
for i in range(a+b):
    if i != a:
        if s[i] not in li:
            print("No")
            exit()
print("Yes")
# Judge status: Wrong Answer
N,Y = map(int, input().split())
ans= [-1, -1, -1]

for x in range(N+1):
    for y in range(N-x+1):
        price = x*10000 + y*5000 + int(N-x-y)*1000
        if price == Y:
            print(x,y,N-x-y)
            break
# Judge status: Accepted
s = input()

if s[2] == s[3] and s[4] ==s[5]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import string
c = input()
abc_list = list(string.ascii_lowercase)
for num,string in enumerate(abc_list):
  if string == c:
    print(abc_list[num+1])
# Judge status: Wrong Answer
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n-3):
  for j in range(i+1,n-1):
    k = 2*j-i
    if k < n:
      if  s[i] != s[j] and s[j]!= s[k] and s[i] != s[k]:
        ans -= 1
print(ans)
# Judge status: Accepted
import math 
R = int(input())

print(2*R*math.pi)
# Judge status: Accepted
N = int(input())

ans = 0

for i in range(1,N+1):
    cnt = N // i
    ans += i*cnt*(cnt+1)//2

print(ans)
# Judge status: Accepted
def main():
    l, r = map(int, input().split())
    minv = 2019
    if r - l > 2019+1:
        print(0)
    else:
        for i in range(l, r+1):
            for j in range(l, r+1):
                if i < j:
                    minv = min(minv, (i*j)%2019)
        print(minv)

if __name__ == '__main__':
    main()
# Judge status: Accepted
if __name__ == "__main__":
    N = int(input())
    num_list = list(map(int, input().split()))
    ans = 1
    MAX = 1e18
    for i in num_list:
        ans = ans*i
        if ans > MAX:
            ans = -1
            break
    if 0 in num_list:
        print(0)
    else:
        print(ans)
# Judge status: Wrong Answer
A1, A2, A3 = map(int, input().split())
print(A1+A2+A3)
# Judge status: Wrong Answer
n,d=map(int,input().split())
point=[]
for _ in range(n):
    point.append(list(map(int,input().split())))
ans=0
for i in range(n-1):
    for l in range(1,n):
        if i==l:
            continue
        dis=0
        for f in range(d):
            dis+=(point[i][f]-point[l][f])**2
        dis=dis**0.5
        #print(dis)
        if dis.is_integer():
            ans+=1
print(ans)
# Judge status: Accepted
abcde=[int(input()) for i in range(5)]
ans=0
m=10
for i in abcde:
  ans += (i+9)//10*10
  m=min(m,(i-1)%10+1)
print(ans-10+m)
# Judge status: Accepted
s=input()
if len(s)%2!=0:
    print('No')
    exit()
else:
    for i in range(len(s)//2):
        if not (s[2*i]=='h' and s[2*i+1]=='i'):
            print('No')
            exit()
    print('Yes')
# Judge status: Accepted
# -*- coding: utf-8 -*-
H = int(input())
h = H
count = 1
total_count = count
while h > 1:
  count *= 2
  total_count += count
  h //= 2
print(total_count)
# Judge status: Accepted
from math import ceil
x = int(input())
ans = x // 11 * 2
ans += ceil((x%11)/6)
print(ans)
# Judge status: Wrong Answer
n = int(input())
w = list(map(int, input().split()))
s = [0]
for i in range(n):
    s.append(w[i] + s[i])

for i in range(n+1):
    if(2*(s[i]) > s[n]):
        t = i
        break
print(abs(s[n] - 2*(s[t])))
# Judge status: Accepted
h,n=input().split()
h=int(h)
n=int(n)
#print(h,n)
arr=list(map(int,input("\r").strip().split()))[:n] 
sum=0;
for i in range(0,n):
  #  print(arr[i])
    sum+=arr[i]
  
if sum>=h:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
print('ABD' if int(input())>999 else 'ABC')
# Judge status: Accepted
s = int(input())
a = []
a.append(s)
ans = 0
while True:
    if a[ans]%2==0:
        if a[ans]//2 in a:
            print(ans+2)
            break
        a.append(a[ans]//2)
    else :
        if 3*a[ans]+1 in a:
            print(ans+2)
            break
        a.append(3*a[ans]+1)
    ans+=1
# Judge status: Accepted
import sys
input = sys.stdin.readline

N = int(input())
A = list(map(int,input().split()))
cnt = 0
for i,a in enumerate(A):
    if a<0:
        cnt += 1
        A[i] = -1*a
A = sorted(A)
print(sum(A)-2*A[0]*(cnt%2))
# Judge status: Accepted
a, b, c = [int(i) for i in input().split()]

exist = False
for i in range(1,b+1):

    if i*a % b == c:
        exist = True

if exist:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
L = list(map(int, input().split()))
result = 0
for i in range(n):
    for j in range(i + 1, n):
        for k in range(j + 1, n):
            a = L[i]
            b = L[j]
            c = L[k]
            if a == b or b == c or c == a:
                continue
            if a+b > c and b+c > a and c+a > b:
                result += 1
                # print(i, j, k)

print(result)
# Judge status: Accepted
N=int(input())
A=list(map(int, input().split()))
a=A[0]
for i in range(1,N):
  a=a^A[i]
D=[]
for i in range(N):
  D.append(a^A[i])
print(*D)
# Judge status: Accepted
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,m = map(int,input().split())
if n % 2 == 1:
  a = 1; b = n
  for i in range(m):
    print(a,b)
    a += 1;b -= 1
else:
  a = 1; b = n
  tmp = n
  while b-a > n//2:
    print(a,b)
    a += 1
    b -= 1
    count += 1
    if count >= m:exit()
  b-=1
  for i in range(m-count):
    print(a,b)
    a += 1
    b -= 1
# Judge status: Accepted
k,x = list(map(int,input().split()))
for i in range (x-k+1,x+k):
  print (i)
# Judge status: Accepted
strs = [input() for _ in range(3)]
idxs = [0,0,0]
turn = 0
while True:
    idx = idxs[turn]
    if idx >= len(strs[turn]):
        break
    card = strs[turn][idxs[turn]]
    idxs[turn] += 1
    
    if card == 'a':
        turn = 0
    elif card == 'b':
        turn = 1
    else:
        turn = 2

print(['A','B','C'][turn])
# Judge status: Accepted
N, L = map(int, input().split())

total = N * (L - 1) + N * (N + 1) / 2
lowest = 10 ** 10
for i in range(1, N + 1):
    y = L + i - 1
    lowest = min(lowest, abs(y))
print(int(total) - lowest) if total >= 0 else print(int(total) + lowest)
# Judge status: Accepted
a,b,c = map(int,input().split())

print(int(a * b * 0.5))
# Judge status: Accepted
S = input()[::-1]
D = ["dream"[::-1], "dreamer"[::-1], "erase"[::-1], "eraser"[::-1]]
while True:
    for d in D:
        if S.startswith(d):
            S = S.replace(d, "", 1)
            break
    else:
        break
print("YNEOS"[S!=""::2])
# Judge status: Accepted
import math
n=int(input())
if 1 < math.gcd(360,n) < 360:
  print(360//math.gcd(360,n))
else:
  print(360)
# Judge status: Accepted
s=input()
if int(s[5:7])<5:
    print("Heisei")
else:
    print("TBD")
# Judge status: Accepted
import random
ans=0
d=int(input())
c=list(map(int,input().split()))
s=[]
for i in range(d):
    List=list(map(int,input().split()))
    s.append(List)
for i in range(d):
    ans=random.randint(1,26)
    print(ans)
# Judge status: Accepted
N = input()
if all([n == '9' for n in N]):
  print(9 * len(N))
else:
  print(max(9 * (len(N) - 1) + (int(N[0]) - 1), sum(list(map(int, N)))))
# Judge status: Accepted
# Code for C - City Savers
# Use input() to fetch data from STDIN
n = input()
a = [int(x) for x in input().split()]
b = [int(x) for x in input().split()]

total = 0
for i in range(len(a) - 1):
    s = min(a[i], b[i])
    a[i] = a[i] - s
    b[i] = b[i] - s

    t = min(a[i+1], b[i])
    a[i+1] = a[i+1] - t
    b[i] = b[i] - t
    total += s + t


print(total)
# Judge status: Accepted
N, M = map(int, input().split())
from collections import*
c = Counter(map(int, input().split()))
for _ in range(M):
    B, C = map(int, input().split())
    c[C] = c[C] + B if C in c else B
s = 0
for i in sorted(c.items())[::-1]:
    m = min(i[1], N)
    s += i[0] * m
    N -= m
print(s)
# Judge status: Accepted
s=list(input())
mod=2019
A=[0]*2019
a=0
b=1
for i in range(len(s)):
  a=(a+int(s[-1-i])*b)%mod
  A[a]+=1
  b=b*10%mod
ans=A[0]*(A[0]+1)//2
for i in range(1,2019):
  if A[i]!=0:
    ans=ans+(A[i]-1)*A[i]//2
print(ans)
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
d=int(input())
ans=0
if a<=b:
    ans=a*c
else:
    ans=b*c+(a-b)*d
print(ans)
# Judge status: Accepted
N=int(input())
for i in range(1,10):
    if N%i==0 and N/i<=9:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

x = A[0]
y = sum(A[1:])

c=x-y
ans=abs(c)

for i in range(1,N-1):
  c+=2*A[i]
  if abs(c)< abs(ans):
    ans = abs(c)

print(ans)
# Judge status: Accepted
H, N = map(int, input().split())
A, B = [], []
for i in range(N):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)

# dp
INF = 1 << 30
dp = [INF] * (H + 1) # dp[i]: モンスターの体力を i 減らすため消耗する魔力の最小値
dp[0] = 0
for h in range(H + 1):
	for n in range(N):
		dp[h] = min(dp[h], B[n] + dp[max(h - A[n], 0)])

print(dp[H])
# Judge status: Accepted
import itertools
N, D = map(int, input().split())
count = 0
 
X = []
for i in range(N):
    X.append(list(map(int, input().split())))

for i in list(itertools.combinations(X, 2)):
    f = 0
    for j in range(D):
        f += (i[0][j]-i[1][j])**2
    f **= 0.5
    if f.is_integer():
        count += 1
print(count)
# Judge status: Wrong Answer
N,M = [int(i) for i in input().split()]
S = 0

if N <= 2*M:
    S = N + (M - 2*N)//4
else:
    if N > M//2:
        S = M//2
    else:
        S = N

print(S)
# Judge status: Wrong Answer
from collections import deque

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

dist = [-1]*n
que = deque()
dist[0]=0
que.append(0)
while len(que):
    v = que.pop()
    for node in G[v]:
        if dist[node]==-1:
            dist[node]=dist[v]+1
            que.append(node)

if dist[-1]==2:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
h,n = map(int,input().split())
P = []
M = []

for i in range(n):
    p,m = map(int,input().split())  
    P.append(p)
    M.append(m)
    
dp=[[999999999]*(h+1) for _ in range(n+1)]
dp[0][0] = 0
for i in range(n):
    for j in range(h+1):
        dp[i+1][j] = min(dp[i+1][j],dp[i][j])
        dp[i+1][min(j+P[i],h)] = min(dp[i+1][min(j+P[i],h)],dp[i+1][j] + M[i] )
 
print(dp[n][h])
# Judge status: Wrong Answer
def main():
    S = input()
    if S[2] == S[3] and S[4] == S[4]:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()
# Judge status: Accepted
import networkx as nx
n,m,*s = map(int, open(0).read().split())
 
g=nx.Graph()
g.add_nodes_from([i for i in range(1,n+1)])
for x in zip(*[iter(s)] * 2):
    g.add_edge(x[0],x[1])
di=nx.predecessor(g,source=1)
 
if len(di)!=n:
    print("No");exit()
print("Yes")
for x in range(2,n+1):
    print(di[x][0])
# Judge status: Wrong Answer
n = int(input())
ans = n
d = {}
for i in range(n):
  x,l = map(int, input().split())
  d[x] = l
if n == 1:
  print(ans)
else:
  s = list(d.keys())
  s.sort()
  st = s[0]-d[s[0]]
  gl = s[0]+d[s[0]]
  for i in s[1:]:
    if st<i+d[i] and i-d[i]<gl:
      ans -= 1
      continue
    else:
      st = min(st,i-d[i])
      gl = min(gl,i+d[i])
print(ans)
# Judge status: Accepted
def factorize(N):  # 素因数分解
    p, PRIME = 2, set()
    while p * p <= N:
        if N % p == 0:
            N //= p
            PRIME.add(p)
        else:
            p += 1
    if N > 1:
        PRIME.add(N)
    return PRIME


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

ans = factorize(a) & factorize(b)
print(len(ans) + 1)
# Judge status: Wrong Answer
s = input()
count1 = 0
count2 = 0
count3 = 0
count4 = 0
if s[0] == 'A'and s[1].islower() == True:
    count1 += 1
for i in range(2, len(s) - 2):
    if (s[i] == 'C'):
        count2 += 1
for i in range(len(s) - 2, len(s)):
    if s[i].islower() == True:
        count3 += 1
if count1 != 1 or count2 != 1 or count3 != 2:
    print('WA')
else:
    print('AC')
# Judge status: Accepted
a,b=map(int,input().split())
def ceil(x):
  if x%1==0:
    return x//1
  else:
    return x//1+1
a1=int(ceil(a*100/8))
a2=int(ceil((a+1)*100/8)-1)
b1=int(ceil(b*100/10))
b2=int(ceil((b+1)*100/10)-1)
count=0
for i in range(a1,a2+1):
  if b1<=i<=b2:
    print(i)
    count=0
    break
  else:
    count+=1
if count!=0:
  print(-1)
# Judge status: Accepted
n = int(input())
l = list(map(int,input().split()))
x = max(l)
if sum(l)-x>x:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a=list(map(int,input().split()))
n=a[0]
m=a[1]
touhyou=list(map(int,input().split()))
s=float(sum(touhyou)/4/m)
list=[]
for i in touhyou:
  if i>=s:
    list.append(i)
if len(list)>=m:
  print("Yes")
else:
  print("No" )
# Judge status: Accepted
a, b, c = map(int, input().split())

s = (a+b+c)/2
S = s*(s-a)*(s-b)*(s-c)

print(int(S**0.5))
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))

sum_ = 0
for i in range(n-1):
  for j in range(i,n):
    sum_ += a[i] ^ a[j]
print(int(sum_%(1e9+7)))
# Judge status: Accepted
s = list(input().split())
print(s[0][0]+s[1][0]+s[2][0])
# Judge status: Wrong Answer
n=list(map(int,input().split()))
for i in range(len(n)):
  if n[i]==0:
    print(i)
    break
# Judge status: Accepted
from collections import Counter
n = int(input())

a = list(map(int, input().split()))
c = Counter(a)
f = [0,0]
for k in c.keys():
    if c[k] >= 2:
        f.append(k)
    if c[k] >= 4:
        f.append(k)

f.sort()

[a, b] = f[-2:]

print(a*b)
# Judge status: Wrong Answer
from math import ceil

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

y = ceil(sum(numeros)/n)
soma = 0
for v in numeros:
	soma += (v-y)**2

print(soma)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = [0] * n

for i in range(n):
    ans[a[i]-1] = i+1

print(*ans)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if a < d and c < b:
  if b < d:
    if a < c:
      print(b - c)
    else:
      print(b - a)
  else:
    if a < c:
      print(d - c)
    else:
      print(d - a)
else:
  print(0)
# Judge status: Accepted
a = input()
if a == a.upper():
  print("A")
else:
  print("a")
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
c=1
for i in range(n):
  if a[i]==c:
    ans[i]=1
    c+=1
print(n-sum(ans))
# Judge status: Accepted
def framod(x,y,p=10**9+7):
  for i in range(x+1,y+1):
    x = (x*i)%p
  return x
    
#########################################

n,a,b=map(int,input().split())
p=10**9+7

ans=0
for i in [a,b]:
  upper = framod(n-i+1,n,p)
  lower = framod(1,i,p)
  ret = (upper*pow(lower,p-2,p))%p
  ans = (ans+ret)%p
print((pow(2,n,p)-ans-1)%p)
# Judge status: Accepted
n = int(input())
s = str(input())

h = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"
h = h.upper()
ans = str("")

for i in range(len(s)):
    for j in range(26):
        if s[i] == h[j]:
            ans +=h[j+n]
            continue

print(ans)
# Judge status: Accepted
import sys


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


N, M = map(int, input().split())
drinks = sorted(tuple(map(int, input().split())) for _ in range(N))
ans = 0
for A, B in drinks:
    if M > B:
        ans += A * B
        M -= B
    else:
        ans += A * M
        break
print(ans)
# Judge status: Wrong Answer
N = int(input())

if 999 >= N >= 100:
    print("ABC" + str(N))
if 99 >= N >= 10:
    print("ABC0" + str(N))
if 9 >= N >= 1:
    print("ABC00" + str(N))
if 1008 >= N >= 1000:
    M = N - 999
    print("ABD00" + str(M))
if 1098 >= N >= 1009:
    M = N - 999
    print("ABD0" + str(M))
if 1998 >= N >= 1099:
    M = N - 999
    print("ABD" + str(M))
# Judge status: Wrong Answer
import math
n = int(input())
*a, = map(int, input().split())

ave = math.ceil(sum(a)/n)

ans = 0
for _a in a:
    ans += (ave-_a)**2

print(ans)
# Judge status: Accepted
W, H, x, y = map(int, input().split())
print(W*H/2, int(2*x == W and 2*y == H))
# Judge status: Accepted
n = int(input())
a1 = list(map(int,input().split()))
a2 = list(map(int,input().split()))
ame = 0
for i in range(n):
  get = sum(a1[0:i+1])+sum(a2[i:n])
  ame = max(ame,get)
print(ame)
# Judge status: Wrong Answer
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

import math
t1 = math.ceil(n/a)
t2 = t1+max(1,math.ceil(n/b-t1+1))
t3 = t2+max(1,math.ceil(n/c-t1+2))
t4 = t3+max(1,math.ceil(n/d-t1+3))
t5 = t4+max(1,math.ceil(n/e-t1+4))

print(t5)
# Judge status: Wrong Answer
n,k,x,y = map(int, open(0))
print(k*x+(n-k)*y)
# Judge status: Accepted
def II(): return int(input())
def MI(): return map(int, input().split())
N,K=MI()
ans=0
MOD=10**9+7
for i in range(K,N+2):
  x=(N+1-i)*i+1
  ans+=x
  ans%=MOD
print(ans)
# Judge status: Accepted
X, Y, A, B, C = map(int, input().split())
P = sorted(list(map(int, input().split())), reverse=True)
Q = sorted(list(map(int, input().split())), reverse=True)
R = sorted(list(map(int, input().split())), reverse=True)
print(sum(sorted(P[:X] + Q[:Y] + R, reverse=True)[:X+Y]))
# Judge status: Wrong Answer
k=int(input())

if (k%2==0) or (k%5==0):
  print(-1)
  exit()

if k%7==0:
  k//=7

o=0
m=1
if k==1:
  print(1)
  exit()

for i in range(1,k):
  m*=10
  o+=m%k
  o%=k
  if o==0:
    print(i)
    exit()
# Judge status: Wrong Answer
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

#print((v-w) // (b-a), v-w, b-a)
if (b-a) <= t*(v-w):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
i = list(map(int, input().split()))
if 1 <= i[0] and i[0] <= 100:
    N = i[0]
else:
    print('N is invalid value.')
if 0 <= i[1] and i[1] <= 4111:
    R = i[1]
else:
    print('R is invalid value.')

if N < 10:
    rate = R + (100 * (10 - N))
else:
    rate = R

print(rate)
# Judge status: Wrong Answer
q,h,s,d = map(int,input().split())
n = int(input())

cost = {}
cost["2"] = d
cost["1"] = s * 2
cost["0.5"] = h * 4
cost["0.25"] = q * 8
cost = sorted(cost.items() , key=lambda x:x[1])

ans = 0

for i in cost:
    L = float(i[0])
    C = i[1] * L // 2
    
    if L <= n:
        ans += C * (n//L)
        n %= L
        
print(int(ans))
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
print('NYoe s'[a<c or b>c::2])
# Judge status: Accepted
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N = Z()
    s = input()
    a, b = [0], [0]
    for i in range(N):
        if s[i] == '#': a.append(a[-1]+1)
        else: a.append(a[-1])

        if s[-1-i] == '.': b.append(b[-1]+1)
        else: b.append(b[-1])
    b = b[::-1]
    output =  10 ** 6
    for x, y in zip(a, b): output = min(output, x + y)
    print(output)

    return

if __name__ == '__main__':
    main()
# Judge status: Accepted
n, a, b = map(int, input().split())

q, r = divmod(n, (a + b))

answer = a * q + min(a, r)
print(answer)
# Judge status: Accepted
def sol(score,hand):
    if hand=="r":
        return score["p"]
    elif hand=="p":
        return score["s"]
    elif hand=="s":
        return score["r"]
    return 0
n,k=map(int,input().split())
r,s,p=map(int,input().split())
t=input()
win=""
for num,val in enumerate(t):
    if num<k or win[num-k]!=val:
        win+=val
    else:
        win+="n"
score={"r":r,"p":p,"s":s}
ans=0
for val in win:
    ans+=sol(score,val)

print(ans)
# Judge status: Accepted
N,M = map(int,input().split())
def make_divisors(n):
    divisors = []
    # 試し割りで、かつ積でnを作るときの相方も同時に追加してる
    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
div_ls = make_divisors(M)
ans = 1
for div in div_ls:
    if div*N <= M:
        ans = max(ans,div)
print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())

if a is b and b is c:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
a.sort()
A = sum(a[1::2])
B = sum(a[2::2])

print(A-B)
# Judge status: Accepted
W, a, b = map(int,input().split())
if a > b:
    a, b = b, a
print(max(0,b-(a+W)))
# Judge status: Wrong Answer
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.sort(reverse=True)
sa=[]
be=k

for i in a:
  sa.append(be-i)
  be=i
  
print(sum(sa)-max(sa))
# Judge status: Accepted
n = int(input())
h = [int(i) for i in input().split()]
hmax = h[0]
count = 0
for i in range(1,n):
    if hmax-1 <= h[i]:
        count += 1
        hmax = max(hmax,h[i])
    else:
        break
if n-1 == count:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
A,B = [int(i) for i in input().split()]
if A <10 and B < 10:
    print(A*B)
else:
    print(-1)
# Judge status: Wrong Answer
x,y = input().split()
a = (2 * int(x)) - (int(y)/2)
b = (int(y)/2) - int(x)

if (a + b == int(x)) and ((2*a) + (4*b) == int(y)) and a>=0 and b>=0:
    print("yes") 
else:
    print("no")
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
A, B = map(int, input().split())

xmin = 1
while xmin < 100*A:
    if int(0.08*xmin) == A and int(0.1*xmin) == B :
        print(int(xmin))
        exit()
    elif int(0.08*xmin) < A or int(0.1*xmin) < B :
        xmin += 1
    else :
        print(-1)
        exit()
# Judge status: Accepted
N = input()


def main():

    if int(N) % 111 == 0:
        print(N)
        return

    cnt = int(N)
    while True:
        if cnt % 111 == 0:
            print(cnt)
            return
        cnt += 1


main()
# Judge status: Wrong Answer
c = {}
for i in range(3):
  c[i] = list(map(int, input().split()))
a = [min(c.get(0)), min(c.get(1)), min(c.get(2))]
b = [min(c.get(0)[0], c.get(1)[0], c.get(2)[0]), min(c.get(0)[1], c.get(1)[1], c.get(2)[1]), min(c.get(0)[2], c.get(1)[2], c.get(2)[2])]
tf = True
for i in range(3):
  for j in range(3):
    tf = True if c.get(i)[j] == a[j] + b[j] else False
if tf:
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
N=int(input())
S=input()
ans=[]
black=0
white=0
for n in range(N):
    if S[n]=='.':
        white+=1
    else:
        black+=1
stones={'b':0,'w':white}
for n in range(N):
    if S[n]=='#':
        stones['b']+=1
    else:
        stones['w']-=1
    ans.append(stones['b']+stones['w'])
if 'b' in stones:
    if stones['b']==N:
        print(0)
    else:
        print(min(ans))
else:
    print(min(ans))
# Judge status: Accepted
# -*- coding: utf-8 -*-

n = int(input())

cnt = 0
for i in range(1, n+1):
    if len(str(i)) % 2 != 0:
        cnt += 1

print(cnt)
# Judge status: Accepted
import math
N, K = map(int, input().split())

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

def cal(x):
    s = 0
    for aa in a:
        s += math.ceil(aa / x) - 1
    if s <= K: return True
    else: return False

l = 0
r = max(a)
while r - l > 1:
    mid = (l + r) // 2
    if cal(mid):
        r = mid
    else:
        l = mid
print(r)
# Judge status: Accepted
import math
N,D = map(int,input().split())

X = []
for i in range(N):
  x = list(map(int,input().split()))
  X.append(x)
cnt = 0

for i in range(N):
  for j in range(i+1,N):
    dist = 0
    for k in range(D):
      dist += pow(X[i][k]-X[j][k],2)
    dist = math.sqrt(dist)
    
    if dist.is_integer():
      cnt += 1
      
print(cnt)