Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import math

l, r = map(int, input().split())

count = 0
dif2sum = 0
ans = 2020
for i in range(l, r):
    for j in range(i + 1, r + 1):
        tmp = i * j % 2019
        if ans > tmp:
            ans = tmp
    
print(ans)

### FIXED CODE ###

l, r = map(int, input().split())

ans = 2020
if r - l >= 2019:
    r = l + 2018
for i in range(l, r):
    for j in range(i + 1, r + 1):
        tmp = i * j % 2019
        if ans > tmp:
            ans = tmp
    
print(ans)
### BUGGY CODE ###

N = int(input())
S = input()
count = 0
for i in range(0,1000):
    num = str(i).zfill(3)
    for j in range(N):
        for k in range(j+1, N):
            for l in range(k+1, N):
                if num == S[j]+ S[k]+S[l]:
                    count += 1
                    break
            else:
                continue
            break
        else:
            continue
        break
print(count)

### FIXED CODE ###

def solve():
    N = int(input())
    S = input()
    count = 0
    for i in range(0,1000):
        num = str(i).zfill(3)
        digit = 0
        for j in range(N):
            if S[j] == num[digit]:
                digit += 1
            if digit == 3:
                break
        if digit ==3:
            count += 1

    print(count)

if __name__ == '__main__':
    solve()
### BUGGY CODE ###

def get_answer(input_list):
    c_list = [int(v) for v in input_list[0].split(" ")]
    n = c_list[0]
    k = c_list[1]
    q = c_list[2]
    a = [int(v) for v in input_list[1:]]
    ns = [k] * n
    for aa in a:
        index = aa - 1
        for i in range(len(ns)):
            if i != index:
                ns[i] -= 1

    nr = [""] * n
    for i in range(len(ns)):
        if ns[i] <= 0:
            nr[i] = "No"
        else:
            nr[i] = "Yes"

    return nr



if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    for a in get_answer(input_list):
        print(a)


### FIXED CODE ###

def get_answer(input_list):
    c_list = [int(v) for v in input_list[0].split(" ")]
    n = c_list[0]
    k = c_list[1]
    q = c_list[2]
    a = [int(v) for v in input_list[1:]]
    ns = [k - q] * n
    for aa in a:
        index = aa - 1
        ns[index] += 1
        """
        for i in range(len(ns)):
            if i != index:
                ns[i] -= 1
        """

    nr = [""] * n
    for i in range(len(ns)):
        if ns[i] <= 0:
            nr[i] = "No"
        else:
            nr[i] = "Yes"

    return nr



if __name__ == "__main__":
    input_list = []
    while True:
        try:
            input1 = input()
            if not input1:
                break
            if len(input1) == 0:
                break
            input_list.append(input1)
        except EOFError:
            break
    for a in get_answer(input_list):
        print(a)
### BUGGY CODE ###

import math
from functools import reduce

K = int(input())

memo = {}
def gcd(a, b):
  key = frozenset((a,b))
  if key in memo:
    return memo[key]
  memo[key] = math.gcd(a, b)
  return memo[key]
ans = 0
for i in range(1, K+1):
  for j in range(1, K+1):
    for k in range(1, K+1):
      ans += reduce(gcd, [i, j, k])
print(ans)

### FIXED CODE ###

import math
from collections import Counter

K = int(input())

memo = {frozenset((i, j)): math.gcd(i, j) 
        for i in range(1, K+1) for j in range(i, K+1)}

counter = Counter([memo[frozenset((i, j))] 
                   for i in range(1, K+1) for j in range(1, K+1)])

total = 0
for i in range(1, K+1):
  for value, count in counter.items():
    total += memo[frozenset((i, value))] * count
    
print(total)
### BUGGY CODE ###

import bisect
import itertools
n=int(input())
s=str(input())
R=[]
B=[]
G=[]
for i in range(n):
  if s[i]=='R':
    R.append(i)
  elif s[i]=='B':
    B.append(i)
  else:
    G.append(i)
ans=len(R)*len(B)*len(G)
l=itertools.permutations([R,B,G])
for r,b,g in l:
  for i in r:
    index=bisect.bisect_left(b,i)
    for j in b[index:]:
      index2=bisect.bisect_left(g,j)
      if j+j-i in g[index2:]:
        ans-=1
print(ans)

### FIXED CODE ###

n=int(input())
s=str(input())
R=[]
B=[]
G=[]
for i in range(n):
  if s[i]=='R':
    R.append(i)
  elif s[i]=='B':
    B.append(i)
  else:
    G.append(i)
ans=len(R)*len(B)*len(G)

for i in range(n-1):
  for j in range(i+1,n):
    char1=s[i]
    char2=s[j]
    if char1==char2:
      pass
    else:
      if n>2*j-i>j and s[2*j-i]!=char1 and s[2*j-i]!=char2:
        ans-=1
print(ans)
### BUGGY CODE ###

print(sum(x for x in range(int(input()))))

### FIXED CODE ###

N = int(input())
print(N*(N-1)//2)
### BUGGY CODE ###

n,q=map(int,input().split())
A=list(map(int,input().split()))
from collections import Counter
for i in range(q):
    a,b=map(int,input().split())
    print(len(Counter(A[a-1:b]).keys()))

### FIXED CODE ###

import sys
import math
import heapq
mod=10**9+7
inf=float("inf")
from math import sqrt
from collections import deque
from collections import Counter
from math import ceil
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import Decimal #floatの高精度ver, 渡すのはstr型で
from functools import lru_cache
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
#ソート、"a"+"b"、再帰ならPython3の方がいい
#######ここから天ぷら########
class BIT:
    def __init__(self,n):
        self.n=n
        self.data= [0]*(n+1) #これがBIT
        self.el= [0]*(n+1) #これが元データ
    def sum(self,i):  #iまでの和
        s=0
        while i>0:
            s+=self.data[i]
            i-= i&(-i)
        return s
    def add(self,i,x):  #iにxを足す(x<0)
        self.el[i]+=x
        while i<= self.n:
            self.data[i]+= x
            i+= i&-i
    def get(self,i,j=None):  #iからjまでの和、iだけなら普通の要素iを取得(いる？)
        if j is None:
            return self.el[i]
        return self.sum(j)-self.sum(i)
    

n,q=map(int,input().split())
C=list(map(int,input().split()))
C=[i-1 for i in C]  #球の純粋配置
Q=[]
for i in range(q):
    l,r=map(int,input().split())
    l-=1;r-=1
    Q.append([i,l,r])
Q=sorted(Q, key=lambda x:x[2]) 
ANS=[-1]*q

B=BIT(n)
YOI=[-1]*n #色iの良い球の位置
# for i in range(Q[0][2],-1,-1):
#     if YOI[i]==-1:
#         YOI[C[i]]=i
#         B.add(i+1,1)
# 
# 
# ANS[Q[0][0]]= B.sum(Q[0][2]+1)- B.sum(Q[0][1])
# left=Q[0][1]; right=Q[0][2]
#print(B.data)
right=-1
for l in Q:
    newleft,newright=l[1],l[2]
    for i in range(newright,right,-1):
        if YOI[C[i]]==-1: #新種の色
            YOI[C[i]]=i
            B.add(i+1, 1)
        elif YOI[C[i]]>i:
            continue
        else:
            B.add(YOI[C[i]]+1, -1)
            YOI[C[i]]=i
            B.add(i+1, 1)
    ANS[l[0]]= B.sum(newright+1)- B.sum(newleft)
    right=newright
    #print(B.data)
for i in ANS:
    print(i)
### BUGGY CODE ###

N = int(input())
p = [int(i) for i in input().split()]
ans = 1

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

for i in range(N):
  ans*=p[i]
  
if ans > 10 ** 18:
  print(-1)
  exit()
  
print(ans)

### FIXED CODE ###

N = int(input())
p = [int(i) for i in input().split()]
ans = 1

if 0 in p:
  print(0)
  exit()
  
for i in range(N):
  ans*=p[i]
  if ans > 10 ** 18:
    print(-1)
    exit()
print(ans)
### BUGGY CODE ###

N=int(input())
a=list(map(int,input().split()))
ans=0
for i in set(a):
    ans=max(ans,a.count(i-1)+a.count(i)+a.count(i+1))
print(ans)

### FIXED CODE ###

import collections
N=int(input())
a=list(map(int,input().split()))

arr=[]
for i in a:
    arr.extend([i-1,i,i+1])

arr_c=collections.Counter(arr)

print(max(arr_c.values()))
### BUGGY CODE ###

# 累積和
import numpy as np


def loop(n, k, A):
    for _ in [0] * k:
        B = np.zeros(n + 1, dtype=np.int64)
        for i in range(n):
            left = max(0, i - A[i])
            right = min(n, i + A[i] + 1)
            B[left] += 1
            B[right] -= 1
        A = np.cumsum(B)[:-1]
        #print(A)
        if np.all(A == n):
            return A
            break

    return A


def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    A = np.array(a, dtype=np.int64)
    A = loop(n, k, A)
    print(*A)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# 累積和
import numpy as np
from numba import njit

@njit(cache=True)
def loop(n, k, A):
    for _ in [0] * k:
        B = np.zeros(n + 1, dtype=np.int64)
        for i in range(n):
            left = max(0, i - A[i])
            right = min(n, i + A[i] + 1)
            B[left] += 1
            B[right] -= 1
        A = np.cumsum(B)[:-1]
        #print(A)
        if np.all(A == n):
            return A
            break

    return A


def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    A = np.array(a, dtype=np.int64)
    A = loop(n, k, A)
    print(*A)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N = int(input())
if N == 1:
    print(0)
else:
    num = 0
    for i in range(1, N):
        num += i
    print(num)

### FIXED CODE ###

N = int(input())
if N == 1:
    print(0)
else:
    print((N-1)*N//2)
### BUGGY CODE ###

 # -*- coding: utf-8 -*-
import sys

def main():
	N, W = map(int, input().split(" "))
	goods = []
	for _ in range(N):
		w, v = map(int, input().split(" "))
		goods.append((w, v))
		
	ans = 0
	for i in range(2 ** N):
		val = 0
		wal = 0
		flg = True
		for j in range(N):
			if i >> j & 1 == 1:
				w, v = goods[j]
				val += v
				wal += w
				if W < wal:
					flg = False
					break
		if flg == False:
			continue
		if ans < val:
			ans = val
		
	print(ans)
		
if __name__ == "__main__":
	main()
	

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def main():
	N, W = map(int, input().split())
	wv = []
	for i in range(N):
		w, v = map(int, input().split())
		if w <= W:
			wv.append((w,v))
		
	DP = [[0 for _ in range(100001)] for _ in range(N)]
	
	for i, val in enumerate(wv):
		w, v = val
		if i == 0:
			DP[i][w] = v
			continue
			
		for j in range(W):
			DP[i][j] = max(DP[i-1][j], DP[i][j])
			
			if j+w <= W:
				DP[i][j+w] = max(DP[i-1][j] + v, DP[i][j+w])
			
	print(max(DP[N-1]))
	
if __name__ == "__main__":
	main()
### BUGGY CODE ###

n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(1, n+1):
  b.append(a.index(i) + 1)
print(*b)

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = [0] * n
for i in range(n):
  b[a[i]-1] = i+1
print(*b)
### BUGGY CODE ###

import itertools

N=list(range(int(input())))
S=list(input())
S=sorted(S)
answer=0

prev=S[0]
counts = []
counter=0

for k in S:
    if k==prev:
        counter+=1
    else:
        prev=k
        if counter!=0:
            counts.append(counter)
        counter=1
if counter!=0:
    counts.append(counter)

def soujou(li):
    atai=1
    for j in li:
        atai=j*atai
    return atai

for i in N:
    C=list(itertools.combinations(counts, i+1))
    kumiawase=[soujou(j) for j in C]
    answer+=sum(kumiawase)
print(answer%(7+10**9))

### FIXED CODE ###

N=list(range(int(input())))
S=list(input())
S=sorted(S)
answer=0

prev=S[0]
counts = []
counter=0

for k in S:
    if k==prev:
        counter+=1
    else:
        prev=k
        if counter!=0:
            counts.append(1+counter)
        counter=1
if counter!=0:
    counts.append(1+counter)

def soujou(li):
    atai=1
    for j in li:
        atai=j*atai
    return atai

answer=soujou(counts)-1
print(answer%(7+10**9))
### BUGGY CODE ###

S = input().strip()
mod = 10**9 + 7
d = {i:i*10%13 for i in range(13)}
dp = [[0]*13 for _ in range(len(S)+1)]
dp[0][0] = 1
for i, c in enumerate(S, 1):
    if c != '?':
        c = int(c)
        for j in range(13):
            dp[i][(d[j] + c) % 13] = dp[i-1][j] % mod
    else:
        for c in range(10):
            for j in range(13):
                k = (d[j] + c) % 13
                dp[i][k] = (dp[i][k] + dp[i-1][j]) % mod
print(dp[-1][5])

### FIXED CODE ###

S = input().strip()
mod = 10**9 + 7
d = {i:i*10%13 for i in range(13)}
dp = [[0]*13 for _ in range(len(S)+1)]
dp[0][0] = 1
for i, c in enumerate(S, 1):
    if c != '?':
        c = int(c)
        for j in range(13):
            dp[i][(d[j] + c) % 13] = dp[i-1][j] % mod
    else:
        for c in range(10):
            for j in range(13):
                k = (d[j] + c) % 13
                dp[i][k] = (dp[i][k] + dp[i-1][j]) % mod
print(dp[-1][5])
### BUGGY CODE ###

import sys
n = int(input())
s = input().split()

result = 1
for i in range(n):
    result = result * int(s[i])
    
if result > (10 ** 18):
    print(-1)
    sys.exit()

print(result)

### FIXED CODE ###

import sys
n = int(input())
s = input().split()

result = 1

if "0" in s:
    print(0)
    sys.exit()
for i in range(n):
    result = result * int(s[i])
    if result > (10 ** 18):
        print(-1)
        sys.exit()

print(result)
### BUGGY CODE ###

def main():
    a, b, c, d = map(int, input().split())
    kai_a = a // d
    kai_c = c // b
    amari_a = a % d
    amari_c = c % b

    while a > 0:
        while c > 0:
            c -= b
            if c <= 0:
                print('Yes')
                break
            else:
                a -= d
                if a <= 0:
                    print('No')
                    break

if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    a, b, c, d = map(int, input().split())
    kai_a = a // d
    kai_c = c // b
    amari_a = a % d
    amari_c = c % b
    
    if kai_a > kai_c:
        print('Yes')
    elif kai_a == kai_c:
        if amari_c == 0:
            print('Yes')
        elif amari_a == 0:
            print('No')
        else:
            print('Yes')
    else:
        if amari_c == 0 and amari_a > 0:
            print('Yes')
        else:
            print("No")

 
if __name__ == '__main__':
    main()
### BUGGY CODE ###

import itertools
import sys
import numpy as np
#0-indexed
N = int(input())
A = np.array(sys.stdin.read().split(), dtype=int).reshape((N, N - 1))
A -= 1
R = np.arange(N)
ans = 0
while True:
    I = (A[A[:, 0]][:, 0] == R) * (A[:, 0] != -1)
    if not I.any():
        break
    ans += 1
    A[I, :-1] = A[I, 1:]
    A[I, -1] = -1
if (A == -1).all():
    print(ans)
else:
    print(-1)


### FIXED CODE ###

import itertools
#0-indexed
N = int(input())
A = [[int(_) - 1 for _ in input().split()][::-1] for _ in range(N)]
ans = 0
cand = range(N)
left = 1
while True:
    cand_ = set()
    for i in cand:
        v = A[i]
        if not len(v):
            continue
        if A[v[-1]][-1] == i:
            f = 0
            cand_.add(i)
            cand_.add(v[-1])
    if not cand_:
        break
    cand = cand_
    left = 0
    for i in cand:
        A[i].pop()
        left |= len(A[i]) > 0
    ans += 1
if left:
    print(-1)
else:
    print(ans)
### BUGGY CODE ###

N = raw_input()
N = int(N)

a = []
for i in range(N):
	a.sort()
	s_input = raw_input()
	s_input = int(s_input)
	if s_input in a:
		a.remove(s_input)
	else:
		a.append(s_input)

print(len(a))

### FIXED CODE ###

n=int(raw_input())
li={}
while n !=0:
    a = raw_input()
    if a in li:
        del li[a]
    else:
        li[a]=a
    n-=1
print(len(li))
### BUGGY CODE ###

from collections import deque
import collections

def main():
    N = int(input())
    A = list(map(int, input().split()))

    c = collections.Counter(A)
    # 重複排除
    A.sort()
    dq = deque()
    before = 0
    for a in A:
        dq.append(a)

    ans = 0
    while dq:
        a = dq.popleft()
        if c[a] == 1:
            ans += 1
        dq2 = deque()
        while dq:
            a2 = dq.popleft()
            if a2 % a:
                dq2.append(a2)
        dq = dq2

    print(ans)

if __name__ == '__main__':
    main()

### FIXED CODE ###

import collections

def main():
    N = int(input())
    A = list(map(int, input().split()))

    _max = 10 ** 6 + 1

    c = collections.Counter(A)

    ok_flag = [True] * _max   
    uniq_A = list(c.keys())
    uniq_A.sort()
    ans = 0

    for a in uniq_A:
        if ok_flag[a]:
            if c[a] == 1:
                ans += 1

            for i in range((_max - 1) // a + 1):
                ok_flag[a*i] = False
    
    print(ans)

if __name__ == '__main__':
    main()
### BUGGY CODE ###

N ,Q = map(int, input().split())
S = input()
    
def countAC(S, r, l):
    data = S[r-1:l]
    cnt = 0
    for i in range(len(data)-1):
        if data[i]=='A':
            if data[i+1] == 'C':
                cnt+=1
    return cnt
  
ret = []

for i in range(Q):
    r, l = map(int, input().split())
    cnt = countAC(S, r, l)
    ret.append(str(cnt))
print('\n'.join(ret))

### FIXED CODE ###

N ,Q = map(int, input().split())
S = input()

cumul = [0]*len(S)
cnt = 0
for i in range(len(S)-1):
    cumul[i] = cnt
    if S[i]=='A':
        if S[i+1] == 'C':
            cnt+=1
cumul[-1]=cnt

ret = []
for i in range(Q):
    l, r = map(int, input().split())
    cnt = cumul[r-1] - cumul[l-1]
    ret.append(str(cnt))
print('\n'.join(ret))
### BUGGY CODE ###

def main():
    N, Q = map(int, input().split())
    d = {}
    for _ in range(N-1):
        a, b = map(int, input().split())
        if a in d:
            d[a].append(b)
        else:
            d[a] = [b]
        if b in d:
            d[b].append(a)
        else:
            d[b] = [a]
    dc = {}
    for _ in range(Q):
        p, x = map(int, input().split())
        if p in dc:
            dc[p] += x
        else:
            dc[p] = x
    v = set()
    vr = set(range(1,N+1))
    l = [0] * N
    n = [(1,0)]
    c = []
    while v != vr:
        for i, j in n:
            v.add(i)
            if i in dc:
                j += dc[i]
            l[i-1] = j
            for k in d[i]:
                if k not in v:
                    c.append((k, j))
        n = c
        c = []
    return ' '.join(str(i) for i in l)

print(main())


### FIXED CODE ###

def main():
    N, Q = map(int, input().split())
    d = {}
    for _ in range(N-1):
        a, b = map(int, input().split())
        if a in d:
            d[a].append(b)
        else:
            d[a] = [b]
        if b in d:
            d[b].append(a)
        else:
            d[b] = [a]
    dc = {}
    for _ in range(Q):
        p, x = map(int, input().split())
        if p in dc:
            dc[p] += x
        else:
            dc[p] = x
    v = set()
    vr = set(range(1,N+1))
    l = [0] * N
    n = [(1,0)]
    c = []
    while v != vr:
        for i, j in n:
            v.add(i)
            if i in dc:
                j += dc[i]
            l[i-1] = j
            for k in d[i]:
                if k not in v:
                    c.append((k, j))
        n = c
        c = []
    return ' '.join(str(i) for i in l)

print(main())
### BUGGY CODE ###

s = input()
l = input()
     
count = 0
ind = -1
if set(l).issubset(set(s)):
    for i in range(len(l)):
        ind = s.find(l[i], ind+1)
        if ind == -1:
            count += 1
            ind = s.find(l[i], ind+1)
    print(count*len(s) + ind+1)
 
else:
    print(-1)

### FIXED CODE ###

s = input()
l = input()
     
count = 0
ind = -1
if set(l).issubset(set(s)):
    for i in range(len(l)):
        ind = s.find(l[i], ind+1)
        if ind == -1:
            count += 1
            ind = s.find(l[i], ind+1)
    print(count*len(s) + ind+1)
 
else:
    print(-1)
### BUGGY CODE ###

# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math


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

now,cnt = 1,0
Nums = []
for i in range(N):
    if S[i] == str(now):
        cnt += 1
    else:
        Nums.append(cnt)
        cnt = 1
        now = 1 - now

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

if len(Nums)%2==0:
    Nums.append(0)

#累積和
ans = 0
Add = 2*K+1
for i in range(N):
    if i%2==0:
        left = i
        right = i+Add
        tmp = sum(Nums[left:right])
        ans = max(tmp,ans)
print(ans)


### FIXED CODE ###

# encoding:utf-8
import copy
import numpy as np
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import math


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

now,cnt = 1,0
Nums = []
for i in range(N):
    if S[i] == str(now):
        cnt += 1
    else:
        Nums.append(cnt)
        cnt = 1
        now = 1 - now

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

if len(Nums)%2==0:
    Nums.append(0)

#累積和
Sums = [0]
tmp = 0
for i in range(len(Nums)):
    tmp += Nums[i]
    Sums.append(tmp)
# print(Nums)
# print(Sums)
ans = 0
Add = 2*K+1
for i in range(len(Sums)):
    if i%2==0:
        left = i
        right = min(i+Add,len(Sums)-1)
        tmp = Sums[right]-Sums[left]
        ans = max(tmp,ans)
print(ans)
### BUGGY CODE ###

s = input()
k = int(input())

k_list = set() 
for i in range(1, len(s)+1):
    for j in range(len(s)+1-i):
        sub = s[j:j+i]
        k_list.add(sub)
k_list = list(k_list)
k_list.sort()
print(k_list[k-1])

### FIXED CODE ###

s = input()
k = int(input())

kn = len(s) * k
k_list = set(s)

for i in range(2, k+1):
    for j in range(len(s)):
        k_list.add(s[j:j+i])

k_list = list(k_list)
k_list.sort()
print(k_list[k-1])
### BUGGY CODE ###

#imos法で更新を繰り返す
#log回で終わる
from itertools import accumulate
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(k):
    b=[0]*n
    for i in range(n):
        b[max(0,i-a[i])]+=1
        if i+a[i]+1<n:
            b[i+a[i]+1]-=1
    #print(b)
    a=list(accumulate(b))
    if a==[n]*n:
        break
print(" ".join(map(str,a)))

### FIXED CODE ###

#imos法で更新を繰り返す
#log回で終わる
from itertools import accumulate
n,k=map(int,input().split())
a=list(map(int,input().split()))
for _ in range(k):
    b=[0]*n
    for i in range(n):
        b[max(0,i-a[i])]+=1
        if i+a[i]+1<n:
            b[i+a[i]+1]-=1
    a=list(accumulate(b))
    if a==[n]*n:
        break
    #print(a)
print(" ".join(map(str,a)))
### BUGGY CODE ###

# 初期入力
N,A,B = (int(x) for x in input().split(" "))

# 赤と青を並べる
retu = ""
for j in range(N//(A +B) + 1):
    for i in range(A):
        retu += "b"
    for i in range(B):
        retu += "r"

b_num = retu[:N].count("b")
print(b_num)

### FIXED CODE ###

# 初期入力
N,A,B = map(int, input().split(" "))

# 青A個と赤Bを並べると、A+Bの組み合わせが何個あるか
kanz = N//(A+B) *A

# 余りを考える
saigo = min(N%(A+B),A)
print(kanz + saigo)
### BUGGY CODE ###

n, m = map(int,input().split())

l,r=map(int, input().split())

test = set([j for j in range(l,r+1)])

for i in range(1, m):
    l,r=map(int, input().split())
    test_1 = set([j for j in range(l,r+1)])
    test = test & test_1
print(len(list(test)))

### FIXED CODE ###

n, m = map(int,input().split())

list_left = []
list_right = []
for i in range(m):
    l,r=map(int, input().split())
    list_left.append(l)
    list_right.append(r)
test=[i for i in range(max(list_left),min(list_right)+1)]
print(len(test))