Harryxun/stf_run huggingface dataset:
n,a,b = map(int,input())
su = 0
co = 0
for i in range(1,n+1):
  ii = list(map(int,list(str(i))))
  for j in range(len(ii)):
    co += ii[j]
  if co <= b and co >= a:
    su += 1
  co = 0
print(su)

### FIXED CODE ###

n,a,b = map(int,input().split())
su = 0
co = 0
for i in range(1,n+1):
  ii = list(map(int,list(str(i))))
  for j in range(len(ii)):
    co += ii[j]
  if co <= b and co >= a:
    su += i
  co = 0
print(su)
n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for p in range(k):
  price += p[k]
 
print(price)

### FIXED CODE ###

n, k = map(int, input().split())
p = list(map(int, input().split()))
p.sort()
price = 0

for i in range(k):
  price += p[i]
  
print(price)
from collections import defaultdict
s=input()
d=defaultdict(int)
l.insert(0,0)
for i in range(1,len(s)+1):
    d[int(s[-i:])%2019] += 1
ans=0
for v in d.values():
    ans += v*(v-1)//2
print(ans)

### FIXED CODE ###

from collections import Counter
S=list(map(int,input()))
P=2019
N=len(S)
if P not in [2,5]:
  pt = [1]
  for i in range(N):
    pt.append(pt[-1]*10%P)
  dp = [(S[0]*pt[N-1])%P]
  for i in range(1,N):
    dp.append((dp[-1]+S[i]*pt[N-1-i])%P)

  c = Counter(dp)
  ans = sum(u*(u-1)//2 for u in c.values())
  print(ans+c[0])
elif P==2:
  S = [int(c) for c in input()]
  ans = 0
  for i in range(N):
    if S[i]%2==0:
      ans += i+1
  print(ans)
else:
  ans = 0
  S = [int(c) for c in input()]
  for i in range(N):
    if S[i]%5==0:
      ans += i+1
  print(ans)
'''input
3 3
...
...
...
'''
# A coding delight
from sys import stdin, stdout
import gc
gc.disable()
input = stdin.readline
from collections import deque


def mp(arr):
	return str(arr[0]) + ' ' + str(arr[1])

def bfs(source, target):
	myq = deque()
	myq.append(mp(source))
	visited = dict()
	visited[mp(source)] = True
	dist = 0
	while len(myq) > 0:
		temp = deque()
		while len(myq) > 0:
			x, y  = list(map(int, myq.popleft().split()))
			if mp([x,y]) == mp(target):
				return dist
			if x - 1 >= 0 and maze[x - 1][y] != '#' and mp([x - 1, y]) not in visited:
				visited[mp([x -1, y])] = True
				temp.append(mp([x - 1, y]))
			if x  + 1 < n and maze[x + 1][y] != '#' and mp([x + 1, y]) not in visited:
				visited[mp([x + 1, y])] = True
				temp.append(mp([x + 1, y]))
			if y - 1 >= 0 and maze[x][y - 1] != '#' and mp([x, y - 1]) not in visited:
				visited[mp([x, y - 1])] = True
				temp.append(mp([x, y - 1]))
			if y + 1 < m and maze[x][y + 1] != '#' and mp([x, y + 1]) not in visited:
				visited[mp([x, y + 1])] = True
				temp.append(mp([x, y + 1]))
		dist += 1
		myq = temp
	return -float('inf')			


# main starts
n, m = list(map(int, input().split()))
maze = []
for _ in range(m):
	state = list(stdin.readline().strip())
	maze.append(state)

ans = -float('inf')
for i in range(n):
	for j in range(m):
		for x in range(n):
			for y in range(m):
				first = [i, j]
				second = [x, y]
				ans = max(ans, bfs(first, second))
print(ans)


### FIXED CODE ###

'''input
3 3
.#.
#..
.#.
'''
# A coding delight
from sys import stdin, stdout
import gc
gc.disable()
input = stdin.readline
from collections import deque


def mp(arr):
	arr = map(str, arr)
	return ' '.join(arr)


def bfs(source):
	myq = deque()
	myq.append(source)
	visited = dict()
	visited[mp(source)] = True
	dist = -1
	while len(myq) > 0:
		temp = deque()
		dist += 1
		while len(myq) > 0:
			x, y  = myq.popleft()
			if x - 1 >= 0:
				if maze[x - 1][y] != '#' and mp([x - 1, y]) not in visited:
					visited[mp([x -1, y])] = True
					temp.append([x - 1, y])
			if x + 1 < n:
				if maze[x + 1][y] != '#' and mp([x + 1, y]) not in visited:
					visited[mp([x + 1, y])] = True
					temp.append([x + 1, y])
			if y - 1 >= 0:
				if maze[x][y - 1] != '#' and mp([x, y - 1]) not in visited:
					visited[mp([x, y - 1])] = True
					temp.append([x, y - 1])
			if y + 1 < m:
				if maze[x][y + 1] != '#' and mp([x, y + 1]) not in visited:
					visited[mp([x, y + 1])] = True
					temp.append([x, y + 1])
		myq = temp
	return dist		


# main starts
n, m = list(map(int, input().split()))
maze = []
for _ in range(n):
	state = list(input().strip())
	maze.append(state)

# from random import randint
# for _ in range(1000):
# maze = []
# n = randint(1, 20)
# m = randint(1, 20)
# for i in range(n):
# 	temp = []
# 	for j in range(m):
# 		k = randint(1, 2)
# 		if k == 1:
# 			temp.append('.')
# 		else:
# 			temp.append('#')
# 	maze.append(temp)

ans = 0
for i in range(n):
	for j in range(m):
		if maze[i][j] != '#':
			first = [i, j]
			ans = max(ans, bfs(first))
print(ans)
N = int(input())
sum = 0
for i in range(N):
    x,u = map(int,input().split())
    if u = 'BTC':
        x *= 380000.0
    sum += x
print(sum)

### FIXED CODE ###

N = int(input())
sum = 0.0
for i in range(N):
    x,u = input().split()
    x = float(x)
    if u == 'BTC':
        x *= 380000.0
    sum += x
print(sum)
N, Y = map(int, input().split())
for x in range(0,N)
	for y in range(0,N-x)
		if N-x<0
			break
		for z in range(0,N-x-y)
			if N-x-y<0
    			continue
   			if Y==10000*x+5000*y+1000*z:
    			print(x,y,z)
    			break
print(-1,-1,-1)

### FIXED CODE ###

N, Y = map(int, input().split())
 
for x in range(N+1):
  for y in range(N-x+1):
    z = N - x - y
    if 10000 * x + 5000 * y + 1000 * z == Y:
      print(x,y,z)
      exit()
print(-1,-1,-1)
s = input().replace('BC','D')
n = len(s)
 
count = 0
res = 0
 
for i in range(n):
    if s[i] == 'A':
        count += 1
    elif s[i] == 'D':
        res += count
    else:
        count = 0
 
print(ans)

### FIXED CODE ###

s = input().replace('BC','D')
n = len(s)
 
count = 0
res = 0
 
for i in range(n):
    if s[i] == 'A':
        count += 1
    elif s[i] == 'D':
        res += count
    else:
        count = 0
print(res)
N,K = map(int, input().split())
es = [[] for _ in range(N)]

for _ in range(N-1):
    a,b = map(int, input().split())
    es[a-1].append(b-1)
    es[b-1].append(a-1)


MOD = 10**9+7
 
MAXN = N+5
fac = [1,1] + [0]*MAXN
finv = [1,1] + [0]*MAXN
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD
 
def nPr(n,r):
    if n < r:
        return 0
    return fac[n] * finv[n-r]

ans = 1

checked = [False] * N
q = []
# 探索開始ノードの取りうる色K個と、そこに繋がるノードの色の取り方
ans *= K * nPr(K-1, len(es[0]))

checked[0] = True
for nxt in es[0]:
    q.append(nxt)
    checked[nxt] = True

while q:
    curr = q.pop()
    ans *= nPr(K-2, len(es[curr]) - 1)
    ans %= MOD
    for nxt in es[curr]:
        if not checked[nxt]:
            q.append(nxt)
            checked[nxt] = True
print(ans % MOD)

### FIXED CODE ###



MOD = 10**9 + 7
N,K = map(int, input().split())
es = [[] for _ in range(N)]
for _ in range(N-1):
    a,b = map(int, input().split())
    es[a-1].append(b-1)
    es[b-1].append(a-1)

MAXN = K+5
fac = [1,1] + [0]*MAXN
finv = [1,1] + [0]*MAXN
inv = [0,1] + [0]*MAXN
for i in range(2,MAXN+2):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = -inv[MOD%i] * (MOD // i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def nPr(n,r):
    if n < r:
        return 0
    return fac[n] * finv[n-r]

# 「距離が２以内は異なる色 = あるノードとそれに隣接するノードはそれぞれ異なる色」の言い換えがポイント
# 根はK通り、根の子の数をmとすると、根の子の塗り方は、K-1個の中からm個並べる方法なので、nPr(K-1, m)通り
# それ以降についてあるノードを見るとき、そのノードと親には既に色が塗られている場合を考える。
# 親とその親の２色は使われてるから、そのノードのこの塗り方はK-2のうちから子の数だけ並べるときなので、nPr(K-2, 子の数)


ans = (K * nPr(K-1, len(es[0]))) % MOD
stack = []
for nxt in es[0]:
    stack.append(nxt)

checked = [False] * N
checked[0] = True

# ノード0の子から見ていって、その子の塗り方をかけ合わせていく
while stack:
    curr = stack.pop()
    checked[curr] = True
    # currの親はすでに塗ってあるので、r = len(es[curr])-1
    ans *= nPr(K-2, len(es[curr])-1)
    ans %= MOD
    for nxt in es[curr]:
        if not checked[nxt]:
            stack.append(nxt)

print(ans % MOD)
words = lambda t : list(map(t, input().split()))
n = int(input())
xs = words(int)

s_xs = sorted(xs)
ans = False
if s_xs == xs:
    ans = True
else:
    for i in range(n-1):
        for j in range(i,n):
            f_xs = xs.copy()
            tmp = f_xs[i]
            f_xs[i] = f_xs[j]
            f_xs[j] = tmp
            if s_xs == f_xs:
                ans = True
                break
        if ans == True:
            break
if ans == True:
    print("YES")
else:
    print("NO")


### FIXED CODE ###

words = lambda t : list(map(t, input().split()))
n = int(input())
xs = words(int)

s_xs = sorted(xs)
ans = False
if s_xs == xs:
    ans = True
else:
    for i in range(n-1):
        for j in range(i,n):
            f_xs = xs.copy()
            tmp = f_xs[i]
            f_xs[i] = f_xs[j]
            f_xs[j] = tmp
            if s_xs == f_xs:
                ans = True
                break
        if ans == True:
            break
if ans == True:
    print("YES")
else:
    print("NO")
y = input()
x = y**3
print(x)

### FIXED CODE ###

print(int(input())**3)
A=list(map(int,input().split()))+[0]
ans=0
for i in range(N):
    eated=max(0,A[i]+A[i-1]-x)
    ans+=eated
    A[i]-=eated
print(ans)

### FIXED CODE ###

N,x=map(int,input().split())
A=list(map(int,input().split()))+[0]
ans=0
for i in range(N):
  eated=max(0,A[i]+A[i-1]-x)
  ans+=eated
  A[i]-=eated
print(ans)
n, k = map(int, input().strip().split())
s = input().strip()

cnts = []
# denote whether the first block is 0 or 1
tmp, cnt = s[0], 0
flag = int(s[0])

for i in range(n):
    if s[i] == tmp:
        cnt += 1
    else: # here tmp should be cleared
        cnts.append(cnt)
        cnt = 1
    tmp = s[i]
cnts.append(cnt)
# print(cnts)

n_zero = (len(cnts) + 1) // 2 if flag == 0 else len(cnts) // 2
# print("# of zeros block: ", n_zero)
cumsum = []
for i in range(len(cnts)):
    if i == 0:
        cumsum.append(cnts[0])
    else:
        cumsum.append(cumsum[-1] + cnts[i])

if n_zero <= k:
     ans = sum(cnts)
else:
    ans = 0
    for inx in range(flag, len(cnts), 2):
        start = max(0, inx - 2)
        end = min(inx + 2 * k -1 , len(cnts))
        tmp = cumsum[end] - cumsum[start]
        ans = max(tmp, ans)

print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
s = [int(x) for x in list(input())]

state = 1
cnt = 0
l = []
for e in s:
    if e != state:
        l.append(cnt)
        cnt = 1
        state = e
    else:
        cnt += 1

if cnt != 0:
    l.append(cnt)


if len(l) % 2 == 1:
    l.append(0)

Add = 2 * k + 1
ruiseki = [0]

for i, e in enumerate(l):
    ruiseki.append(ruiseki[i] + l[i])

answer = 0
for i in range(0, len(l), 2):
    left = i
    right = min(i + Add, len(l))
    tmp = ruiseki[right] - ruiseki[left]
    answer = max(tmp, answer)

print(answer)
N, K = map(int, input().split())
x = list(map(int, input().split()))

count_m = 0
count_p = 0
for i in range(N):
    if x[i] > 0:
        count_m = i
        count_p = N-i
        break
    elif x[i] == 0:
        count_m = i
        count_p = N-i-1
        K -= 1
        N -= 1
        break
if count_m == 0 and count_p == 0:
    count_m = N

ans = 0

y = K
z = K - y

# for j in range(1, y):
#     if count_m-j>0 and count_m+y-1-j<N-1:
#         print(j)
#         print(x[count_m+y-1-j],x[count_m-j] ,x[count_m-1])

if count_m >= 1:
    tmp = min(x[count_m+y-1-j]-x[count_m-j] *2
              for j in range(1, y) if count_m-j>0  and count_m+y-1-j<N-1)
    tmp2 = min(x[count_m+y-1-j]*2-x[count_m-j] 
               for j in range(1, y) if count_m-j>0 and count_m+y-1-j<N-1)
else:
    tmp = tmp2 = 1000000000
#print(tmp, tmp2, x[count_m:y], -x[count_m-min(y, count_m)])

#print("-----------------")
#print(count_m, count_p)
if count_p>=K:
    # print(y, "1chi")
    ans = min(tmp, tmp2, x[count_m+min(y, count_p)])
elif count_m>=K:
    #print("ni")
    ans = min(tmp, tmp2, -x[count_m-K])
else:
    # print("san")
    ans = min(tmp, tmp2)
       

print(ans)


### FIXED CODE ###

N, K = map(int, input().split())
x = list(map(int, input().split()))

count_m = 0
count_p = 0
for i in range(N):
    if x[i] > 0:
        count_m = i
        count_p = N-i
        break
    elif x[i] == 0:
        count_m = i
        count_p = N-i-1
        K -= 1
        N -= 1
        x.remove(x[i])
        break
if count_m == 0 and count_p == 0:
    count_m = N

ans = 0
    

y = K
z = K - y


if count_m >= 1 and count_p>=1:
    # for j in (range(1,y)):
    #     if count_m-j>=0  and count_m+y-1-j<N:
    #         print(x[count_m+y-1-j], x[count_m-j])
    tmp = min(x[count_m+y-1-j]-x[count_m-j] *2 for j in range(1, y) if count_m-j>=0  and count_m+y-1-j<N)
    tmp2 = min(x[count_m+y-1-j]*2-x[count_m-j] for j in range(1, y) if count_m-j>=0 and count_m+y-1-j<N)
else:
    tmp = tmp2 = 1000000000

if N==0:
    ans = 0


elif count_p>=K:
    # print(y, "1chi")
    ans = min(tmp, tmp2, x[count_m+min(y, count_p)-1])
elif count_m>=K:
    #print("ni")
    ans = min(tmp, tmp2, -x[count_m-K])
else:
    #print("san", tmp, tmp2)
    ans = min(tmp, tmp2)


print(ans)
n = input()
List = [a,i,u,e,o]
if n in List:
    print('vowel')
else:
    print('consonant')

### FIXED CODE ###

n = input()
if n in 'aiueo':
    print('vowel')
else:
    print('consonant')
import bisect
from itertools import *
n=range(49994);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in iter(input,'0'):
 x=int(x)
 if x%2:print(sum(2+c==x for c in p[:bisect.bisect(p,x)]))
 elif x-4:print(sum(1 for c in p[:bisect.bisect(p,x//2)]if a[x-c]))
 else:print(1)


### FIXED CODE ###

import bisect,sys
from itertools import *
n=range(50001);a=list(n);a[1]=0
for i in range(2,224):a[i*2::i]=[0]*len(a[i*2::i])
p=list(compress(n,a))
for x in map(int,sys.stdin):
 if x:print(len([1 for d in p[:bisect.bisect(p,x//2)]if a[x-d]]))
A,B,K=map(int,input().split())

def ans120(A:int, B:int, K:int):
    l=sorted([A,B])
    ans_list=[]
    for i in range(1,l[1]):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))

### FIXED CODE ###

A,B,K=map(int,input().split())

def ans120(A:int, B:int, K:int):
    if A>=B:
        n=A
    else:
        n=B
    ans_list=[]
    for i in range(1,n+1):
        if A%i==0 and B%i==0:
            ans_list.append(i)
    return ans_list[-K]

print(ans120(A,B,K))
#!/usr/bin/env python3
import re
No = "UNRESTORABLE"

def main():
    S = input()
    T = input()
    T_LEN = len(T)
    match_index = []

    for i in range(len(S) - T_LEN + 1):
        for idx in range(T_LEN):
            if S[i:i+T_LEN][idx] == T[idx] or S[i:i+T_LEN][idx] == "?":
                continue
            else:
                break
        else:
            match_index.append(i)
    
    if not match_index:
        print(No)
    
    else:
        answer = list(S)
        answer[match_index[0]:match_index[0] + T_LEN] = list(T)
        answer = "".join(answer)

        if len(match_index) == 1:
            answer = answer.replace("?","a")
            print(answer)

        else:
            for i in match_index[1:]:
                tmp_ans = answer = list(S)
                tmp_ans[match_index[i]:match_index[i] + T_LEN] = list(T)
                tmp_ans = "".join(tmp_ans)
                tmp_ans = tmp_ans.replace("?","a")
                answer = min(tmp_ans,answer)

            print(answer)

if __name__ == '__main__':
    main()

### FIXED CODE ###

#!/usr/bin/env python3
import re
No = "UNRESTORABLE"

def main():
    S = input()
    T = input()
    T_LEN = len(T)
    match_index = []

    for i in range(len(S) - T_LEN + 1):
        for idx in range(T_LEN):
            if S[i:i+T_LEN][idx] == T[idx] or S[i:i+T_LEN][idx] == "?":
                continue
            else:
                break
        else:
            match_index.append(i)
    
    if not match_index:
        print(No)
    
    else:
        answer = list(S)
        answer[match_index[0]:match_index[0] + T_LEN] = list(T)
        answer = "".join(answer)
        answer = answer.replace("?","a")

        if len(match_index) == 1:
            print(answer)

        else:
            for i in match_index[1:]:
                tmp_ans = list(S)
                tmp_ans[i:i + T_LEN] = list(T)
                tmp_ans = "".join(tmp_ans)
                tmp_ans = tmp_ans.replace("?","a")
                answer = min(tmp_ans,answer)

            print(answer)

if __name__ == '__main__':
    main()
def main():
    N, K = map(int, input().split())
    h = list(map(int, input().split()))
    INF = 10**12
    dp = [INF] * (N+1)
    dp[1] = 0
    for i in range(1,N):
        for j in range(1,K+1):
            if i+j > N:
                break
            else:
                dp[i+j] = min(dp[i+j],dp[i]+abs(h[i-1]-h[i+j-1]))
    print(dp[N])

if __name__ == "__main__":
    main()

### FIXED CODE ###

#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    h = list(map(int, input().split()))
    INF = 10**12
    dp = [INF] * (N+1)
    dp[1] = 0
    for i in range(1,N):
        dp[i+1] = min(dp[i+1],dp[i]+abs(h[i-1]-h[i]))
        if i < N-1:
            dp[i+2] = min(dp[i+2],dp[i]+abs(h[i-1]-h[i+1]))
    print(dp[N])

if __name__ == "__main__":
    main()
import sys
import numpy as np
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    h, w, m = MII()
    bombs = [MIIZ() for _ in range(m)]
    area = np.zeros((h,w))
    for x, y in bombs:
        area[x:x+1, :] += 1
        area[:, y:y+1] += 1
        area[x:x+1, y:y+1] -= 1
    print(int(area.max()))

if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
import numpy as np
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    h, w, m = MII()
    bombs = [MIIZ() for _ in range(m)]
    a = [0]*h
    b = [0]*w
    for y,x in bombs:
        a[y] += 1
        b[x] += 1
    maxa = max(a)
    maxb = max(b)
    sumv = maxa + maxb
    c = a.count(maxa)*b.count(maxb) - sum(a[y]+b[x] == sumv for y,x in bombs)
    print(sumv - (c<=0))

if __name__ == '__main__':
    main()
from collections import deque
N,M = map(int,input().split())
data = [[] for i in range(M)]
for i in range(M):
    a,b = map(int,input().split())
    data[a-1].append(b)
    data[b-1].append(a)

que = deque([1])
ans = [0 for i in range(M)]
while True:
    cur = que.popleft()
    for item in data[cur-1]:
        if ans[item-1] == 0:
            que.append(item)
            ans[item-1] = cur
    if len(que) == 0: break

print("yes")
for i in range(1,N): print(ans[i])

### FIXED CODE ###

from collections import deque
N,M = map(int,input().split())
data = [[] for i in range(N)]
for i in range(M):
    a,b = map(int,input().split())
    data[a-1].append(b)
    data[b-1].append(a)

que = deque([1])
ans = [0 for i in range(N)]
while True:
    cur = que.popleft()
    for item in data[cur-1]:
        if ans[item-1] == 0:
            que.append(item)
            ans[item-1] = cur
    if len(que) == 0: break

if 0 in ans:
    print("No")
else:
    print("Yes")
    for i in range(1,N): print(ans[i])
import sys

h, w, m = map(int, input().split())
row = [0]*h
col = [0]*w
bomb = set()
for x in range(m):
    H, W = map(int, input().split())
    bomb.add([H-1, W-1])
    row[H-1] += 1
    col[W-1] += 1

maxrow = max(row)
maxcol = max(col)
ans = maxcol + maxrow - 1
p, q = [], []
for i in range(h):
    if row[i] == maxrow:
        p.append(i)
for i in range(w):
    if col[i] == maxcol:
        q.append(i)

for i in p:
    for j in q:
        if [i, j] not in bomb:
            print(ans + 1)
            exit()
print(ans)


### FIXED CODE ###

import sys

h, w, m = map(int, input().split())
row = [0]*h
col = [0]*w
bomb = set()
for x in range(m):
    H, W = map(int, input().split())
    bomb.add((H-1, W-1))
    row[H-1] += 1
    col[W-1] += 1

maxrow = max(row)
maxcol = max(col)
ans = maxcol + maxrow - 1
p, q = [], []
for i in range(h):
    if row[i] == maxrow:
        p.append(i)
for i in range(w):
    if col[i] == maxcol:
        q.append(i)

for i in p:
    for j in q:
        if (i, j) not in bomb:
            print(ans + 1)
            exit()
print(ans)
n, k = list(map(int, input().split()))

MAX = 2*10**5+1
MOD = 10**9+7
fact = [0 for i in range(MAX)]
inv = [0 for i in range(MAX)]
invfact = [0 for i in range(MAX)]

def comb_build(n):
  fact[0] = inv[0] = invfact[0] = 1
  fact[1] = inv[1] = invfact[1] = 1
  for i in range(2, n):
    fact[i] = fact[i-1]*i%MOD
    inv[i] = inv[MOD%i]*(MOD-MOD//i)%MOD
    invfact[i] = invfact[i-1]*inv[i]%MOD

def nCk(n, k):
  if n<k or n<0 or k<0:
    return 0
  return (((fact[n]*invfact[k])%MOD)*invfact[n-k])%MOD

comb_build(2010)

t = nCk(n, n-k)
for i in range(1, k+1):
  if i>n-k+1:
    print(0)
  else:
    print((nCk(k-1, i-1)*nCk(n-(k-1), i))%MOD)
print(s%MOD == t%MOD)

### FIXED CODE ###

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

MAX = 2*10**5+1
MOD = 10**9+7
fact = [0 for i in range(MAX)]
inv = [0 for i in range(MAX)]
invfact = [0 for i in range(MAX)]

def comb_build(n):
  fact[0] = inv[0] = invfact[0] = 1
  fact[1] = inv[1] = invfact[1] = 1
  for i in range(2, n):
    fact[i] = fact[i-1]*i%MOD
    inv[i] = inv[MOD%i]*(MOD-MOD//i)%MOD
    invfact[i] = invfact[i-1]*inv[i]%MOD

def nCk(n, k):
  if n<k or n<0 or k<0:
    return 0
  return (((fact[n]*invfact[k])%MOD)*invfact[n-k])%MOD

comb_build(2010)

for i in range(1, k+1):
  if i>n-k+1:
    print(0)
  else:
    print((nCk(k-1, i-1)*nCk(n-(k-1), i))%MOD)
import sys
import decimal # 10進法に変換，正確な計算

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

def main():
    n, k = map(int, input().split())
    h = list(map(int, input().split()))
    count = 0
    for i in h:
        if i >= k:
            count += 1
    print(count)

    
    
main()

### FIXED CODE ###

import sys
import decimal # 10進法に変換，正確な計算

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

def main():
    s = input()
    if s[0] == "S":
        print("Cloudy")
        return
    elif s[0] == "C":
        print("Rainy")
        return
    print("Sunny")
    

    
    
main()
a,b=map(int, input(),split)
print(a*b , a*2+b*2)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b , a*2+b*2)
n,d=list(map(int,input().split()))

cnt=0

for x,y in list(map(int,input().split())):
    if x**2+y**2<=d**2:
        cnt+=1

print(cnt)

### FIXED CODE ###

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

cnt=0

for _ in range(n):
    x,y=list(map(int,input().split()))
    if x**2+y**2<=d**2:
        cnt+=1

print(cnt)
INF = 10**9

N, K = map(int, input().split())
x_list = [int(i) for i in input().split()]
for i in range(N):
    if x_list[i] >= 0:
        T = i
        break
else:
    print(abs(x_list[-K])
    exit()
min_take_time = INF
for i in range(K+1):
    if T-K+i < 0 or T+i>N:
        continue
    if x_list[T-K+i] *  x_list[T+i-1] <= 0:
        take_time = min(abs(x_list[T-K+i]), abs(x_list[T+i-1])) * 2 + max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    else:
        take_time = max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    min_take_time = min(min_take_time, take_time)


print(min_take_time)

### FIXED CODE ###

INF = 10**9

N, K = map(int, input().split())
x_list = [int(i) for i in input().split()]
for i in range(N):
    if x_list[i] >= 0:
        T = i
        break
else:
    print(abs(x_list[-K]))
    exit()
min_take_time = INF
for i in range(K+1):
    if T-K+i < 0 or T+i>N:
        continue
    if x_list[T-K+i] *  x_list[T+i-1] <= 0:
        take_time = min(abs(x_list[T-K+i]), abs(x_list[T+i-1])) * 2 + max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    else:
        take_time = max(abs(x_list[T-K+i]), abs(x_list[T+i-1]))
    min_take_time = min(min_take_time, take_time)


print(min_take_time)
s = input()
a = len(s)
print(s[0] + (a-2) + s[-1])

### FIXED CODE ###

s = input()
a = len(s)
print('{0}{1}{2}'.format(s[0],a-2,s[-1]))
import math
n = int(input())
a = list(map(int,input().split()))
mina = max(a)
for i in range(n-1):
    mina = min(mina,math.gcd(a[i],a[i+1]))
print(mina)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
mina = max(a)
def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)
a.sort()
for i in range(n-1):
    mina = min(mina,gcd(a[i],a[i+1]))
print(mina)