Harryxun/stf_run huggingface dataset:
import numpy as np

def lcm_core(a,b):
    g = np.gcd(a,b)
    return (a*b)//g

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

def lcm(arr):
    m = 10**9+7
    mcnt = 0
    l = lcm_core(arr[0],arr[1])
    for i in range(2,len(arr)):
        l = lcm_core(l,arr[i])
        mcnt += l//m
        l %= m
    return l,mcnt

n = int(input())
arr = list(map(int,input().split()))
l,mcnt = lcm(arr)

# print(l,mcnt)

# print(l)
m = 10**9+7

ans = 0
for i in range(n):
    temp = l + (m%arr[i])*mcnt
    # print(temp)
    ans += (temp//arr[i]) + (m//arr[i])*mcnt
    ans %= m

print(ans)



### FIXED CODE ###

import fractions
from functools import reduce

def gcd(*numbers):
  return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
  return reduce(fractions.gcd, numbers)

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

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

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

N = int(input())
A = tuple(map(int, input().split()))

mod = 10 ** 9 + 7

l = lcm_list(A)

ans = 0

for i in range(N):
  ans += l // A[i]

ans = ans % mod

print(ans)
print('ABC' if s[1] == 'R' else 'ARC')

### FIXED CODE ###

print('ABC' if input()[1] == 'R' else 'ARC')
import math
k = int(input())
an = 0
for i in range(1,k+1):
    li = []
    cnt = 1
    num = i
    if i == 1:
        lis.append(1)
    else:
        for j in range(2,math.ceil(math.sqrt(i))+1):
            while num % j == 0:
                cnt += 1
                num //= j
            if cnt != 1:
                li.append(cnt)
                cnt = 1
        if num != 1:
            li.append(2)
        ans = 1
        for nu in li:
            ans *= nu
        an += ans
print(an)


### FIXED CODE ###

n = int(input())
ans = 0
for i in range(1,n+1):
    ans += ((i + i * (n//i))*(n//i))//2
print(ans)
import math
a, b, c, d = map(int, input().split())

#a~bでnで割り切れるものの数
def func(a, b, n):
    answer = (int(b/n) - int((a-1)/n))
    return answer

lcm = (c * d) //math.gcd(c, d)

print ((b -a + 1) - func(a,b,c) - func(a,b,d) + func(a,b,lcm))

### FIXED CODE ###

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

#a~bでnで割り切れるものの数
def func(a, b, n):
    answer = (int(b/n) - int((a-1)/n))
    return answer

lcm = int((c * d) / fractions.gcd(c, d))

#print ((b - a + 1) - func(a,b,c) - func(a,b,d) + func(a,b,lcm))

#b以下でc,dで割り切れない数
b_anti_devide = b - b//c - b//d + b//lcm
#a未満でc,dで割り切れない数
a_anti_devide = (a - 1) - (a - 1)//c - (a - 1)//d + (a - 1)//lcm

print (b_anti_devide - a_anti_devide)
return int(input())//2+1

### FIXED CODE ###

print((int(input())+1)//2)
# a%b >= K iff xb+K <= a < (x+1)b
# bごとに数えるだけ

N,K = map(int,input().split())
ans = 0

for b in range(K+1,N+1):
  cnt = 0
  x_max = N//b
  # 0 <= x < x_max
  # 各xに対してb-K個ある
  cnt += x_max * (b-K)
  # x = x_max
  lower = x_max*b+K
  if lower <= N:
	upper = min((x_max+1)*b-1,N)
    cnt += upper - lower + 1
  ans += cnt
  
print(ans)

### FIXED CODE ###

# a%b >= K iff xb+K <= a < (x+1)b
# bごとに数えるだけ

N,K = map(int,input().split())
ans = 0

for b in range(K+1,N+1):
  cnt = 0
  x_max = N//b
  # 0 <= x < x_max
  # 各xに対してb-K個ある
  cnt += x_max * (b-K)
  # x = x_max
  lower = x_max*b+K
  if lower <= N:
    upper = min((x_max+1)*b-1,N)
    cnt += upper - lower + 1
  ans += cnt

# N=0除外
if K == 0:
  ans -= N
  
print(ans)
n, k = map(int, input().split())
A = [int(i) for i in input().split()]

tmp = 0
for i in range(n):
    tmp += int(bin(A[i])[2:])
    
cand = ''
for i in str(tmp):
    if int(i) >= n / 2:
        cand += '0'
    else:
        cand += '1'
        
if int(cand, 2) > k:
    cand = str(k)
else:
    while True:
        cand = '1' + cand
        if int(cand, 2) <= k:
            pass
        else:
            cand = cand[1:]
            break
    
ans = 0
for i in range(n):
    ans += int(cand, 2) ^ A[i]
    
print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
Ai = list(map(int, input().split()))
 
D = 40
Bi = []
for a in Ai:
    b = bin(a)[2:]
    b = ("0" * (D - len(b))) + b
    Bi.append(b)
 
result = ""
for i in range(D):
    count = 0 # 1の個数
    for i, b in enumerate(Bi):
        if b[0] == '1':
            count += 1
        Bi[i] = b[1:]
    if count >= N / 2:
        result += "0"
    else:
        result += "1"
    #count = count // 2
x = 0
for i in range(D):
    if result[0] == '1':
        a = pow(2, D - i - 1)
        if x + a <= K:
            x += a
    result = result[1:]
 
ans = 0
for a in Ai:
    ans += (a ^ x)
print(ans)
a,b,c = input().split()
print((a[0]+b[1]+c[2]).upper())

### FIXED CODE ###

a,b,c = input().split()
print((a[0]+b[0]+c[0]).upper())
x=int(input())

for i in range (200):
  for j in range (-200,200):
    if i**5-j**5==x:
      print(i,j)
      exit()

### FIXED CODE ###

s=input()

if s=='ABC':
  print('ARC')
else:
  print('ABC')
from functools import reduce
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))
T.sort()

def gcd(m,n):
    if n == 0:
        return m
    return gcd(n,m%n)
    
def lcm(m,n):
    return int(m * n/gcd(m,n))

print(reduce(lcm,T))

### FIXED CODE ###

from functools import reduce
N = int(input())
T = []
for i in range(N):
    T.append(int(input()))

def gcd(m,n):
    if n == 0:
        return m
    return gcd(n,m%n)
    
def lcm(m,n):
    return m * n//gcd(m,n)

print(reduce(lcm,T))
def main():
	H, W = map(int, input().split())
	S = [list(input()) for _ in range(H)]

	D = [[0]*H for j in range(W)]

	D[0][0] = 1
	L = [(0,0)]

	for k in range(2,H*W):
		L_next = []
		for l in L:
			w = l[0]
			h = l[1]
			#上
			if (0 < h):
				if ((0 == D[h-1][w]) and ('.'==S[h-1][w])):
					D[h-1][w] = k
					L_next.append((w,h-1))
			#左
			if (0 < w):
				if ((0 == D[h][w-1]) and ('.'==S[h][w-1])):
					D[h][w-1] = k
					L_next.append((w-1,h))
			#下
			if (h < (H - 1)):
				if ((0 == D[h+1][w]) and ('.'==S[h+1][w])):
					D[h+1][w] = k
					L_next.append((w,h+1))
			#右
			if (w < (W - 1)):
				if ((0 == D[h][w+1]) and ('.'==S[h][w+1])):
					D[h][w+1] = k
					L_next.append((w+1,h))
		L = L_next
		if (0 != D[H-1][W-1]):
			break
		if (not L):	#リストが空
			return -1

	return W*H - D[H-1][W-1] - 2

print(main())


### FIXED CODE ###

def main():
	H, W = map(int, input().split())
	S = [list(input()) for _ in range(H)]

	D = [[0]*W for j in range(H)]

	D[0][0] = 1
	L = [(0,0)]

	#黒の数をカウント
	sum_black = 0
	for h in range(H):
		for w in range(W):
			if ('#'==S[h][w]):
				sum_black += 1

	for k in range(2,H*W):
		L_next = []
		for l in L:
			w = l[0]
			h = l[1]
			#上
			if (0 < h):
				if ((0 == D[h-1][w]) and ('.'==S[h-1][w])):
					D[h-1][w] = k
					L_next.append((w,h-1))
			#左
			if (0 < w):
				if ((0 == D[h][w-1]) and ('.'==S[h][w-1])):
					D[h][w-1] = k
					L_next.append((w-1,h))
			#下
			if (h < (H - 1)):
				if ((0 == D[h+1][w]) and ('.'==S[h+1][w])):
					D[h+1][w] = k
					L_next.append((w,h+1))
			#右
			if (w < (W - 1)):
				if ((0 == D[h][w+1]) and ('.'==S[h][w+1])):
					D[h][w+1] = k
					L_next.append((w+1,h))
		L = L_next
		if (0 != D[H-1][W-1]):
			break
		if (not L):	#リストが空
			return -1

	return W*H - D[H-1][W-1] - sum_black

print(main())
# -*- coding: utf-8 -*-
import math
import sys
a,b=map(int, input().split())

x = math.floor(a/0.08)
#1の位が1-9
y = math.floor(b/0.1)
if (x + 1) * 0.08 == a:
    xx = x + 2
else:
    xx = x + 1

for i in range(y,y+10):
    for j in range(x, xx):
        if i == j:
            print(i)
            sys.exit(1)
print(-1)
      

### FIXED CODE ###

# -*- coding: utf-8 -*-
import math
import sys
a,b=map(int, input().split())

y = math.floor(b/0.1)

for i in range(y,y+10):
    if math.floor(i * 0.08) == a:
        print(i)
        sys.exit(0)
print(-1)
def f(a,b):
	if a==b:
		return 2*a
	elif a < b:
		return 2*a* + f(a,b-a)
	else:
		return 2*b + f(a-b,b)


N,X = map(int,input().split(" "))

print(N+f(N-X,X))

### FIXED CODE ###

import bisect

N = input()
Ls = map(int,input().split(" "))
Ls = sorted(Ls)
ans = sum([L for i,L in enumerate(Ls) if i%2 == 0])
print(ans)
li = input().split()

if li[0]+li[1]+li[2] => 22:
    print("bust")
else:
    print("win")


### FIXED CODE ###

a = list(map(int,input().split()))
if a[0]+a[1]+a[2] <= 21:
  print('win')
else:
  print('bust')
#template
def inputlist(): return [int(j) for j in input().split()]
#template
N,K = inputlist()
A = inputlist()
left = -1
right = 10**9+1
while right - left > 1:
    mid = (left+right)//2
    count = 0
    for i in range(N):
        count += A[i]//mid
        if A[i] % mid == 0:
            count -=1
    if count > K:
        left = mid
    else:
        right = mid
print(right)

### FIXED CODE ###

#template
def inputlist(): return [int(j) for j in input().split()]
#template
N,K = inputlist()
A = inputlist()
left = 0
right = 10**9+1
while right - left > 1:
    mid = (left+right)//2
    count = 0
    for i in range(N):
        count += A[i]//mid
        if A[i] % mid == 0:
            count -=1
    if count > K:
        left = mid
    else:
        right = mid
print(right)
a,b = map(int,input().split())
if a > b :
  print('GREATER')
elif a < b :
  print('LESS')
else :
  print('EQUAL')

### FIXED CODE ###

a = int(input())
b = int(input())
if a > b :
  print('GREATER')
elif a < b :
  print('LESS')
else :
  print('EQUAL')
x, y = map(int, input().split())
li = []
k = 0 #カウント数
for _ in range(y):
    a, b = map(str, input().split())
    if b == 'AC':
        if a in li:
            continue
        else:
            li.append(a)
    elif b == 'WA':
        if a in li:
            continue
        else:
            k += 1
s = 0
for _ in dd:
    s += 1
            
print(s, k)

### FIXED CODE ###

x, y = map(int, input().split())
dd = {}
c = 0 #間違い数
p = 0 #AC数
for i in range(x):
    dd[i+1] = 0
for _ in range(y):
    a, b = map(str, input().split())
    a = int(a)
    if b == 'WA':
        if dd[a] == 'o':
            continue
        else:
            dd[a] += 1
    else:
        if dd[a] == 'o':
            continue
        else:
            c += dd[a]
            p += 1
            dd[a] = 'o'
            
print(p, c)
# coding: utf-8
word=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n = int(input())
print(word[n])

### FIXED CODE ###

# coding: utf-8
word=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
]
n = int(input())
print(word[n-1])
import numpy as np
n,m,c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(n)]
cnt = 0
l = np.matmul(b,np.transpose(a)) + c
for i in l:
    if i>0:
        cnt += 1
print(cnt)

### FIXED CODE ###

n,m,c = map(int, input().split())
b = list(map(int, input().split()))
A = [list(map(int, input().split())) for i in range(n)]
cnt = 0
for i in range(n):
    if sum(list([a*b for (a,b) in zip(A[i],b)]))+c > 0:
        cnt += 1
print(cnt)
import numpy as np

H, W, M = map(int, input().split())
h = np.zeros(H)
w = np.zeros(W)
m = {}
ans = 0

for _ in range(M):
    tmp_h, tmp_w = map(int, input().split())
    h[tmp_h-1] += 1
    w[tmp_w-1] += 1
    m[(tmp_h-1, tmp_w-1)] = 1.

h_max = np.max(h)
h_max_index = list(zip(*np.where(h == h_max)))
w_max = np.max(w)
w_max_index = list(zip(*np.where(w == w_max)))

for i in h_max_index:
    for j in w_max_index:
        if (i[0], j[0]) in m.keys():
            tmp = h_max + w_max -1
        else:
            tmp = h_max + w_max
        if ans < tmp:
            ans = tmp

print(int(ans))


### FIXED CODE ###

import numpy as np

H, W, M = map(int, input().split())
h = np.zeros(H)
w = np.zeros(W)
m = {}
flag = 0

for _ in range(M):
    tmp_h, tmp_w = map(int, input().split())
    h[tmp_h-1] += 1
    w[tmp_w-1] += 1
    m[(tmp_h-1, tmp_w-1)] = 1.

h_max = np.max(h)
h_max_index = list(zip(*np.where(h == h_max)))
w_max = np.max(w)
w_max_index = list(zip(*np.where(w == w_max)))

for i in h_max_index:
    for j in w_max_index:
        if (i[0], j[0]) not in m.keys():
            flag = 1
            break

if flag == 1:
    print(int(h_max + w_max))
else:
    print(int(h_max + w_max - 1))
import numpy as np
import itertools


N, M, Q = map(int, input().split(" "))

vals = []
for i in range(Q):
    vals.append([list(map(int, input().split(" ")))])
    
maxv = 0
cand = list(itertools.combinations_with_replacement(range(1, M+1), N))
for c in cand:
    sumv = 0
    for v in vals:
        if (c[v[1]-1] - c[v[0]-1]) == v[2]:
            sumv += v[3]
    if maxv < sumv:
        maxv = sumv
print(maxv)

### FIXED CODE ###

import numpy as np
import itertools


N, M, Q = map(int, input().split(" "))

vals = []
for i in range(Q):
    vals.append(list(map(int, input().split(" "))))
    
maxv = 0
cand = list(itertools.combinations_with_replacement(range(1, M+1), N))
for c in cand:
    sumv = 0
    for v in vals:
        if (c[v[1]-1] - c[v[0]-1]) == v[2]:
            sumv += v[3]
    if maxv < sumv:
        maxv = sumv
print(maxv)
# A - Simple Calculator
x,y = map(int,input().split())

if y > x:
    ans = y - x
else:
    # B を押す
    if x != 0:
        x *= -1
        ans = 1
    # y の絶対値との差分を押す
    ans += max(abs(x),abs(y)) - min(abs(x),abs(y))
    x += max(abs(x),abs(y)) - min(abs(x),abs(y))
    # B を押す
    if x != y:
        ans += 1
print(ans)

### FIXED CODE ###

# A - Simple Calculator
x,y = map(int,input().split())

# 初めと終わりに B を押すとき
ans1 = -y - (-x) + 2
# 初めだけ B を押すとき
ans2 = y - (-x) + 1
# 終わりだけ B を押すとき
ans3 = -y - x + 1
# B を押さないとき
ans4 = y - x

ans = [ans1,ans2,ans3,ans4]
ans = [a for a in ans if a > 0]
ans = min(ans)
print(ans)
import sys
prime = [0 for i in range(1000000)]
isPrime = [1 for i in range(1000000)]
isPrime[0] = 0
isPrime[1] = 0
p = 0

for i in sys.stdin:
    n = int(i)
    for i in range(2,n+1):
        if isPrime[i] == 1:
            p += 1
            prime[p] = i
            for j in range(i*2, n+1, i):
                isPrime[j] = 0
    print(sum(isPrime[:n+1]))

### FIXED CODE ###

import sys
prime = [0]
isPrime = [1 for i in range(1000000)]
isPrime[0] = 0
isPrime[1] = 0
for i in sys.stdin:
    n = int(i)
    if prime[len(prime)-1] < n:
        for i in range(prime[len(prime)-1]+1,n+1):
            if isPrime[i] == 1:
                prime.append(i)
                for j in range(i*2, 1000000, i):
                    isPrime[j] = 0
    print(sum(isPrime[:n+1]))
x,a = map(int, input().split())

if x < a:
    print(0)
else
    print(10)

### FIXED CODE ###

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

if x < a:
    print(0)
else:
    print(10)
n, x = list(map(int, input().split()))
li = list(map(int, input().split()))
d = []
d.append(0)
for l in li:
  d.append(d[-1] + l)
cnt = 0
for hoge in d:
  if(hoge <= d):
    cnt = cnt + 1
print(cnt)

### FIXED CODE ###

n, x = list(map(int, input().split()))
li = list(map(int, input().split()))
d = []
d.append(0)
for l in li:
  d.append(d[-1] + l)
cnt = 0
for hoge in d:
  if(hoge <= x):
    cnt = cnt + 1
print(cnt)
import sys
sys.setrecursionlimit(10000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    S = input()
    # 再帰的に解いて解く

    def solver(T):
        if T == "":
            print("YES")
            quit()
        if len(T) >= 5:
            if T[:5] == "dream" or T[:5] == "erase":
                solver(T[5:])
        if len(T) >= 6:
            if T[:6] == "eraser":
                solver(T[6:])
        if len(T) >= 7:
            if T[:7] == "dreamer":
                solver(T[7:])
        return

    solver(S)
    print("NO")
    return


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)


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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    S = input()
    # 後ろから貪欲に評価すればよい
    while True:
        if S[-5:] == "dream" or S[-5:] == "erase":
            S = S[:-5]
            continue
        elif S[-6:] == "eraser":
            S = S[:-6]
            continue
        elif S[-7:] == "dreamer":
            S = S[:-7]
            continue
        else:
            break
    if S == "":
        print("YES")
    else:
        print("NO")
    return


if __name__ == "__main__":
    main()
s=input()
num=len(s)å
print("x"*(num))

### FIXED CODE ###

s=input()
num=len(s)
print("x"*(num))
if __name__ == '__main__':
    N = input()

    for n in range(1,3501):
        for h in range(1,3501):
            w = n * h * N / (4 * n * h - N * n - N * h)
            if isinstance(w, int) and w > 0:
                break

    print w, h, n


### FIXED CODE ###

S = raw_input()
ac = 0
for i in S:
    if i == '1':
        ac += 1

print ac
n = int(input())
ab = [[0] * n for i in range(3)]
for i in range(n):
  ab[0][i], ab[1][i] = map(int, input().split())
  ab[2][i] = ab[0][i] + ab[1][i]
sorted(ab, key=lambda x: x[2])
print(sum(ab[0][0::2])-sum(ab[1][1::2]))


### FIXED CODE ###

# C
n = int(input())
if n==1:
    a, b =map(int, input().split())
    print(a)
else:
    def return_a(n):
        return n[0]
    def return_b(n):
        return n[1]
    ab = [[0] * 3 for i in range(n)]
    for i in range(n):
        ab[i][0], ab[i][1] = map(int, input().split())
        ab[i][2] = ab[i][0] + ab[i][1]
    ab = sorted(ab, key=lambda x: x[2], reverse=True)
    print(sum(map(return_a, ab[0::2])) - sum(map(return_b, ab[1::2])))
a, b, c, k = map(int, input().split())
if a >= k :
    print(2*k)
    elif b >= (k-a):
        print(2*a + k-a)
        else:
            print(2*a+k-a-(k-a-b))
            

### FIXED CODE ###

a, b, c, k = map(int, input().split())
if a >= k :
    print(k)
elif b >= (k-a):
    print(a)
else:
    print(a-k+a+b)
a,b = map(int,input().split())
print a*b,2*(a+b)

### FIXED CODE ###

(a,b) = map(int,raw_input().split())
print a*b,2*(a+b)
1x = int(input())

if x == 1:
    print(0)
else:
    print(1)


### FIXED CODE ###

x = int(input())

if x == 1:
    print(0)
elif x == 0:
    print(1)
s,w =map(input().stlip())

if s>w:
  print("safe")
else:
  print("unsafe")
  

### FIXED CODE ###

s,w =map(int,input().split())
 
if s>w:
  print("safe")
else:
  print("unsafe")
#!/usr/bin/env python3

import sys


def main():
    lines = sys.stdin.readlines()
    (_, quantum) = lines[0].split(' ')
    quantum = int(quantum)

    processes = []
    for line in lines[1:]:
        if line.strip() == '':
            break

        (k, v) = line.strip().split(' ')
        processes.append((k, int(v)))

    time = 0
    result = []
    while True:
        (process, process_time) = processes.pop(0)  # Dequeue

        if process_time <= quantum:
            time += process_time
            result.append((process, time))
        else:
            time += quantum
            processes.append((process, process_time - quantum))

        if len(processes) == 0:
            break

    for item in result:
        print("%s %s" % (item[0], item[1]))

if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys


def calc_inverse_polish_notation_string(s):
    tokens = [token for token in s.split(' ') if token != '']
    stack = []
    for token in tokens:
        if token in ['+', '-', '*', '/']:
            val2 = stack.pop()
            val1 = stack.pop()
            result = eval("%s %s %s" % (val1, token, val2))
            stack.append(result)
        else:
            stack.append(token)

    return stack[0]  # if len(stack) != 1, it should throw an exception


def main():
    for line in sys.stdin.readlines():
        print(calc_inverse_polish_notation_string(line.strip()))

if __name__ == "__main__":
    main()
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    h, w = map(int, input().split())
    
    ss = [['.'] * w] + ['.' + input() + '.' for _ in range(h)] + [['.'] * w]

    for i in range(1, h + 1):
        for j in range(1, w + 1):
            if ss[i][j] == '#':
                if ss[i + 1][j] == '.' and ss[i - 1][j] == '.' and ss[i][j + 1] == '.' and ss[i][j - 1] == '.':
                    print("No")
                    break
        else:
            continue
        break
    else:
        print("Yes")



if __name__ == '__main__':
    main()

### FIXED CODE ###

def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    h, w = map(int, input().split())
    
    ss = ['.' * (w + 2)] + ['.' + input() + '.' for _ in range(h)] + ['.' * (w + 2)]

    for i in range(1, h + 1):
        for j in range(1, w + 1):
            if ss[i][j] == '#':
                if ss[i + 1][j] == '.' and ss[i - 1][j] == '.' and ss[i][j + 1] == '.' and ss[i][j - 1] == '.':
                    print("No")
                    break
        else:
            continue
        break
    else:
        print("Yes")



if __name__ == '__main__':
    main()
n, k = map(int, input().split())
s = input()
memo = []
c = 0
ps = ''
lens = len(s) - 1
b = 0
if s[0] == '1':
    b = 1

for i in range(lens + 1):
    if s[i] != ps:
        memo.append(c)
        c = 1
        ps = s[i]
        if i == lens:
            memo.append(1)
        continue
    if i == lens:
        memo.append(c+1)
    c += 1
    ps = s[i]

if  len(memo) < k * 2 + b + 1:
    print(sum(memo))
else:
    sumi = 0
    sumi = sum(memo[: k * 2 + b + 1])
    temp = [sumi]
    memo.append(0)
    # print(memo)
    # print(len(memo))
    for i in range(0, len(memo) - 2 * k  - 1, 2):
        sumi = sumi - memo[i] - memo[i + 1] + memo[i + 2 * k  + 1] + memo[i + 2 * k + 2]
        temp.append(sumi)
    # print(temp)
    print(max(temp))


### FIXED CODE ###

n, k = map(int, input().split())
s = input()
memo = []
c = 0
ps = ''
lens = len(s) - 1
b = 0
if s[0] == '1':
    b = 1

for i in range(lens + 1):
    if s[i] != ps:
        memo.append(c)
        c = 1
        ps = s[i]
        if i == lens:
            memo.append(1)
        continue
    if i == lens:
        memo.append(c+1)
    c += 1
    ps = s[i]

if  len(memo) < k * 2 + b + 1:
    print(sum(memo))
else:
    sumi = 0
    sumi = sum(memo[: k * 2 + b + 1])
    temp = [sumi]
    memo.append(0)
    # print(memo)
    # print(len(memo))
    for i in range(b, len(memo) - 2 * k  - 1, 2):
        last = 0
        if i + 2 * k + 2 <= len(memo) - 1:
            last = memo[i + 2 * k + 2]
        sumi = sumi - memo[i] - memo[i + 1] + memo[i + 2 * k  + 1] +last
        temp.append(sumi)
    # print(temp)
    print(max(temp))
N = int(input())
lst = list(map(int, input().split()))
boolean = False
updated_lst = []
minimum = min(lst)
min_num = 0
for i in lst:
  num = i % minimum
  if (i != minimum):
    updated_lst.append(num)
  else:
    updated_lst.append(minimum)
    min_num += 1
  if (num % 2 == 1):
    boolean = True

if (min_num == len(lst)):
  print(minimum)
else:
  if (boolean):
    print(1)
  else:
    print(min(updated_lst)


### FIXED CODE ###

import fractions
N = int(input())
lst = list(map(int, input().split()))
ans = lst[0]
for i in range(1, N):
    ans = fractions.gcd(ans, lst[i])
print(ans)
import sys
from scipy.special import comb

def input():
    return sys.stdin.readline().strip()
 
def main():
    K = int(input())
    S = input()
 
    mod = 10 ** 9 + 7
    n = len(S)
    ans = 0
 
    for i in range(K+1):
        tmp = pow(25,i,mod)
        tmp *= comb(i+n-1,n-1,exact=True)
        tmp *= pow(26,K-i,mod)
        ans += tmp
        ans %= mod
    print(ans)
 
if __name__ == "__main__":
    main()

### FIXED CODE ###

import sys

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

def main():
    K = int(input())
    S = input()

    mod = 10 ** 9 + 7
    n = len(S)
    ans = 0

    fact =[1]*(K+n)
    factinv = [1]*(K+n)
    inv = [0,1]


    for i in range(2,K+n):
        fact[i] = (fact[i-1] * i) % mod
        inv.append((-inv[mod % i] * (mod // i)) % mod)
        factinv[i] = (factinv[i-1] * inv[i]) % mod

    def nCr(n,r):
        r = min(r,n-r)
        return (fact[n] * factinv[r] * factinv[n-r]) % mod

    for i in range(K+1):
        tmp = pow(25,i,mod)
        tmp *= nCr(i+n-1,n-1)
        tmp *= pow(26,K-i,mod)
        ans += tmp
        ans %= mod
    print(ans)

if __name__ == "__main__":
    main()