Harryxun/stf_run huggingface dataset:
N,A,B = map(int, input().split())
addBlue = 'b'*A
addRed = 'r'*B
count = 0
boals = ''

while len(boals) < N:
    boals += addBlue
    boals += addRed
    count += A

print(count - boals[N:len(boals)].count('b'))

### FIXED CODE ###

N,A,B = map(int, input().split())
adds = A + B
times = N // adds
boalsLen = adds * times
count = A * times


while True:
    if boalsLen > N:
        break
    
    tmpBoalsLen = boalsLen + A
    if tmpBoalsLen > N:
        addBoals = N - boalsLen
        count += addBoals
        break
    
    boalsLen = tmpBoalsLen
    boalsLen += B
    count += A

print(count)
n, k = map(int, input().split())
s = input()
l = list(input())
l[k] = str.lower(l[k])
print("".join(l))

### FIXED CODE ###

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

def okikae(t):
    if K==0:
        print(N)
    elif N%K==0:
        print("0")
    elif K/2 >= t and t <= K:
        print(t)
    else:
        okikae(abs(t-K))

okikae(N)

### FIXED CODE ###

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

def okikae(t, k):
    if k==0:
        print(t)
    elif int(k/2)+1 > t:
        print(t)
    elif t%k==0:
        print(0)
    elif t>k and t%k > 0:
        t = k+(t%k)
        okikae(abs(t-k), k)
    else:
        okikae(abs(t-k), k)

okikae(N, K)
A = list(map(int,input().split()))
print(max(A+B,A-B,A*B))

### FIXED CODE ###

A,B = list(map(int,input().split()))
print(max(A+B,A-B, A*B))
N = int(input())
numbers = list(map(int, input().split()))

odds = list(filter(lambda x: x % 2 == 0, numbers))
evens = list(filter(lambda x: x % 2 == 1, numbers))

evens_from_odds = sum(divmod(odds, 2))
odds_from_evens = sum(divmod(evens, 2))

if odds_from_evens % 2 == 1 or evens_from_odds % 2 == 1:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

N = int(input())
numbers = list(map(int, input().split()))

odds = list(filter(lambda x: x % 2 == 0, numbers))
evens = list(filter(lambda x: x % 2 == 1, numbers))

# evens_from_odds = sum(divmod(len(odds), 2))
# odds_from_evens = sum(divmod(len(evens), 2))
odds_from_evens = int(len(evens) / 2)
evens_mod = len(evens) % 2
if evens_mod == 1:
    print("NO")
else:
    print("YES")
n=int(input())
s=input()
ams=0
for i in range(1,n):
  a=set(s[:i])
  b=set(s[i:])
  ans=max(ans,len(a&b))

print(ans)

### FIXED CODE ###

n=int(input())
s=input()
print(max(len(set(s[:i])&set(s[i:])) for i in range(n)))
n=int(input())
s=set()
for i in range(n):
  s^=input()
print(len(s))

### FIXED CODE ###

n=int(input())
s=set()
for i in range(n):
  s^={input()}
print(len(s))
N,M = map(int,input().split())

judge = [False]*N
WAcnt = [0] * N
ACcnt = 0
for i in range(M):
    p,S = (x for x in input().split())
    p = int(p)
    if judge[p-1] == False:
        if S == "AC":
            judge[p-1] = True
            ACcnt += 1
        else:
            WAcnt[p-1] += 1

WAans = 0
for i in range(N):
    if judge[i] == True:
        WAans += WAans[i]

print(ACcnt,WAans)

### FIXED CODE ###

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

judge = [False]*N
WAcnt = [0] * N
ACcnt = 0
for i in range(M):
    p,S = (x for x in input().split())
    p = int(p)
    if judge[p-1] == False:
        if S == "AC":
            judge[p-1] = True
            ACcnt += 1
        else:
            WAcnt[p-1] += 1

WAans = 0
for i in range(N):
    if judge[i] == True:
        WAans += WAcnt[i]

print(ACcnt,WAans)
import itertool
A=itertool.permutation(range(1,int(input())+1))
print(abs(A.index(list(map(int,input().split())))-A.index(list(map(int,input().split()))))


### FIXED CODE ###

import itertools
A=list(itertools.permutations(range(1,int(input())+1)))
P=tuple(map(int,input().split()))
Q=tuple(map(int,input().split()))
print(abs(A.index(P)-A.index(Q)))
from collections import deque


H,W = map(int,input().split())
Ch,Cw = map(int,input().split())
Dh,Dw = map(int,input().split())
S = [input() for i in range(H)]
INF = float('inf')

dist = [[INF] * W for _ in range(H)]
Ch = Ch-1
Cw = Cw-1
Dh = Dh-1
Dw = Dw-1

queue = deque()
queue.append((Ch,Cw))
queue2 = deque()
dist[Ch][Cw] = 0

walk = [[0,1],[1,0],[0,-1],[-1,0]]
    
while len(queue) > 0:
    while len(queue) > 0:
        x, y = queue.popleft()
        d = dist[y][x]
        flag = 0
        for vx,vy in walk:
            nx = x + vx
            ny = y + vy
            if 0 <= nx and nx < H and 0 <= ny and ny < W:
                if S[ny][nx] == '.':
                    if dist[ny][nx] > d:
                        dist[ny][nx] = d
                        queue.append([nx,ny])
                else:
                        flag += 1
        if flag:
            queue2.append([x,y])
            
    while len(queue2) > 0:
        x, y = queue2.popleft()
        for vx in range(-2,3):
            for vy in range(-2,3):
                nx = x + vx
                ny = y + vy
                if 0 <= nx and nx < H and 0 <= ny and ny< W:
                    if S[ny][nx] == '.' and dist[ny][nx] == 10**9+7:
                        dist[ny][nx] = dist[y][x] + 1
                        queue.append([nx,ny])
                
if dist[Dh][Dw] != INF:
    print(dist[Dh][Dw])
else:
    print(-1)


### FIXED CODE ###

from collections import deque


H,W = map(int,input().split())
Ch,Cw = map(int,input().split())
Dh,Dw = map(int,input().split())
S = [input() for i in range(H)]

dist = [[10**9+7] * W for _ in range(H)]
Ch = Ch-1
Cw = Cw-1
Dh = Dh-1
Dw = Dw-1

queue = deque()
queue.append((Ch,Cw))
queue2 = deque()
dist[Ch][Cw] = 0

walk = [[0,1],[1,0],[0,-1],[-1,0]]
    
while len(queue) > 0:
    while len(queue) > 0:
        h, w = queue.popleft()
        d = dist[h][w]
        flag = 0
        for vh,vw in walk:
            nh = h + vh
            nw = w + vw
            if 0 <= nh and nh < H and 0 <= nw and nw < W:
                if S[nh][nw] == '.':
                    if dist[nh][nw] > d:
                        dist[nh][nw] = d
                        queue.append([nh,nw])
                else:
                        flag += 1
        if flag:
            queue2.append([h,w])
            
    while len(queue2) > 0:
        h, w = queue2.popleft()
        for vh in range(-2,3):
            for vw in range(-2,3):
                nh = h + vh
                nw = w + vw
                if 0 <= nh and nh < H and 0 <= nw and nw < W:
                    if S[nh][nw] == '.' and dist[nh][nw] == 10**9+7:
                        dist[nh][nw] = dist[h][w] + 1
                        queue.append([nh,nw])
                
if dist[Dh][Dw] != 10**9+7:
    print(dist[Dh][Dw])
else:
    print(-1)
while True:
   a,b = map(int, raw_input().split())

   if a == 0 && b == 0:
      break
    
   for i in range(a):
      print b*'#'
      

### FIXED CODE ###

while True:
   a,b = map(int, raw_input().split())

   if a + b ==0:
      break
    
   else:
      for i in range(a):
         print b*'#'
      print ""
N = int(input())
H = list(map(int, input().split()))
count = 0
counts = []

for i in range(N-1):
    if H[i] >= H[i+1]:
        count += 1
    else:
        counts.append(count)
        count = 0

print(max(counts))

### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
count = 0
counts = []

if N <= 1:
    counts.append(0)
else:
    for i in range(N-1):
        if H[i] >= H[i+1]:
            count += 1
        else:
            counts.append(count)
            count = 0
    else:
        counts.append(count)

print(max(counts))
import numpy as np
a,b = map(int,input().split())
lcm = np.lcm(a,b)
print(lcm)


### FIXED CODE ###

a,b = map(int,input().split())
#最大公約数
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
#最小公倍数
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))
a, b = map(int, input().split())
if a > b:
  print("GREATER")
elif a == b:
  print("EQUAL")
else:
  print("LESS")


### FIXED CODE ###

a = int(input())
b = int(input())

if a > b:
  print("GREATER")
elif a == b:
  print("EQUAL")
else:
  print("LESS")
N=int(input())
while 1:
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2
    for i in len(N):
        if A+B==C:
            print('YES')
        elif A+C==B:
            print('YES')
        elif B+C==A:
            print('YES')
        else:
            print('NO')

### FIXED CODE ###

N=int(input())
for i in range(N):
    a,b,c=map(int,input().split())
    A=a**2
    B=b**2
    C=c**2
    if A+B==C:print('YES')
    elif A+C==B:print('YES')
    elif B+C==A:print('YES')
    else:print('NO')
# _*_ coding:utf-8 _*_

import sys

input = sys.stdin.readline().replace('\n','')
ans  = 1000

for c in input:
	s = input.split(f'{c}')
	ma = 0
	for i in range(len(s)):
		if ma < len(s[i]):
			ma = len(s[i])
	
	if ans > ma:
		ans = ma
		
print(ans,end='') 

### FIXED CODE ###

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

import sys

input = sys.stdin.readline().replace('\n','')
ans  = 1000

for c in input:
	s = input.split(c)
	ma = 0
	for i in range(len(s)):
		if ma < len(s[i]):
			ma = len(s[i])
	
	if ans > ma:
		ans = ma
		
print(ans,end='')
# ABC131C

def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm


def check(a, b, c):
    x = a // c
    y = b // c
    if x * c < a:
        x += 1
    return y - x + 1

a, b, c, d = map(int, input().split())
nc = check(a, b, c)
nd = check(a, b, d)
ncd = check(a, b, sp.lcm(c, d))
print(b - a + 1 -(nc + nd - ncd))


### FIXED CODE ###

# ABC131C

def euclid(m, n):
    m0 = m = abs(m)
    n0 = n = abs(n)
    while n != 0:
        m, n = n, m % n
    qm = m0 // m
    lcm = qm * n0
    return lcm


def check(a, b, c):
    x = a // c
    y = b // c
    if x * c < a:
        x += 1
    return y - x + 1

a, b, c, d = map(int, input().split())
nc = check(a, b, c)
nd = check(a, b, d)
ncd = check(a, b, euclid(c, d))
print(b - a + 1 -(nc + nd - ncd))
N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]-1]
    if  i-1 > len(C)-1 or [A[i-1]-1] >len(C)-1:
        continue
    elif A[i] == a+1 :
        r += C[A[i-1]-1]
    a = A[i]
print(r)


### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
r = 0
a = 0
for i in range(N):
    r += B[A[i]-1]
    if  A[i]-1 > len(C):
        continue
    elif A[i] == a+1 and A[i] != 1:
        r += C[a-1]
    a = A[i]
print(r)
x = input()
pritn str(x**3)

### FIXED CODE ###

x = input()
print str(x**3)
n, m = map(int, input().split())
# 高さ入力
h = list(int, input())
a = [0]*m
b = [0]*m
for i in range(m):
    a[i], b[i] = map(int, input().split())
list = []
for i in range(m):
    if h[a[i]-1] > h[b[i]-1]:
        list.append(a[i])
    elif h[a[i]-1] == h[b[i]-1]:
        list.append(a[i])
        list.append(b[i])
    else:
        list.append(b[i])
# 答えを記録する用配列
listans = [0]*n
for i in range(len(list)):
    listans[list[i] - 1] += 1
ans = 0
for i in range(n):
    if listans[i] == 0:
        ans += 1
print(ans)

### FIXED CODE ###

n, m = [int(i) for i in input().split()]
# 高さ入力
h = [int(i) for i in input().split()]
# 条件を満たす地点を記録
list = [[]for i in range(n)]
for i in range(m):
    a, b = [int(i) for i in input().split()]
    list[a-1].append(h[b-1])
    list[b-1].append(h[a-1])
ans = 0
for i in range(n):
    if len(list[i]) == 0:
        ans += 1
    elif h[i] > max(list[i]):
        ans += 1
print(ans)
global r

def checker(x1,y1,x2,y2,xp,yp):
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		return int(1)
	elif vec < 0:
		return int(-1)

if __name__ == '__main__':
	while True:
		try:
			x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
			r = 0
			r += int(checker(x1,y1,x2,y2,xp,yp))
			r += int(checker(x2, y2, x3, y3, xp, yp))
			r += int(checker(x3, y3, x1, y1, xp, yp))
			if r == 3 or r == -3:
				print("YES")
			else:
				print("NO")
		except EOFError:
			break

### FIXED CODE ###

def checker(x1,y1,x2,y2,xp,yp):
	r = 0
	vec = (x2 - x1) * (yp - y1) - (y2 - y1) * (xp - x1)
	if vec > 0:
		r = 1
	elif vec < 0:
		r = -1
	return r

if __name__ == '__main__':
	while True:
		try:
			x1,y1,x2,y2,x3,y3,xp,yp = map(float,raw_input().split())
			r = 0
			r += int(checker(x1,y1,x2,y2,xp,yp))
			r += int(checker(x2, y2, x3, y3, xp, yp))
			r += int(checker(x3, y3, x1, y1, xp, yp))
			if r == 3 or r == -3:
				print("YES")
			else:
				print("NO")
		except EOFError:
			break
import math


def f(n):
    pop = 0
    ntemp = n
    for i in range(int(math.log2(n)) + 1):
        pop += ntemp % 2
        ntemp //= 2
    return n % pop


n = int(input())
S = input()
popcount = 0
for i in range(n):
    popcount += int(S[i])
Sint = int(S, 2)
remminus = Sint % (popcount - 1)
remplus = Sint % (popcount + 1)

# 1,2,4,...の余りのリストを準備
remlistminus = []
remlistplus = []
temp = 1
for i in range(n):
    remlistminus.append(temp)
    temp = (temp * 2) % (popcount - 1)
temp = 1
for i in range(n):
    remlistplus.append(temp)
    temp = (temp * 2) % (popcount + 1)
remlistminus.reverse()
remlistplus.reverse()
print(remlistminus)
print(remlistplus)

ans = []
for i in range(n):
    count = 1
    if S[i] == '0':
        rem = (remplus + remlistplus[i]) % (popcount + 1)
        while rem > 0:
            rem = f(rem)
            count += 1
    else:
        rem = (remminus - remlistminus[i]) % (popcount - 1)
        while rem > 0:
            rem = f(rem)
            count += 1
    ans.append(count)
for i in range(n):
    print(ans[i])


### FIXED CODE ###

import math


def f(n):
    pop = 0
    ntemp = n
    for i in range(int(math.log2(n)) + 1):
        pop += ntemp % 2
        ntemp //= 2
    return n % pop


n = int(input())
S = input()
popcount = 0
for i in range(n):
    popcount += int(S[i])

# 1が1個しかない場合の例外処理
if popcount == 1:
    if S[-1] == 1:
        ans = [2] * n
        ans[-1] = 0
    else:
        ans = [1] * n
        ans[-1] = 2
        for i in range(n):
            if S[i] == '1':
                ans[i] = 0
    for i in range(n):
        print(ans[i])
    exit()


Sint = int(S, 2)
remminus = Sint % (popcount - 1)
remplus = Sint % (popcount + 1)

# 1,2,4,...の余りのリストを準備
remlistminus = []
remlistplus = []
temp = 1
for i in range(n):
    remlistminus.append(temp)
    temp = (temp * 2) % (popcount - 1)
temp = 1
for i in range(n):
    remlistplus.append(temp)
    temp = (temp * 2) % (popcount + 1)
remlistminus.reverse()
remlistplus.reverse()

ans = []
for i in range(n):
    count = 1
    if S[i] == '0':
        rem = (remplus + remlistplus[i]) % (popcount + 1)
        while rem > 0:
            rem = f(rem)
            count += 1
    else:
        rem = (remminus - remlistminus[i]) % (popcount - 1)
        while rem > 0:
            rem = f(rem)
            count += 1
    ans.append(count)
for i in range(n):
    print(ans[i])
import numpy as np

n,m = map(int, input().split())
p = np.array(list(map(int, input().split())))
p = p-1
q = np.zeros((m,2), dtype='uint32')
for i in range(m):
	q[i] = list(map(int, input().split()))
q=q-1
par = np.arange(n)

def root(x):
	if par[x] == x:
		return x
	else:
		return root(par[x])
def merge(x, y):
	x = root(x)
	y = root(y)
	if x != y:
		par[x] = y
	pass

for x,y in q:
	merge(x,y)

tree = dict()
tree2 = dict()

for i in range(n):
	tree.setdefault(root(i), set())
	tree2.setdefault(root(i), set())
	tree[root(i)].add(i) 
	tree2[root(i)].add(p[i])

ans = set()

for value, value2 in zip(tree.values(), tree2.values()):
	ans = ans | value & value2

print(len(ans))

### FIXED CODE ###

n,m = map(int, input().split())
p = list(map(int, input().split()))
par = [i for i in range(n)]
rank = [0 for x in range(n)]

def root(x):
	tmp = par[x]
	if tmp == x:
		return x
	else:
		a = root(tmp)
		par[x] = a
		return a

def merge(x, y):
	x = root(x)
	y = root(y)
	if x == y:
		return
	else:
		if rank[x] > rank[y]:
			par[y] = x
			rank[y] += rank[x]
		else:
			par[x] = y
			rank[x] += rank[y]
		return

for i in range(m):
	x, y = map(int, input().split())
	merge(x-1, y-1)

ans = 0

for i in range(n):
	if p[i]-1 == i:
		ans += 1
	elif root(p[i]-1) == root(i):
		ans += 1

print(ans)
import math

n, m=map(int, input().split())
t = {}
# a = int(math.sqrt(m))

s=0

# line = [2, 3] + [i%2*2 + i//2 * 6 + 5 for i in range(a)] + [m]
line = [2] + list(range(3, m+2, 2))

for i in line:
# for i in range(2, m+2, 2):
#     print(i)
    cnt = 0
    while m%i==0:
        m=m//i
        cnt += 1

    if cnt>0:
        t[i]=cnt

    if m==1:
        break

def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) 

out=1
for tk in t.keys():
    out *= combi(t[tk]+n-1, n-1)
#     out = out%(1000000007)
print(out%(1000000007))

### FIXED CODE ###

import math

n, m=map(int, input().split())
t = {}
a = int(math.sqrt(m))

s=0

line = [2, 3] + [i%2*2 + i//2 * 6 + 5 for i in range(a)]
# line = [2] + list(range(3, m+2, 2))

for i in line:
# for i in range(2, m+2, 2):
#     print(i)
    cnt = 0
    while m%i==0:
        m=m//i
        cnt += 1

    if cnt>0:
        t[i]=cnt

    if m==1:
        break

if m!=1:
    t[m]=1

def combi(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r)) 

out=1
for tk in t.keys():
    out *= combi(t[tk]+n-1, n-1)
#     out = out%(1000000007)
print(out%(1000000007))
def calc(int: a) -> int:
    return a+a**2+a**3

if __name__ == "__main__":
    a = int(input())
    print(calc(a))

### FIXED CODE ###

def calc(a: int) -> int:
    return a+a**2+a**3

if __name__ == "__main__":
    a = int(input())
    print(calc(a))
import math

a, b = input().split()
A, B = [int(a), int(b * 100)]

print(A * B / 100)

### FIXED CODE ###

import math

a, b = input().split()
A, B = [int(a), int(b.replace('.', ''))]

print(A * B // 100)
N=int(input())
S=0
while 1:
    S+=N-10*(int(N/10))
    N=int(N/10)
    if N<1:break

N=S
S=0
while 1:
    S+=N-10*(int(N/10))
    N=int(N/10)
    if N<1:break

if S%9==0:print("Yes")
else:print("No")

### FIXED CODE ###

N=int(input())
if N%9==0:print("Yes")
else:print("No")
x, y, z, k = map(int, input().split())
a =list(map(int, input().split()))
b =list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse = True)
b.sort(reverse = True)
c.sort(reverse = True)
ab =[]
abc = []
for i in a:
    for j in b:
        ab.append(i+j)
ab.sort(reverse = True)
m = min(K, X*Y)
ab = ab[:m]
for i in ab:
    for j in c:
        abc.append(i +j)
abc.sort(reverse = True)
for i in range(k):
    print(abc[i])

### FIXED CODE ###

x, y, z, k = map(int, input().split())
a =list(map(int, input().split()))
b =list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse = True)
b.sort(reverse = True)
c.sort(reverse = True)
abc = []
for i in range(x):
    if (i+1) > k:
        break
    for j in range(y):
        if (i+1)*(j+1) > k:
            break
        for h in range(z):
            if (i+1)*(j+1)*(h+1) >k:
                break
            abc.append(a[i] +b[j] +c[h])
abc.sort(reverse = True)
for i in range(k):
    print(abc[i])
N = int(raw_input())
a = map(int, raw_input().split())
mx = max(a)
mn = min(a)
print mx - mn

### FIXED CODE ###

a, b, c = map(int, raw_input().split())
if (a * 100 + b * 10 + c) % 4 == 0:
    print "YES"
else:
    print "NO"
import math

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

def isPossible(X):
    global N, K, A

    cuts = 0
    for i in range(N):
        cuts += math.ceil(A[i]/X) - 1
    
    return cuts <= K

minVal = 0
maxVal = max(A)

while maxVal - minVal >= 1:
    if isPossible((maxVal + minVal) / 2):
        maxVal = (maxVal + minVal) / 2
    else:
        minVal = (maxVal + minVal) / 2

if not isPossible(minVal) and int(minVal) == minVal:
    print(minVal+1)
else:
    print(math.ceil(minVal))

### FIXED CODE ###

import math

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

def isPossible(X):
    global N, K, A

    cuts = 0
    for i in range(N):
        cuts += math.ceil(A[i]/X) - 1
    
    return cuts <= K

minVal = 0
maxVal = max(A)

while math.ceil(minVal) != math.ceil(maxVal):
    if isPossible((maxVal + minVal) / 2):
        maxVal = (maxVal + minVal) / 2
    else:
        minVal = (maxVal + minVal) / 2

print(math.ceil(maxVal))
from itertools import groupby
from iterator import itemgetter

a = groupby(sorted(input() for _ in range(int(input()))))
a = [(len(tuple(g)), s) for s, g in a]
m = max(a, key=itemgetter(0))[0]
for k, s in a:
  if k == m:
    print(s)


### FIXED CODE ###

from collections import Counter
from itertools import groupby
from operator import itemgetter

c = Counter(input() for _ in range(int(input())))
a = sorted((-c[x],x) for x in c)
for _, s in next(groupby(a, itemgetter(0)))[1]:
  print(s)
N, M, X = map(int, input().split())
book = [[map(int, input().split())] for i in range(N)]

min_value = -1
for i in range(2**N):
  sum = [0 for k in range(M+1)]
  for j in range(N):
    if (i >> j) & 1:
      sum = [x+y for x, y in zip(sum, book[N+1])]
  if min(sum[1:]) >= X and min_value > sum[0]:
    min_value = sum[0]

print(min_value)

### FIXED CODE ###

N, M, X = map(int, input().split())
book = [list(map(int, input().split())) for i in range(N)]

min_value = -1
for i in range(2**N):
    sum = [0 for k in range(M+1)]
    for j in range(N):
        if (i >> j) & 1:
            sum = [x+y for x, y in zip(sum, book[j])]
    if min(sum[1:]) >= X and (min_value > sum[0] or min_value == -1):
        min_value = sum[0]

print(min_value)
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")
import math

N , K = map(int, input().split())
flag = "F"

lenN = int (math.log10(N) + 1)
lenK = int (math.log10(K) + 1)
N = abs(N-K*(abs(lenN-lenK))) 

while 1:
    
    
    a = N
    N = abs(N - K)
    

    if a<=K and N <= K:
        if a < N:
            result = a
            flag="T"
        else:
            result = N
            flag="T"
    if flag == "T":
        break
print(result)

### FIXED CODE ###

import math

N , K = map(int, input().split())
flag = "F"
if N !=0:
    while 1:
        lenN = int (math.log10(N) + 1)
        lenK = int (math.log10(K) + 1)
        N = abs(N-K*(10**abs(lenN-lenK-1)))
        lenN = int (math.log10(N) + 1)
        if abs(lenN-lenK)<2:
            break



        
while 1:
    
    
    a = N
    N = abs(N - K)
    

    if a<=K and N <= K:
        if a < N:
            result = a
            flag="T"
        else:
            result = N
            flag="T"
    if flag == "T":
        break
print(result)
a,b=map(int,input().split())
3 5
print(a*b,2*a+2*b)

### FIXED CODE ###

a,b=map(int,input().split())
print(a*b,2*(a+b))
N = int(input())
A = int(input())

N %= A
if N <= A:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

N = int(input())
A = int(input())

N %= 500
if N <= A:
    print("Yes")
else:
    print("No")
import numpy as np
import math
from functools import reduce

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

N, X = map(int, input().split())
x = np.array(list(map(int, input().split())))
if N == 1:
    print(np.abs(x[0] - X))
else:
    x = np.abs(x - X)
    print(min(gcd(x)))

### FIXED CODE ###

import numpy as np
import fractions
from functools import reduce

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

N, X = map(int, input().split())
x = np.array(list(map(int, input().split())))
if N == 1:
    print(np.abs(x[0] - X))
else:
    x = np.abs(x - X)
    print(gcd(x))
n,k,*a=map(int,open(0).read().split())
r=range(n)
while k:
 k-=1;b=[0]*n*2
 for i in r:t=a[i];b[max(0,i-t)]+=1;b[i-~t]-=1
 for i in r:b[i+1]+=b[i]
 if max(a:=b[:n])==n:break
print(*a)

### FIXED CODE ###

def main():
    n,k,*a=map(int,open(0).read().split())
    for _ in range(k):
        b=[0]*n
        m=10**18
        for i,t in enumerate(a):
            if t<m:m=t
            b[max(0,i-t)]+=1
            if i-~t<n:b[i-~t]-=1
        if m>=n:break
        for i in range(n-1):b[i+1]+=b[i]
        a=b
    print(' '.join(map(str,a)))
main()