Harryxun/stf_run huggingface dataset:
n,k=map(int,input().split())
h=list(map(int,input().split()))
def changemin(a,b):
    if a>b:
        a=b
        return a
    return a
dp=[]
dp.append(0)
for i in range(1,n):
    dp.append(1000000)
for j in range(1,n):
    for l in range(1,k):
        dp[j]=changemin(dp[j],dp[j-l]+abs(h[j]-h[j-l]))
print(dp[n-1])

### FIXED CODE ###

# educational DP contest A
n,k=map(int,input().split())
h=list(map(int,input().split()))
def changemin(a,b):
    if a>b:
        a=b
        return a
    return a
dp=[]
dp.append(0)
for i in range(1,n):
    dp.append(100000000000)
for m in range(n):
    for j in range(1,min(k+1,n-m)):
        dp[m+j]=changemin(dp[m+j],dp[m]+abs(h[m]-h[m+j]))
print(dp[n-1])
import numpy as np
M=int(input())
D=np.zeros(M,dtype=int)
C=np.zeros(M,dtype=int)
for i in range(M):
  d,c=map(int,input().split())
  D[i]=d
  C[i]=c
  
A=np.zeros(C.sum(),dtype=int)
ind=0
for i in range(D.size):
  for j in range(C[i]):
    A[ind]=D[i]
    ind+=1

yosen=0
while A.size>1:
  found=False
  for i in range(A.size-1):
    if A[i]+A[i+1]>=10:
      newa=A[i]+A[i+1]
      A[i]=newa//10
      A[i+1]=newa%10
      found=True
      yosen+=1
      break
  if not found:
    A[1]=A[0]+A[1]
    yosen+=1
    A=np.delete(A,0)
print(yosen)  

### FIXED CODE ###

import numpy as np
M=int(input())
D=0
C=0
for i in range(M):
  d,c=map(int,input().split())
  D+=c*d
  C+=c
# 桁数を減らす処理はC-1回行われる

# 桁数を減らさない処理は総和から9減る。(D-1)//9回行われる。
print((C-1)+(D-1)//9)
A, B, C, D = map(int, input().split())

for _ in range(10000):
  C -= B
  if C <= 0:
    print("Yes")
    exit()

  A -= D
  if A <= 0:
    print("No")
    exit()


### FIXED CODE ###

s, w = map(int, input().split())

if s > w:
  print("safe")
else:
  print("unsafe")
import collections
I = [int(_) for _ in open(0).read().split()]
N = I[0]
AB = I[1:]
G = collections.defaultdict(set)
for a, b in zip(AB[::2], AB[1::2]):
    G[a].add(b)
    G[b].add(a)
color = [None] * (N + 1)


def dfs(G, v, cur):
    color[v] = cur
    for w in G[v]:
        if color[w] is None:
            dfs(G, w, 1 - cur)


dfs(G, 1, 0)
cand1 = set(range(1, N + 1, 3))
cand2 = set(range(2, N + 1, 3))
cand3 = set(range(3, N + 1, 3))
ans = [None] * (N + 1)
for i in range(1, N + 1):
    if color[i]:
        if len(cand1):
            t = cand1.pop()
        else:
            t = cand3.pop()
    else:
        if len(cand2):
            t = cand2.pop()
        else:
            t = cand3.pop()
    ans[i] = t
print(*ans[1:])


### FIXED CODE ###

import collections
import sys
sys.setrecursionlimit(2*10**5)
I = [int(_) for _ in open(0).read().split()]
N = I[0]
AB = I[1:]
G = collections.defaultdict(set)
for a, b in zip(AB[::2], AB[1::2]):
    G[a].add(b)
    G[b].add(a)
color = [None] * (N + 1)


def dfs(G, v, cur):
    color[v] = cur
    for w in G[v]:
        if color[w] is None:
            dfs(G, w, 1 - cur)


dfs(G, 1, 0)
c=collections.Counter(color[1:])
cand1 = set(range(1, N + 1, 3))
cand2 = set(range(2, N + 1, 3))
cand3 = set(range(3, N + 1, 3))

i0, i1 = 0, 1
if c[0] > c[1]:
    i0, i1 = 1, 0

ans = [None] * (N + 1)
if c[i0] <= len(cand3):
    for i in range(1, N + 1):
        if color[i]==i0:
            ans[i] = cand3.pop()
        else:
            if cand1:
                ans[i] = cand1.pop()
            elif cand2:
                ans[i] = cand2.pop()
            elif cand3:
                ans[i] = cand3.pop()
else:
    for i in range(1, N + 1):
        if color[i] == i0:
            if cand2:
                ans[i] = cand2.pop()
            elif cand3:
                ans[i] = cand3.pop()
        else:
            if cand1:
                ans[i] = cand1.pop()
            elif cand3:
                ans[i] = cand3.pop()
print(*ans[1:])
a= ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
s=raw_input()
idNum=a.index(s)
if idNum == 6:
  print 7
else:
  print 6- idNum


### FIXED CODE ###

a= ["MON","TUE","WED","THU","FRI","SAT","SUN"]
s=raw_input()
idNum=a.index(s)
if idNum == 6:
  print 7
else:
  print 6- idNum
import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    x=(c-b*f/e)/(a-b*d/e)
    y=(c-a*f/d)/(b-a*e/d)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))
    
for i in range(len(ans)):
    print('{0:.4f} {1:.4f}' .format(*ans[i]))

### FIXED CODE ###

import sys

ary=[]
ans=[]
def solve(a,b,c,d,e,f):
    if c*e-b*f==0:
        x=0
    else:
        x=(c*e-b*f)/(a*e-b*d)
    if c*d-a*f==0:
        y=0
    else:
        y=(c*d-a*f)/(b*d-a*e)
    return [x,y]

for i in sys.stdin:
    ary.append(list(map(int,i.split())))
    ans.append(solve(*ary[-1]))

for i in range(len(ans)):
    print('{0:.3f} {1:.3f}'.format(round(ans[i][0],3),round(ans[i][1],3)))
a,b=map(str,input().split())
if a*b%2:
  print('Even')
else:
  print('Odd')


### FIXED CODE ###

a, b = map(int, input().split())
if(a*b%2 == 0 ):
  print('Even')
else:
  print('Odd')
def main():

    def nim(i, parent=None):
        ret = 0
        for j in edges[i]:
            if j == parent:
                continue
            ret ^= nim(j, i) + 1
        return ret

    n = int(raw_input())
    edges = [[] for i in xrange(n)]
    for i in xrange(n - 1):
        x, y = [int(_) - 1 for _ in raw_input().split()]
        edges[x].append(y)
        edges[y].append(x)
    if nim(0) == 0:
        return "Bob"
    else:
        return "Alice"


if __name__ == '__main__':
    print(main())


### FIXED CODE ###

import sys
sys.setrecursionlimit(700000)


def main():

    def nim(i, parent=None):
        ret = 0
        for j in edges[i]:
            if j == parent:
                continue
            ret ^= nim(j, i) + 1
        return ret

    n = int(raw_input())
    edges = [[] for i in xrange(n)]
    for i in xrange(n - 1):
        x, y = [int(_) - 1 for _ in raw_input().split()]
        edges[x].append(y)
        edges[y].append(x)
    if nim(0) == 0:
        return "Bob"
    else:
        return "Alice"


if __name__ == '__main__':
    print(main())
n = int(input())
a = list(map(int, input().split()))
total = 1

if 0 in a:
  print(0)
  exit()

for i in range(n):
  total* = a[i]
  if total > 10** 18
  print(-1)
  break
print(total)
  
         


### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
if 0 in l:
  print(0)
  exit()
ans = 1
for i in range(n):
  ans *= l[i]
  if ans > 10**18:
    ans = -1
    break
print(ans)
import math

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

C = math.gcd(A, B)
print(int((A * B)/C))

### FIXED CODE ###

import fractions

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

C = fractions.gcd(A, B)
print(int((A * B)/C))
X,Y=map(int,input().split())

def cnb(n,k,p):
  if k>n:
    return 0
  c,d=1,1
  for i in range(k+1,n+1):
    c = (c*i)%p
  for i in range(1,k+1):
    d = (d*i)%p
  return (c*pow(d,p-2,p))%p

p=10**9+7
if X > 2*Y or Y > 2*X:
  pass
elif (X+Y)%3:
  pass
else:
  ans=cnb((X+Y)//3,(-X+2*Y)//3,p)

print(ans)


### FIXED CODE ###

x,y = map(int,input().split())
mod = 10**9 + 7

def getComb(a,b,mod):
  if b > a:
    return 0
  if a - b > b :
    b = a - b
  comb = 1
  for i in range(b+1,a+1):
    comb = (comb * i) % mod
  d = 1
  for i in range(1,a-b+1):
    d = (d * i) % mod
  comb *= pow(d,mod-2,mod)
  return comb % mod

if x > 2*y or y > 2*x:
  print(0)
  exit()
if (x+y)%3 != 0:
  print(0)
  exit()
times = (x+y)//3
tmp = abs(x-y)
xtimes = (times - tmp) //2
ans = getComb(times,xtimes,mod)
print(ans)
a=input()
b=False
for i in range(3):
 if a[i+1]==a[i]:
  b=True

if b:
print(“Bad”)
else:
print(“Good”)

### FIXED CODE ###

a=input()
b=False
for i in range(3):
 if a[i+1]==a[i]:
  b=True

if b:
 print("Bad")
else:
 print("Good")
import math
n,m,k = map(int,input().split())
mod = 10**9+7
memo = {}
def factorial(num):
    if num == 0:
        return 1
    if not num in memo:
        memo[num] = num*factorial(num-1)
    return memo[num]

temp = math.factorial(n*m-2)//(math.factorial(k-2)*math.factorial(n*m-4-k))
ans = 0
for d in range(1,n):
    ans += d*((n-d)*(m**2))*temp
for d in range(1,m):
    ans += d*((m-d)*(n**2))*temp
print(ans%mod)

### FIXED CODE ###

n,m,k = map(int,input().split())
mod = 10**9+7
def combination(n,r,p):
    if n < r or r < 0:
        return 0
    r = min(n-r,r)
    
    fact = [1,1]
    factinv = [1,1]
    inv = [0,1]
    for i in range(2,n+1):
        fact.append((fact[-1]*i)%p)
        inv.append((-inv[p%i]*(p//i))%p)
        factinv.append((factinv[-1]*inv[-1])%p)
    return fact[n]*factinv[r]*factinv[n-r]%p
temp = combination(n*m-2,k-2,mod)
ans = 0
for d in range(1,n):
    ans += d*((n-d)*(m**2))*temp
for d in range(1,m):
    ans += d*((m-d)*(n**2))*temp
print(ans%mod)
import itertools
import numpy as np
n,m = map(int,input().split())
M = [[0] * n for i in range(m)]

for i in range(m):
  a,b = map(int,input().split())
  M[a-1][b-1] = 1
couse = list(itertools.permutations(range(n)))
result = 0
M = np.array(M)
for c in couse:
  con = 0
  if(c[0] == 0):
    for i in range(len(c)-1):
      if(M[c[i]][c[i+1]] == 1 or M[c[i+1]][c[i]] == 1):
        con += 1
        print(c[i],c[i+1])
    if (len(c)-1 == con):
      result += 1
print(result)

### FIXED CODE ###

import itertools
n,m = map(int,input().split())
M = [[0] * n for i in range(n)]

for i in range(m):
  a,b = map(int,input().split())
  M[a-1][b-1] = 1
couse = list(itertools.permutations(range(n)))
result = 0
#M = np.array(M)
for c in couse:
  con = 0
  if(c[0] == 0):
    for i in range(len(c)-1):
      if(M[c[i]][c[i+1]] == 1 or M[c[i+1]][c[i]] == 1):
        con += 1
        #print(c[i],c[i+1])
    if (len(c)-1 == con):
      result += 1
print(result)
N = int(input())

import numpy as np

X = np.arange(N+1)
A = X.copy()

for i in [1,10,100,1000,10000]:
    A[i:i*10] = X[i:i*10] // i
B = X % 10
C = np.zeros((10,10), dtype=int)

for i in range(1,N+1):
    C[A[i], B[i]] += 1
count = 0

for i in range(10):
    for j in range(10):
        count += C[i][j] * C[j][i]
print(count)

### FIXED CODE ###

N = int(input())

import numpy as np

X = np.arange(N+1)
A = X.copy()

for i in [1,10,100,1000,10000,100000]:
    A[i:i*10] = X[i:i*10] // i
B = X % 10

C = np.zeros((10,10), dtype=int)

for i in range(1,N+1):
    C[A[i], B[i]] += 1
count = 0

for i in range(10):
    for j in range(10):
        count += C[i][j] * C[j][i]

print(count)
a,b=map(int,input().split())
count=0
for i in range(a,b+1):
    if str(i)　==　str(i)[::-1]:
        count+=1　　#count++はダメ
       
print(count)


### FIXED CODE ###

a,b=map(int,input().split())
cnt = 0
for i in range(a, b+1):
	if str(i) == str(i)[::-1]:
		cnt += 1
 
print(cnt)
#abc142d

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

def factorize(n):
 fct=[]
 b,e=2,0
 while b*b<=n:
  while n%b==0:
   n=n//b
   e =e+1
   if e>0:
    fct.append((b,e))
    b,e=b+1,0
 if n>1:
  fct.append((n,1))
 return fct

a,b=map(int,raw_input().split())
z=gcd(a,b)
print len(factorize(z))+1


### FIXED CODE ###

#abc142a
n=int(raw_input())
if n%2==0:
 print 0.5
else:
 print (1.0+n/2)/n
n=input()
if "Y" in input():
  print("Four")
else:
  print("Three)

### FIXED CODE ###

n=input()
if "Y" in input():
  print("Four")
else:
  print("Three")
pip install sympy 
x = int(input())
from sympy import nextprime
print(nextprime(x - 1))

### FIXED CODE ###

n = int(input())
for i in range(n, 100004):
    flag = 0
    for j in range(2, int(i**0.5) + 1):
        if i % j == 0:
            flag = 1
            break
    if flag == 0:
        print(i)
        break
from collections import Counter as co
n=int(input())
l=sorted(list(map(list,co(map(int,input().split())).items())))
if l[0][0]==0 and l[0][-1]>1:print(0);exit()
ans=1;pre=1
for i,(n,s) in enumerate(l):
  #if i!=n:print(0);exit()
  if i>1:
    ans*=(pre**s)
    ans%=998244353
  pre=s
print(ans)


### FIXED CODE ###

n=int(input())
if n%2:print((n+1)//2-1)
else:print(n//2-1)
N = int(input())
H = [int(x) for x in input().split()]
print(H)
ans = 0
for i in range(N):
    current = 0
    if(N-i < ans):
        break
    
    while(True):
        if(i==N-1):
            break
            \
        elif(H[i] >= H[i+1]):
                current += 1
                i += 1
        else:
            break

    if(current > ans):
        ans = current

print(ans)



### FIXED CODE ###

N = int(input())
H = [int(x) for x in input().split()]
 
ans = 0
current = 0
for i in range(N):
    if(i == N-1):
        if(current > ans):
            ans = current
        break
    if(H[i] >= H[i+1]):
        current += 1
    else:
        if(ans < current):
            ans = current
        current = 0
 
print(ans)
N=int(input())
ans=10**n-2*(9**n)+8**n
ans=ans%1000000007
print(ans)

### FIXED CODE ###

n=int(input())
ans=10**n-2*(9**n)+8**n
ans=ans%1000000007
print(ans)
import math
def main():
	N = int(input())
	P = int(math.log(N,5))
	ans = 0
	if N%2 == 1:
		print(0)
	else:
		ans = [int((N/2)/int(pow(5,p))) for p in range(P)]
		print(sum(ans)+1)

if __name__ == '__main__':
	main()

### FIXED CODE ###

import math
def main():
	N = int(input())
	if N%2 == 1 or N==0:
		print(0)
	else:
		N = N//2
		P = int(math.log(N,5))
		ans = [ N//(5**p) for p in range(1,P+1)]
		print(sum(ans))

if __name__ == '__main__':
	main()
s=input()
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')
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
i=0
count=0
while True:
    count+=min(a[i],b[i])
    if i==n:
        break
    elif a[i]>b[i]:
        i+=1
    else:
        c=b[i]-a[i]
        count+=min(a[i+1],c)
        if c>a:
            a[i+1]=0
            i+=1
        else:
            a[i+1]-=c
            i+=1
print(count)


### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = 0
attack = 0
mon = a[0]
for i in range(n):
    if mon >= b[i]:
        sum += b[i]
        mon = a[i+1]
    else:
        sum += mon
        attack = b[i] - mon
        mon = max(0, a[i+1] - attack)
        sum += (a[i+1] - mon)
print(sum)
N, K = map(int, input().split())
S = list(input())
S_ = ''

S[K+1] = S[K+1].lower()
for i in range(N):
    S_ += S[i]

print(S_)


### FIXED CODE ###

N, K = map(int, input().split())
S = list(input())
S_ = ''

S[K-1] = S[K-1].lower()
for i in range(N):
    S_ += S[i]

print(S_)
a = int(input())
b = int(input())
print(a*b - a - b + 1)

### FIXED CODE ###

a, b = map(int,input().split())
print(a*b - a - b + 1)
from collections import deque
N = int(input())
A = [int(i) for i in input().split()]

d = deque(A)
c = 0
while(len(d)>0):
    tmp = d.pop()
    if tmp%2==0:
        c+=1
        d.append(tmp//2)
print(c)

### FIXED CODE ###

A,B = [int(i) for i in input().split()]
if A<9 and B<9:
    print("Yay!")
else:
    print(":(")
import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    K = int(input())
    x = 0
    if K % 2 == 0 or K % 5 ==  0:
        print(-1)
  
    while True:
        x = (x * 10 + 7) % K
        i += 1
        if x == 0:
            print(i + 1)
            break


    

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]


def main():
    K = int(input())
    x = 0
    i = 0
    if K % 2 == 0 or K % 5 ==  0:
        print(-1)
        exit()
    
    while True:
        x = (x * 10 + 7) % K
        i += 1
        if x == 0:
            print(i)
            break


    

if __name__ == "__main__":
    main()
N = int(input())
ans = (N // 11) * 2
if N%11 == 0:
    ans = ans
elif N%0 != 0 and N%11 <= 6:
    ans += 1
else:
    ans += 2
print(ans)

### FIXED CODE ###

N = int(input())
ans = (N // 11) * 2
if N%11 == 0:
    ans = ans
elif N%11 != 0 and N%11 <= 6:
    ans += 1
else:
    ans += 2
print(ans)
N,K=map(int,input().split())
S=input()
po=[0]
p=0
ans=0
left,right=0,0
q=0
for i in range(1,N):
	p=S[i-1]+S[i]
	if (p=='10')|(p=='01'):
		po.append(i)
po.append(len(S))
for i in range(len(po)-K+2):
	if K*2>len(po):
		ans=po[-1]
		break
	elif (S[0]=='0')&(right<=1):
		q=po[2*K]
		left=2
		right=2*K+left
	elif (S[0]=='1')&(right<=1):
		q=po[2*K+1]
		left=1
		right=2*K+left
	elif right<len(po):
		q=po[right]-po[left]
		left+=2
		right+=2
	elif S[-1]=='0':
		right=len(po)-1
		left=right-2*K
		q=po[right]-po[left]
	else:
		right=len(po)-1
		left=right-2*K-1
		q=po[right]-po[left]
	ans=max(q,ans)
print(ans)

### FIXED CODE ###

N,K=map(int,input().split())
S=input()
po=[0]
X=[]
i=0
for i in range(N-1):
	if not S[i] == S[i+1]:
		po.append(i+1)
po.append(len(S))
for i in range(len(po)):
	if 2*K+1>=len(po):
		X.append(po[-1])
		break
	elif 2*K+i+1>=len(po):
		X.append(po[2*K+i]-po[i])
		break
	elif S[po[i]]=='0':
		X.append(po[2*K+i]-po[i])
	else:
		X.append(po[2*K+1+i]-po[i])
print(max(X))
N = int(input())

import sys
sys.setrecursionlimit(10 ** 9)

memo = [-1] * (N + 1)

def dfs(x):
    if memo[x] != -1:
        return memo[x]
    ans = False
    if x == 0:
        memo[x] = 1
        return True
    elif x < 0:
        memo[x] = 0
        return False
    else:
        ans |= dfs(x - 100)
        ans |= dfs(x - 101)
        ans |= dfs(x - 102)
        ans |= dfs(x - 103)
        ans |= dfs(x - 104)
        ans |= dfs(x - 105)
    memo[x] = 1 if ans else 0
    return ans
if dfs(N):
    print(1)
else:
    print(0)


### FIXED CODE ###

N = int(input())

import sys
sys.setrecursionlimit(10 ** 9)

memo = [-1] * (N + 1)

def dfs(x):
    if x >= 0 and memo[x] != -1:
        return memo[x]
    ans = False
    if x == 0:
        memo[x] = 1
        return True
    elif x < 0:
        return False
    else:
        ans |= dfs(x - 100)
        ans |= dfs(x - 101)
        ans |= dfs(x - 102)
        ans |= dfs(x - 103)
        ans |= dfs(x - 104)
        ans |= dfs(x - 105)
    memo[x] = 1 if ans else 0
    return ans
if dfs(N):
    print(1)
else:
    print(0)
S = input()
S2 = ""
Q = int(input())
reverse = 1
for i in range(Q):
    list = input()
    if list[0] == "1":
        reverse *= -1
    else:
        if reverse == 1:
            if list[2] == "2":
                S += list[4]
            else:
                S2 += list[4]
        else:
            if list[2] == "2":
                S2 += list[4]
            else:
                S += list[4]
if reverse == 1:
    print(S2[::-1] + S)
else:
    print(S[::-1] + S2)


### FIXED CODE ###

a = input()
b = a[0]
c = False
for i in range(len(a)):
    if a[i] != b:
        c = True
if c:
    print("Yes")
else:
    print("No")
p = list(map(int,input()split()))
if (p[1] = p[2] and p[0]!=p[1])or(p[0]=p[1]and p[1]!=p[2])or(p[0]=p[2] and p[0]!=p[1]):
  print("2")
if p[0]!=p[1] and p[0]!=p[2]:
  print("3")
else:
  print("1")

### FIXED CODE ###

p = list(map(int,input().split()))
if p[0] != p[1] and p[1] != p[2] and p[2] != p[0]:
  print(3)
elif p[0] == p[1] == p[2]:
  print(1)
else:
  print(2)
n, m = map(int, input().split())
ways = [tuple(map(int, input().split())) for _ in range(m)]

table = [list() for _ in range(n+1)]
hush = {}
hush2 = {}
for i in range(1, n+1):
    hush[i] = False
    hush2[i] = False
ans = [0 for _ in range(n+1)]

for a, b in ways:
    table[a].append(b)
    table[b].append(a)

hush[1] = True

def bfs(i):
    if hush2[i] == True: return
    else: hush2[i] = True
    for room in table[i]:
        if hush[room] == False:
            ans[room] = i
            hush[room] = True
    for room in table[i]:
        bfs(room)

bfs(1)

print('Yes')
for i in range(2, n+1):
    print(ans[i])

### FIXED CODE ###

from collections import deque

n, m = map(int, input().split())
ways = [tuple(map(int, input().split())) for _ in range(m)]
ans = [None] * (n+1)

hush = {}
hush[1] = True
for i in range(2, n+1):
    hush[i] = False
table = [list() for _ in range(n+1)]
for a, b in ways:
    table[a].append(b)
    table[b].append(a)

que = deque([1])
while len(que) > 0:
    room = que.popleft()
    for next in table[room]:
        if hush[next] == False:
            ans[next] = room
            que.append(next)
            hush[next] = True

print('Yes')
for i in range(2, n+1):
    print(ans[i])
n = iin()
a = [int(x) for x in input().split()]
for i in range(n-1):
    a.sort()
    a[i + 1] = (a[i]+a[i + 1])/2
print(a[n-1])

### FIXED CODE ###

import math
def py():
    print("Yes")
def pn():
    print("No")
def iin():
    x = int(input())
    return x

neko = 0
nya = 0
nuko = 0

n = iin()
a = [int(x) for x in input().split()]
for i in range(n-1):
    a.sort()
    a[i + 1] = (a[i]+a[i + 1])/2
print(a[n-1])
s=input()
if s <= 2019/04/30:
  print("Heisei")
else:
  print("TBD")

### FIXED CODE ###

s=input()
if s <= "2019/04/30":
  print("Heisei")
else:
  print("TBD")
N=int(input())
f=[]
for i in range(1,(N+1)//2):
    if N%i==0:
        f.append(min(len(str(i)),len(str(N//i))))
print(max(f))

### FIXED CODE ###

N=int(input())
ans=float('inf')

for i in range(1,int(N**0.5+1)):
    if N%i==0:
        ans=min(ans,len(str(N//i)))
print(ans)
#include <iostream>
using namespace std;

int main() {
    //入力を受け取る
    int D, T, S;
    cin >> D >> T >> S;

    //高橋君の移動時間を計算する
    double time = (double)D / S;

    //Tとtimeの大小関係に応じて出力をする
    if (T >= time) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}


### FIXED CODE ###

D, T, S = map(int, input().split())

time = D/S

if time > T:
    print("No")
else: print("Yes")
A, B = list(map(int, (input().split())))
k = -1
if A <= 9 && B <= 9:
  k = A * B
print(k)


### FIXED CODE ###

A, B = list(map(int, (input().split())))
k = -1
if (A <= 9 ) and ( B <= 9):
  k = A * B
print(str(k))