Harryxun/stf_run huggingface dataset:
import math
import heapq
N, D, A = map(int, input().split())

M = []
for i in range(N):
    X, H = map(int, input().split())
    M.append((X, H))
M.sort(key=lambda x: x[0])


hq = []
heapq.heapify(hq)  # リストhqのheap化
ans = 0
B = 0
dx = M[0][0]+2*D
dd = math.ceil(M[0][1]/A)*A
for i, (x, h) in enumerate(M):
    while x > dx:
        B -= dd
        if B == 0:
            break
        dx, dd = heapq.heappop(hq)
    if h > B:
        t = math.ceil((h-B)/A)
        ans += t
        B += t*A
        if i != 0:
            heapq.heappush(hq, (x+2*D, t*A))
            if len(hq) == 1:
                dx = x+2*D
                dd = t*A


print(ans)


### FIXED CODE ###

import math
N, D, A = map(int, input().split())

M = []
for i in range(N):
    X, H = map(int, input().split())
    M.append((X, H))
M.sort(key=lambda x: x[0])

d = []
i = 0

ans = 0
B = 0
for X, H in M:
    while i != len(d) and X > d[i][0]:
        B -= d[i][1]
        i += 1
    if H > B:
        t = math.ceil((H-B)/A)
        ans += t
        B += t*A
        d.append((X+2*D, t*A))


print(ans)
# -*- coding: utf-8 -*-

# get three integers separated with half-width break
a, b, c = map(int, raw_input().split())
if c >= a and c <= b:
    print('Yes')
else
    print("No")
# output


### FIXED CODE ###

# -*- coding: utf-8 -*-

# get three integers separated with half-width break
a, b, c = map(int, raw_input().split())
# output
if c >= a and c <= b:
    print "Yes" 
else:
    print "No"
import sys

def f1(m):
    j=0
    num=0
    for x in ap:
        while j<minus and x*am[j]<m:
            j+=1
        num+=j
    return plus*minus-num
            
def f2(m):
    return f3(m,ap)+f3(m,am)


def f3(m,l):
    nagasa=len(l)
    if nagasa<2: return 0
    j=nagasa-1
    num=0
    for i in range(nagasa):
        while j>-1 and l[i]*l[j]>m:
            j-=1
        num+=j+1
        if i<=j: num-=1
    return num//2

n,k=map(int,input().split())
a=list(map(int,input().split()))
ap=sorted([a[i] for i in range(n) if a[i]>0])
am=sorted([-a[i] for i in range(n) if a[i]<0])
az=sorted([a[i] for i in range(n) if a[i]==0])

plus,minus,zero=len(ap),len(am),len(az)
pz=plus*minus+zero*(zero-1)//2+zero*(n-zero)


if plus*minus>=k:
    h,l=0,ap[-1]*am[-1]
    while l-h>1:
        md=(h+l)//2
        p=f1(md)
        if p>=k: h=md
        elif p<k: l=md
    print(-h)

elif pz>=k:
    print(0)

else:
    k-=pz
    if ap: h,l=ap[-1]**2,ap[0]**2-1
    if am: h,l=max(h,am[-1]**2),min(l,am[0]**2)
    while h-l>1:

        md=(h+l)//2
        p=f2(md)
        if p>=k: h=md
        elif p<k: l=md
    print(h)

### FIXED CODE ###

import sys

def f1(m):
    j=0
    num=0
    for x in ap[::-1]:
        while j<minus and x*am[j]<m:
            j+=1
        num+=j
    return plus*minus-num
            
def f2(m):
    return f3(m,ap)+f3(m,am)


def f3(m,l):
    nagasa=len(l)
    if nagasa<2: return 0
    j=nagasa-1
    num=0
    for i in range(nagasa):
        while j>-1 and l[i]*l[j]>m:
            j-=1
        num+=j+1
        if i<=j: num-=1
    return num//2

n,k=map(int,input().split())
a=list(map(int,input().split()))
ap=sorted([a[i] for i in range(n) if a[i]>0])
am=sorted([-a[i] for i in range(n) if a[i]<0])
az=sorted([a[i] for i in range(n) if a[i]==0])

plus,minus,zero=len(ap),len(am),len(az)
pz=plus*minus+zero*(zero-1)//2+zero*(n-zero)


if plus*minus>=k:
    h,l=0,10**18
    while l-h>1:
        md=(h+l)//2
        p=f1(md)
        if p>=k: h=md
        else: l=md
    print(-h)

elif pz>=k:
    print(0)

else:
    k-=pz
    h,l=10**20,0
    while h-l>1:
        md=(h+l)//2
        p=f2(md)
        if p>=k: h=md
        else: l=md
    print(h)
Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]!="A" and Ss[i]!="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
print(max(anss))

### FIXED CODE ###

Ss=[i for i in input()]
anss = []
counter = 0
for i in range(len(Ss)):
    if Ss[i]!="A" and Ss[i]!="C" and Ss[i]!="G" and Ss[i]!="T":
        anss.append(counter)
        counter=0
    else:
        counter+=1
        anss.append(counter)
if len(anss)!=0:
    print(max(anss))
else:
    print(0)
A1=int(input())
A2=int(input())
A3=int(input())
point=A1+A2+A3
if point >= 22:
  print("bust")
else:
  print("win")

### FIXED CODE ###

s=list(map(int,input().split()))
point=sum(s)
if point >= 22:
  print("bust")
else:
  print("win")
import math

N,X = map(int,input().split())
x = list(map(int,input().split()))
distance = []

for i in x:
    distance.append(abs(i-X))

while len(distance) > 1:
        cd = math.gcd(distance[0],distance[1])
        del distance[0]
        del distance[0]
        distance.append(cd)

print(distance[0])


### FIXED CODE ###

A,B = map(int, input().split())
if A * B % 2 == 0:
    print("No")
else:
    print("Yes")
## C
N, M = map( int, input().split() )
H = list(map(int, input().split()) )
AB = [list( map( int,input().split() ) ) for x in range(M)]
comp = [[0 for j in range(1)] for i in range(N)]
for i in range(M):
    comp[AB[i][0]-1].append(AB[i][1])
val = 0
for i in range(M):
    if len(set(comp[i])) > 1:
        val += 1
print(val + N - len(set(sum(AB, []) ) ) )

### FIXED CODE ###

N, M = map( int, input().split() )
H = list(map(int, input().split()) )
flg = [1] * N
for i in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    if H[A] > H[B]:
        flg[B] = 0
    elif H[A] < H[B]:
        flg[A] = 0
    elif H[A] == H[B]:
        flg[A] = 0
        flg[B] = 0
print(sum(flg))
N,W = map(int,input().split())
dp = [0]*(N+1)
for _ in range(N):
  w,v = map(int,input().split())
  for i in range(W,W-w-1,-1):
    dp[i] = max(dp[i-w]+w,dp[i])
print(max(dp))

### FIXED CODE ###

N,W = map(int,input().split())
dp = [[0]*(W+1) for _ in range(N+1)]
for i in range(N):
  w,v = map(int,input().split())
  for j in range(W+1):
    dp[i+1][j] = max(dp[i+1][j],dp[i][j])
    if j+w<=W:
      dp[i+1][j+w] = max(dp[i][j]+v,dp[i+1][j+w])
print(max(dp[N]))
def main():
    S = input()
    con = 10**9 + 7

    def get_mod(S):
        c = {}
        iii = 1
        for i in range(len(S)):
            if S[len(S) - i - 1] != "?":
                c[i] = {(int(S[len(S) - i - 1]) * iii) % 13: 1}
                iii *= 10
                iii %= 13
                continue
            c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
            iii *= 10
            iii %= 13
        return c
    c = get_mod(S)

    def get_tdp(pdp):
        tdp = {i: 0 for i in range(13)}
        for r in v.keys():
            for _r, _v in pdp.items():
                tdp[(_r + r) % 13] += _v
        for i in range(13):
            tdp[i] %= con
        return tdp

    it = iter(c.items())
    pdp = next(it)[-1]
    for k, v in it:
        pdp = get_tdp(pdp)

    ans = pdp[5]
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

S = input()
con = 10**9 + 7

T = [s if s != "?" else "0" for s in S]
T = int(''.join(T))
SS = T % 13

def get_mod(S):
    c = {}
    iii = 1
    for i in range(len(S)):
        if S[len(S) - i - 1] != "?":
            iii *= 10
            iii %= 13
            continue
        c[i] = {(j * iii) % 13: 1 for j in range(0, 10)}
        iii *= 10
        iii %= 13
    return c
c = get_mod(S)

def get_tdp(pdp):
    tdp = {i: 0 for i in range(13)}
    for r in v.keys():
        for _r, _v in pdp.items():
            tdp[(_r + r) % 13] += _v
    for i in range(13):
        tdp[i] %= con
    return tdp

pdp = {i: 0 for i in range(13)}
pdp[SS] += 1
for k, v in c.items():
    pdp = get_tdp(pdp)

ans = pdp[5]
print(ans)
s = input()
s = s.split()

s.sort()

if s = ["5","5","7"]:
  print("YES")
else:
  print("NO")

### FIXED CODE ###

form = input()
form = form.split()
form.sort()

if form == ["5","5","7"]:
  print("YES")
else:
  print("NO")
a,b,c = map(int, raw_input().split(" "))
if a <= b :
    if a <= b <= c :
        print("%d %d %d" % a b c)
    elif a <= c <= b :
        print("%d %d %d" % a c b)
    else :
        print("%d %d %d" % c a b)
else :
    if b <= a <= c :
        print("%d %d %d" % b a c)
    elif b <= c <= a :
        print("%d %d %d" % b c a)
    else :
        print("%d %d %d" % c b a)

### FIXED CODE ###

al = list(map(int, input().split()))
al = sorted(al)
print(al[0],al[1],al[2])
while true:
H,W = map(int,raw_input().split())
if W==0 and H==0 :
    break
print '#' * W + '\n'

print ('#'+ '.'*(W-2)+ '#'+'\n')*(H-2)
print '#'*W + '\n'

### FIXED CODE ###

while 1:
    H, W = map(int,raw_input().split())
    if H + W == 0: break
    print ('#' * W)
    for h in range(H-2):
        print ('#' + '.' * (W - 2) + '#')
    print ('#' * W + '\n')
from fractions import gcd

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

A = set(A)
half = [i/2 for i in A]
# print(half)

# def lcm(x, y):
#     return (x * y) // gcd(x, y)


a = 1
for hi in half:
    a *= hi

b = 1
for ai in A:
    b *= ai
b //= 2
# print(a, b)

n = ((M - a) / b) + 1
print(int(n))

### FIXED CODE ###

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

half = [i//2 for i in A]

def f(v):
    r = 0
    while v % 2 == 0:
        v /= 2
        r += 1
    return r

from fractions import gcd
def f2(x, y):
    return (x * y) // gcd(x, y)

d = f(A[0])
for ai in A:
    if d != f(ai):
        print(0)
        break
else:
    lcm = 1
    for ai in half:
        lcm = f2(lcm, ai)

    r = M // lcm
    ans = (r + 1) // 2
    print(ans)
#coding: utf-8
import sys

N = map(int, sys.stdin)
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)

### FIXED CODE ###

#coding: utf-8

N = int(input())
a = []
for i in range(N):
    a.append(int(input()))

start = 0
count = 0

for i in range(N):
    count += 1
    next = a[start]
    if(next == 2):
        print(count)
        break
    start = next - 1
else:
    print(-1)
import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(2*h, dtype=int)
for i in range(1, h+1):
    dp[i] = np.min(dp[i-a] + b)

print(dp[h])

### FIXED CODE ###

import numpy as np

h, n = map(int, input().split())
ab = np.array([tuple(map(int, input().split())) for _ in range(n)])

a, b = ab[:, 0], ab[:, 1]
dp = np.zeros(h+1, dtype=np.int)
for i in range(1, h+1):
    dp[i] = np.min(dp[np.maximum(i-a, 0)] + b)

print(dp[h])
h1, m1, h2, m2, k = map(int, input().split(" "))
A = list(map(int, input().split(" ")))

start = h1*60+m1
end = h2*60+m2
total = end - start - k

print(k)

### FIXED CODE ###


h1, m1, h2, m2, k = map(int, input().split(" "))

start = h1*60+m1
end = h2*60+m2
total = end - start - k

print(total)
n,k = map(int,input().split())
s = list(input())
s[k-1]= str.lower(s[k-1])
"".join(s)uu

### FIXED CODE ###

n,k = map(int,input().split())
s = list(input())
s[k-1]= str.lower(s[k-1])
print("".join(s))
a, b, c = map(int, input().split())
from math import isqrt
if 2 * isqrt(a * b) < c - a - b:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

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

d = c - a - b
if d > 0 and d**2 > 4 * a * b:
    print('Yes')
else:
    print('No')
import math


def euclid(a, b):
    mod = a % b
    return b if mod == 0 else euclid(b, mod)


def seachPrimeNum(N):
    max = int(math.sqrt(N))
    seachList = [i for i in range(2, N + 1)]
    primeNum = []
    while seachList[0] <= max:
        primeNum.append(seachList[0])
        tmp = seachList[0]
        seachList = [i for i in seachList if i % tmp != 0]
    primeNum.extend(seachList)
    return primeNum


def p_d():
    a, b = map(int, input().split())
    gcd = euclid(max(a, b), min(a, b))

    ans = 1
    nums = seachPrimeNum(gcd)
    for i in nums:
        if gcd % i == 0:
            ans += 1

    print(ans)


if __name__ == '__main__':
    p_d()


### FIXED CODE ###

def calc_gcd(a, b):
    return calc_gcd(b, a % b) if b else a


def p_d():
    a, b = map(int, input().split())
    gcd = calc_gcd(a, b)
    ans = 1
    cnt = 2
    while cnt * cnt < gcd:
        up = True
        while gcd % cnt == 0:
            if up:
                ans += 1
                up = False
            gcd //= cnt
        cnt += 1
    ans += 1 if gcd != 1 else 0
    print(ans)


if __name__ == '__main__':
    p_d()
import sys
input = sys.stdin.input
def check(S, cnt):
    if len(S) < 2:
        print(cnt)
        sys.exit()
    for i in range(len(S) - 1):
        if S[i] != S[i + 1]:
            S = S[:i] + S[i + 2:]
            cnt += 2
            check(S, cnt)
    print(cnt)
    sys.exit()

S = list(map(int, list(input())))
check(S, cnt=0)

### FIXED CODE ###

def main():
    S = list(map(int, list(input())))

    cnt1 = sum(S)
    cnt0 = len(S) - cnt1
    print(2 * min(cnt0, cnt1))


if __name__ == "__main__":
    main()
lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and lst1[1] >=13):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<lst1[0] <=12:
      print("MMYY")
elif 0<lst1[1]<=12:
      print("YYMM")

### FIXED CODE ###

lst = list(input())
lst1 = []
lst1.append(lst[0]+lst[1])
lst1.append(lst[2]+lst[3])

if (int(lst1[0]) >=13 and int(lst1[1]) >=13) or (int(lst1[0]) >=13 and lst1[1] =="00") or (lst1[0] =="00" and int(lst1[1]) >=13) or (lst1[0] =="00" and lst1[1] == "00"):
  print("NA")
  
elif (0<int(lst1[0])<=12 and 0<int(lst1[1])<=12):
      print("AMBIGUOUS")
      
elif 0<int(lst1[0]) <=12:
      print("MMYY")
elif 0<int(lst1[1])<=12:
      print("YYMM")
n = input()
sum = 0
for i in range(0,n):
    x,u = input().split()
    x = float(x)
    if u == 'BTC':
        x = x *380000
    sum = sum + x
print (sum)


### FIXED CODE ###

n = int(input())
sum = 0
for i in range(0,n):
    x,u = input().split()
    x = float(x)
    if u == 'BTC':
        x = x *380000
    sum = sum + x
print (sum)
time = []
for _ in range(5):
    time.append(int(input()))

mod = []
for i in time:
    mod.append(i % 10)

mod = [i for i in mod if i != 0]

for i in range(len(mod)):
    mod[i] = 10 - mod[i]

add = sum(mod) - max(mod)

print(sum(time) + add)

### FIXED CODE ###

time = []
for _ in range(5):
    time.append(int(input()))

mod = []
for i in time:
    mod.append(i % 10)

mod = [i for i in mod if i != 0]

for i in range(len(mod)):
    mod[i] = 10 - mod[i]

if len(mod) == 0:
    add = 0
else:
    add = sum(mod) - max(mod)

print(sum(time) + add)
N, X = [int(a) for a in input().split()]
ans = 0
now_level = N
num_list = [2 ** (n + 2) - 3 for n in range(N + 1)]
while X > 0:
    if X == 1:
        break
    num_list = [2 ** (n + 2) - 3 for n in range(now_level + 1)]
    plus_base = [a + now_level - b for a, b in zip(num_list, range(now_level + 1))]
    eat_num = max([a for a in plus_base if a <= X])
    eat_level = plus_base.index(eat_num)
    now_level = eat_level
    ans += int((num_list[eat_level] + 1) / 2 + 0.1)
    X -= eat_num
    if X > 0:
        X -= 1
        ans += 1
print(str(ans))



### FIXED CODE ###

N, X = [int(a) for a in input().split()]
ans = 0
now_level = N
num_list = [2 ** (n + 2) - 3 for n in range(N + 1)]
while X > 0:
    if X <= now_level:
        break
    num_list = [2 ** (n + 2) - 3 for n in range(now_level + 1)]
    plus_base = [a + now_level - b for a, b in zip(num_list, range(now_level + 1))]
    eat_num = max([a for a in plus_base if a <= X])
    eat_level = plus_base.index(eat_num)
    now_level = eat_level
    ans += int((num_list[eat_level] + 1) / 2 + 0.1)
    X -= eat_num
    if X > 0:
        X -= 1
        ans += 1
print(str(ans))
num_origin = input()
gohyoku = int(num_origin/500)
num_zan = num_origin - gohyoku*500
go = int(go/5)

num = go*5 + gohyoku*1000

print(num)

### FIXED CODE ###

num_origin = int(input())
gohyoku = int(num_origin/500)
num_zan = num_origin - gohyoku*500
go = int(num_zan/5)
 
num = go*5 + gohyoku*1000
 
print(num)
n = int(input())
T = list(map(int, input().split()))
sumT = sum(T)
m = int(input())
for i in range(m):
  a, b = map(int, input().split())
  print(sumT - T[a] + b)

### FIXED CODE ###

n = int(input())
T = list(map(int, input().split()))
sumT = sum(T)
m = int(input())
for i in range(m):
  a, b = map(int, input().split())
  print(sumT - T[a - 1] + b)
import itertools


X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

AB = [a + b for (a, b) in list(itertools.product(A, B))]
AB.sort(reverse=True)
ans = [ab + c for (ab, c) in list(itertools.product(AB[:min(3000, X*Y*Z)], C))]
ans.sort(reverse=True)
for i in range(K):
    print(ans[i])

### FIXED CODE ###

#abc123d
 
x,y,z,k=map(int,raw_input().split())
a=sorted(map(int,raw_input().split()),reverse=True)
b=sorted(map(int,raw_input().split()),reverse=True)
c=sorted(map(int,raw_input().split()),reverse=True)
 
ab=sorted([i+j for i in a for j in b],reverse=True)
res=sorted([ij+l for ij in ab[:k] for l in c],reverse=True)
for i in res[:k]:
	print i
d int(input())
print('Christmas'+' Eve'*(25-d))

### FIXED CODE ###

d = int(input())
print('Christmas'+' Eve'*(25-d))
N=int(input())




list_a=np.arange(1, N+1)
list_b =[]




for i in list_a:
    if  len(str(i))%2 !=0:
        list_b.append(i)

print(len(list_b))


### FIXED CODE ###

a, b, c = map(int, input().split(" "))
res = (c - (a - b))
if res > 0:
    print(str(res))
else:
    print("0")
import sys
def coun(n):
  if n == 0:
    return 1
  else:
    return (2*coun(n-1))%(10**9+7)
N = int(input())
A = list(map(int, input().split()))
A.sort()
if len(A)%2 == 1:
  if A[0]!=0:
    print(0)
    sys.exit()
  i = 1
  while i <= len(A)//2:
    if A[2*i-1]==2*i and A[2*i]==2*i:
      i += 1
    else:
      print(0)
      sys.exit()
  print(coun(N//2))

if len(A)%2 == 0:
  i = 0
  while i < N//2:
    if A[2*i] == 2*i+1 and A[2*i+1] == 2*i+1:
      i += 1
    else:
      print(0)
      sys.exit()
  print(coun(N//2))

### FIXED CODE ###

import sys
def coun(n):
  i = 0
  ans = 1
  while i < n:
    ans = (ans*2)%(10**9+7)
    i += 1
  return ans
N = int(input())
A = list(map(int, input().split()))
A.sort()
if len(A)%2 == 1:
  if A[0]!=0:
    print(0)
    sys.exit()
  i = 1
  while i <= len(A)//2:
    if A[2*i-1]==2*i and A[2*i]==2*i:
      i += 1
    else:
      print(0)
      sys.exit()
  print(coun(N//2))

if len(A)%2 == 0:
  i = 0
  while i < N//2:
    if A[2*i] == 2*i+1 and A[2*i+1] == 2*i+1:
      i += 1
    else:
      print(0)
      sys.exit()
  print(coun(N//2))
A, B, K = map(int, input().split())
arr = range(A, B + 1)
ans = []
for i in range(K):
    ans[i] = arr[A + i]
for j in range(K):
    ans[j + K + 2] = arr[B + 1 - K + j]
print(set(ans))


### FIXED CODE ###

A, B, K = map(int, input().split())
arr = range(A, B + 1)
ans = []
for i in range(K):
    ans.append(A + i)
for j in range(K):
    ans.append(B + 1 - K + j)

anset = list(set(ans))
anset.sort()
if A+K<=B+1:
    for ele in range(len(anset)):
        print(anset[ele])
else:
    for ele in range(A,B+1):
        print(ele)
import sys
li = list(map(int,input().split()))
li.sort()
if(str(li[0]) == str(li[1]) == str(li[2])):
    print("No")
    sys.exit()
for i in range(3):
  if(str(li[i]) == str(li[i+1])):
    print("Yes")
    break
else:
  print("No")

### FIXED CODE ###

import sys
li = list(map(int,input().split()))
li.sort()
if(str(li[0]) == str(li[1]) == str(li[2])):
  print("No")
  sys.exit()
if(str(li[0]) != str(li[1]) != str(li[2])):
  print("No")
  sys.exit()
for i in range(3):
  if(str(li[i]) == str(li[i+1])):
    print("Yes")
    break
n = int(input())

def get_divisors(num):
    f_divs, l_divs = [], []
    for i in range(1, int(num**0.5)+1):
        if not num % i:
            f_divs.append(i)
            if i != num // i:
                l_divs.append(num // i)
    return f_divs[-1], l_divs[-1]

print(max(*map(lambda x: len(str(x)), get_divisors(n))))


### FIXED CODE ###

n = int(input())

def get_divisors(num):
    f_divs, l_divs = [], []
    for i in range(1, int(num**0.5)+1):
        if not num % i:
            f_divs.append(i)
            l_divs.append(num // i)
    return f_divs, l_divs

div1, div2 = get_divisors(n)
ans = float("inf")
for i in range(len(div1)):
    ans = min(ans, max(len(str(div1[i])), len(str(div2[i]))))
print(ans)
N, M = [int(nm) for nm in input().split()]
X = [int(x) for x in input().split()]

if N >= M:
  print(0)
else:
  X.sort()
  mn_X = X[0]
  for m in range(M):
    X[m] = X[m] - mn_X #一番座標が小さい点を原点とする

  DX = [] #隣り合う二点間の距離
  for mm in range(M-1):
    dx = X[mm+1] - X[mm] #隣り合う二点間の距離を求める
    DX.append(dx)
  print(DX)
  
  DXX = list(tuple(DX))
  DXX.sort(reverse=True) #DXXのi=0,1,2,...,N-2、つまり大きい値を取ってきたい
  I = [] #「XをN個に分割するとき、どの座標で分割するか」
  for i in range(N-1):
    big_dx = DXX[i]
    idx = DX.index(big_dx)
    I.append(idx)
  I.sort()
  print(I)
  
  #最初のコマは原点に置く
  move = X[I[0]] - 0
  print(move)
  
  for j in range(0, N-2):
    move += (X[I[j+1]] - X[I[j]+1])
  print(move)
  
  #最後のコマ
  move += (X[-1] - X[I[N-2]+1])
  
  print(move)

### FIXED CODE ###

N, M = [int(nm) for nm in input().split()]
X = [int(x) for x in input().split()]

if N >= M:
  print(0)
elif N == 1:
  ans = max(X) - min(X)
  print(ans)
else:
  X.sort()
  mn_X = X[0]
  for m in range(M):
    X[m] = X[m] - mn_X #一番座標が小さい点を原点とする

  DX = [] #隣り合う二点間の距離
  for mm in range(M-1):
    dx = X[mm+1] - X[mm] #隣り合う二点間の距離を求める
    DX.append(dx)
  #print(DX)
  
  DXX = list(tuple(DX))
  DXX.sort(reverse=True) #DXXのi=0,1,2,...,N-2、つまり大きい値を取ってきたい
  I = [] #「XをN個に分割するとき、どの座標で分割するか」
  for i in range(N-1):
    big_dx = DXX[i]
    idx = DX.index(big_dx)
    I.append(idx)
  I.sort()
  #print(I)
  
  #最初のコマは原点に置く
  move = X[I[0]] - 0
  #print(move)
  
  for j in range(0, N-2):
    move += (X[I[j+1]] - X[I[j]+1])
  #print(move)
  
  #最後のコマ
  move += (X[-1] - X[I[N-2]+1])
  
  print(move)
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
out = 0
if n == 1:
    if a[0] != 0:
        out = 1
elif a[0] == 0:
    for i in range(1,n//2+1):
        if a[2*i-1] == a[2*i] and a[2*i] == 2*i:
            None
        else:
            out = 1
elif a[0] == 1:
    for i in range(n//2):
        if a[2*i] == a[2*i+1] == 2*i+1:
            None
        else:
            out = 1
else:
    out = 1
if out:
    print(0)
else:
    a = 1
    for i in range(n//2):
        a *= 2
        a = a%(10**9+7)
    print(a)

### FIXED CODE ###

n = int(input())
a = [int(i) for i in input().split()]
a.sort()
out = 0
if n == 1:
    if a[0] != 0:
        out = 1
elif a[0] == 0:
    if n%2 == 0:
        out = 1
    else:
        for i in range(1,n//2+1):
            if a[2*i-1] == a[2*i] and a[2*i] == 2*i:
                None
            else:
                out = 1
elif a[0] == 1:
    if n%2 == 1:
        out = 1
    else:
        for i in range(n//2):
            if a[2*i] == a[2*i+1] == 2*i+1:
                None
            else:
                out = 1
else:
    out = 1
if out:
    print(0)
else:
    a = 1
    for i in range(n//2):
        a *= 2
        a = a%(10**9+7)
    print(a)
import collections
from collections import Counter
n=int(input())
s=[input() for i in range(n)]
s=Counter(s)
p=[]
k=s.most_common()
p.append(s.most_common()[0][0])
for i in range(len(collections.Counter(s))-1):
    if k[i+1][1]==k[i+2][1]:
        p.append(k[i+2][1])
    else:
        break
p=sorted(p)
for i in range(len(p)):
    print(p[i])



### FIXED CODE ###

import collections
from collections import Counter
n=int(input())
s=[input() for i in range(n)]
s=Counter(s)
p=[]
k=s.most_common()
p.append(k[0][0])
for i in range(len(collections.Counter(s))-1):
    if k[i][1]==k[i+1][1]:
        p.append(k[i+1][0])
    else:
        break
p=sorted(p)
for i in range(len(p)):
    print(p[i])