Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

isBigger = A[0] < A[1] 
isEqual = A[0] == A[1]
ans = 0
for i in range(1,N):
    if isEqual:
        if A[i] < A[i-1]:
            isBigger = False
            isEqual = False
        elif A[i-1] < A[i]:
            isBigger = True
            isEqual = False
        else:
            continue
    elif isBigger:
        if A[i] < A[i-1]:
            ans += 1
            if i < N-1:
                isBigger = A[i] < A[i+1]
                isEqual = A[i] == A[i+1]
            else:
                break
    else:
        if A[i-1] < A[i]:
            ans += 1
            if i < N-1:
                isBigger = A[i] < A[i+1]
                isEqual = A[i] == A[i+1]
            else:
                break

ans += 1
print(ans)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))

ans = 0
if 2 <= N:
    isBigger = A[0] < A[1] 
    isEqual = A[0] == A[1]
    for i in range(1,N):
        if isEqual:
            if A[i] < A[i-1]:
                isBigger = False
                isEqual = False
            elif A[i-1] < A[i]:
                isBigger = True
                isEqual = False
            else:
                continue
        elif isBigger:
            if A[i] < A[i-1]:
                ans += 1
                if i < N-1:
                    isBigger = A[i] < A[i+1]
                    isEqual = A[i] == A[i+1]
                else:
                    break
        else:
            if A[i-1] < A[i]:
                ans += 1
                if i < N-1:
                    isBigger = A[i] < A[i+1]
                    isEqual = A[i] == A[i+1]
                else:
                    break

ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
lst = [list(map(int,input().split())) for i in range(N)]
lst.reverse()
ans = 0
for A,B in lst:
    while (A+ans)%B != 0:
        ans += 1
print(ans)

Fixed submission:
N = int(input())
lst = [list(map(int,input().split())) for i in range(N)]
lst.reverse()
ans = 0
for A,B in lst:
    if (A+ans)%B != 0:
        ans += B-(A+ans)%B
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())

def solve():
  md = 2019
  for i in range(l, r+1):
    for j in range(i+1, r+1):
      md = min((i * j) % 2019, md)
  return md

print(solve())

Fixed submission:
l, r = map(int, input().split())

if r - l > 2019:
  l = 0
  r = 2018
  
def solve():
  md = 2019
  for i in range(l, r+1):
    for j in range(i+1, r+1):
      md = min((i * j) % 2019, md)
  return md

print(solve())
Buggy python submission (verdict: Runtime Error):
n = int(input())
heights = list(map(int, input().split()))

def nextgen(comb):
    lis = comb[0]
    j = comb[1]
    for i in range(len(lis)-1):
        if (i != len(lis) and (lis[i] == 0 and lis[i+1] != 0)) or (i == 0 and lis[i] != 0):
            j += 1
        if lis[i] != 0:
            lis[i] -= 1
    if lis[len(lis)-1] != 0:
        lis[len(lis)-1] -= 1
    return [lis, j]

comb = [heights, 0]
while (comb[0].count(0) != len(comb[0])):
    comb = test(comb)

print(comb[1])

Fixed submission:
n = int(input())
heights = list(map(int, input().split()))

def nextgen(comb):
    lis = comb[0]
    j = comb[1]
    if len(lis) == 1 and lis[0] != 0:
        j += 1  
    for i in range(len(lis)-1):
        if (i != len(lis) and (lis[i] == 0 and lis[i+1] != 0)) or (i == 0 and lis[i] != 0):
            j += 1
        if lis[i] != 0:
            lis[i] -= 1
    if lis[len(lis)-1] != 0:
        lis[len(lis)-1] -= 1
    return [lis, j]

comb = [heights, 0]
while (comb[0].count(0) != len(comb[0])):
    comb = nextgen(comb)

print(comb[1])
Buggy python submission (verdict: Runtime Error):
from IPython.utils.sysinfo import num_cpus
from site import abs_paths
nums = input()
length = len(nums)

num = int(nums[:3])
dif = abs(num - 753)

for i in range(1, length - 2):
   num_ = int(nums[i:i+3])
   dif_ = abs(num_ - 753)
   if dif_ < dif:
       num = num_
       dif = dif_

print(dif)


Fixed submission:
nums = input()
length = len(nums)

num = int(nums[:3])
dif = abs(num - 753)

for i in range(1, length - 2):
   num_ = int(nums[i:i+3])
   dif_ = abs(num_ - 753)
   if dif_ < dif:
       num = num_
       dif = dif_

print(dif)
Buggy python submission (verdict: Runtime Error):
n = int(input())

hints = []
for i in range(n):
    x, y, h = map(int, input().split())
    hints.append([x, y, h])

def height(center , point):
    if point[2] == 0:
        return 0
    else:
        return point[2] + abs(point[0] - center[0]) + abs(point[1] - center[1])

for i in range(101):
    for j in range(101):
        cent = [i, j]
        hmax = height(cent, hints[0])
        k = 1
        while ((k < n) and (hmax == height(cent, hints[k]) or height(cent, hints[k]) == 0 or hmax == 0)):
            if (hmax == 0 and height(cent, hints[k]) != 0):
                hmax = height(cent, hints[k])
            k += 1
        #print(cent)
        #print(k)
        #print (hmax)
        if k == n:
            break
        else:
            continue
    if k == n:
        break

print("{} {} {}".format(cent[0], cent[1], hmax))

Fixed submission:
n = int(input())

if n == 1:
    print("Hello World")

else:
    a = int(input())
    b = int(input())

    print(a+b)
Buggy python submission (verdict: Runtime Error):
n, tm = map(int, input().split())
ctl = []
for i in range(n):
    c, t = map(int, input().split())
    ctl.append([c, t])

filctl = []
for elm in ctl:
    if elm[1] <= tm:
        filctl.append(elm)

filctl = sorted(filctl)
print((filctl[0])[0])

Fixed submission:
n, tm = map(int, input().split())
ctl = []
for i in range(n):
    c, t = map(int, input().split())
    ctl.append([c, t])

filctl = []
for elm in ctl:
    if elm[1] <= tm:
        filctl.append(elm)
if len(filctl) != 0:
    filctl = sorted(filctl)
    print((filctl[0])[0])
else:
    print("TLE")

Buggy python submission (verdict: Runtime Error):
n, tm = map(int, input().split())
ctl = []
for i in range(n):
    c, t = map(int, input().split())
    ctl.append([c, t])

filctl = []
for elm in ctl:
    if elm[1] <= tm:
        filctl.append(elm)

filctl = sorted(filctl)
print(filctl[0])

Fixed submission:
n, tm = map(int, input().split())
ctl = []
for i in range(n):
    c, t = map(int, input().split())
    ctl.append([c, t])

filctl = []
for elm in ctl:
    if elm[1] <= tm:
        filctl.append(elm)
if len(filctl) != 0:
    filctl = sorted(filctl)
    print((filctl[0])[0])
else:
    print("TLE")
Buggy python submission (verdict: Runtime Error):
x, a, b = map(int, input().split())
print(x - a - b)

Fixed submission:
x = int(input())
a = int(input())
b = int(input())
print((x - a) % b)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input(),split())
print(c,a,b)

Fixed submission:
a,b,c = map(int,input().split())
print(c,a,b)
Buggy python submission (verdict: Time Limit Exceeded):
a = list(input())
for i in range(int(input())):
  b = input().split()
  if b[0] == "1":
    a = a[::-1]
  else:
    if b[1] == "1":
      a.insert(0,b[2])
    else:
      a.append(b[2])
print("".join(a))

Fixed submission:
from collections import deque
a = list(input())
a = deque(a)
re = 0
for i in range(int(input())):
  b = input().split()
  if b[0] == "1":
    re = (re+1)%2
  else:
    if (re and b[1] == "2") or (not(re) and b[1] == "1"):
      a.appendleft(b[2])
    else:
      a.append(b[2])
a = list(a)
if re:
  a = a[::-1]
print("".join(a))
Buggy python submission (verdict: Runtime Error):
n,p = map(int,input().split())
a = list(map(int,list(input())))
ans = 0
if p == 2:
  for i in range(n):
    if a[i]%2==0:
      ans += i+1
elif p == 5:
  for i in range(n):
    if a[i]==5 or a[i]==0:
      ans += i+1
else:
  b = 0
  c = [0 for i in range(p)]
  c[0] = 1
  for i in range(n):
    b = (b[i]+pow(a[i],n-i,p))%p
    c[b] += 1
c = list(map(lambda x:x*(x+1)//2,c))
ans = sum(c)
print(ans)
    


  

Fixed submission:
n,p = map(int,input().split())
a = list(map(int,list(input())))
ans = 0
if p == 2:
  for i in range(n):
    if a[i]%2==0:
      ans += i+1
elif p == 5:
  for i in range(n):
    if a[i]==5 or a[i]==0:
      ans += i+1
else:
  b = 0
  c = [0 for i in range(p)]
  c[0] = 1
  for i in range(n):
    b = (b+pow(10,n-i,p)*a[i])%p
    c[b] += 1
  c = list(map(lambda x:x*(x-1)//2,c))
  ans = sum(c)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print(a*b//math.gcd(a,b))

Fixed submission:
import fractions
a,b = map(int,input().split())
print(a*b//fractions.gcd(a,b))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input()).split()
ans = 0
for i in range(1,a+1):
  c = 0
  bai = b/i
  while bai > 1:
    bai /= 2
    c += 1
  ans += 1/(2**c)
print(ans/a)

    
  

Fixed submission:
a,b = map(int,input().split())
ans = 0
for i in range(1,a+1):
  c = 0
  bai = b/i
  while bai > 1:
    bai /= 2
    c += 1
  ans += 1/(2**c)
print(ans/a)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = list(input())
c = int(input())
for i in range(a):
  if b[i] != b[c]:
    b[i] = "*"
print("".join(b))
    


Fixed submission:
a = int(input())
b = list(input())
c = int(input())
for i in range(a):
  if b[i] != b[c-1]:
    b[i] = "*"
print("".join(b))

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = input()
c = int(input())
for i in range(a):
  if b[i] != b[c]:
    b[i] = "*"
print(b)
    

Fixed submission:
a = int(input())
b = list(input())
c = int(input())
for i in range(a):
  if b[i] != b[c-1]:
    b[i] = "*"
print("".join(b))
Buggy python submission (verdict: Runtime Error):
a = list(input())
for i in range(3):
  if a[i] = "1":
    a[i] = "9"
  else:
    a[i] = "1"
print("".join(a))


Fixed submission:
a = list(input())
for i in range(3):
  if a[i] == "1":
    a[i] = "9"
  else:
    a[i] = "1"
print("".join(a))

Buggy python submission (verdict: Runtime Error):
a = list(input())
for i in range(3):
  if a[i] = "1":
    a[i] = 9
  else:
    a[i] = 1
print("".join(a))

Fixed submission:
a = list(input())
for i in range(3):
  if a[i] == "1":
    a[i] = "9"
  else:
    a[i] = "1"
print("".join(a))
Buggy python submission (verdict: Runtime Error):
print(input()[::int(input())-1])

Fixed submission:
a = list(input())
b = int(input())
print("".join(a[::b]))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [list(map(int,input().split()))]
ans = 0
for i in range(n):
  k = sum(a[0][i:])+sum(a[1][0:i+1])
  if k > ans:
    ans = k
print(ans)

Fixed submission:
n = int(input())
a = [list(map(int,input().split())) for i in range(2)]
ans = 0
for i in range(n):
  k = sum(a[1][i:])+sum(a[0][0:i+1])
  if k > ans:
    ans = k
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]
a.insert([0,0,0])
ans = True
for i in range(1,n+1):
  t = a[i][0]-a[i-1][0]
  xy = a[i][1]+a[i][2]-a[i-1][1]-a[i-1][2]
  if not (t >= xy and t%2 == xy%2):
    ans = False
    break
print("Yes" if ans else "No")
   
  

Fixed submission:
n = int(input())
a = [list(map(int,input().split())) for i in range(n)]
a.insert(0,[0,0,0])
ans = True
for i in range(1,n+1):
  t = a[i][0]-a[i-1][0]
  xy = a[i][1]+a[i][2]-a[i-1][1]-a[i-1][2]
  if not (t >= xy and t%2 == xy%2):
    ans = False
    break
print("Yes" if ans else "No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
b = list(input())
ans = True
for i in range(a+b+1):
  if not((i==a and b[i]=="-") or (i!=a and b[i]!="-")):
    ans = False
    break
print("Yes" if ans else "No")

Fixed submission:
a,b = map(int,input().split())
c = list(input())
ans = True
for i in range(a+b+1):
  if not((i==a and c[i]=="-") or (i!=a and c[i]!="-")):
    ans = False
    break
print("Yes" if ans else "No")
Buggy python submission (verdict: Runtime Error):
a = list("ABCDEF")
x,y = map(int,input().split())
x = a.index(x)
y = a.index(y)
if x < y:
  print("<")
elif x > y:
  print(">")
else:
  print("=")

Fixed submission:
a = list("ABCDEF")
x,y = input().split()
x = a.index(x)
y = a.index(y)
if x < y:
  print("<")
elif x > y:
  print(">")
else:
  print("=")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print(a+(b-a)*2)

Fixed submission:
a = int(input())
b = int(input())
print(a+(b-a)*2)
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
n = int(input())
a = list(map(int,input().split()))
h = Decimal(str(sum(a)/n).quantize(Decimal('0'), rounding=ROUND_HALF_UP))
a = list(map(lambda x:(x-h)**2,a))
print(sum(a))

Fixed submission:
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
n = int(input())
a = list(map(int,input().split()))
h = Decimal(str(sum(a)/n)).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
a = list(map(lambda x:(x-h)**2,a))
print(sum(a))
Buggy python submission (verdict: Runtime Error):
import typing


class DSU:
    '''
    Implement (union by size) + (path compression)
    Reference:
    Zvi Galil and Giuseppe F. Italiano,
    Data structures and algorithms for disjoint set union problems
    '''

    def __init__(self, n: int = 0):
        self._n = n
        self.parent_or_size = [-1] * n

    def merge(self, a: int, b: int) -> int:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        x = self.leader(a)
        y = self.leader(b)

        if x == y:
            return x

        if -self.parent_or_size[x] < -self.parent_or_size[y]:
            x, y = y, x

        self.parent_or_size[x] += self.parent_or_size[y]
        self.parent_or_size[y] = x

        return x

    def same(self, a: int, b: int) -> bool:
        assert 0 <= a < self._n
        assert 0 <= b < self._n

        return self.leader(a) == self.leader(b)

    def leader(self, a: int) -> int:
        assert 0 <= a < self._n

        if self.parent_or_size[a] < 0:
            return a

        self.parent_or_size[a] = self.leader(self.parent_or_size[a])
        return self.parent_or_size[a]

    def size(self, a: int) -> int:
        assert 0 <= a < self._n

        return -self.parent_or_size[self.leader(a)]

    def groups(self) -> typing.List[typing.List[int]]:
        leader_buf = [self.leader(i) for i in range(self._n)]

        result = [[] for _ in range(self._n)]
        for i in range(self._n):
            result[leader_buf[i]].append(i)

        return list(filter(lambda r: r, result))

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

uf = DSU(N)
merge = uf.merge
same = uf.same

for i in range(M):
    a,b = map(int, input().split())
    merge(a,b)


print(len(uf.groups())-1)

Fixed submission:

class UnionFind:
    def __init__(self, N):
        self.root = list(range(N + 1))
        self.size = [1] * (N + 1)

    def __getitem__(self, x):
        root = self.root
        while root[x] != x:
            root[x] = root[root[x]]
            x = root[x]
        return x

    def merge(self, x, y):
        x = self[x]
        y = self[y]
        if x == y:
            return
        sx, sy = self.size[x], self.size[y]
        if sx < sy:
            x, y = y, x
            sx, sy = sy, sx
        self.root[y] = x
        self.size[x] += sy

    def same(self,x,y):
        return  self[x] == self[y]

    def find_max(self):
        return max(self.size)

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

uf = UnionFind(N)
merge = uf.merge
same = uf.same

for i in range(M):
    a,b = map(int, input().split())
    merge(a,b)
count = -1
for ind,j in enumerate(uf.root):
    if ind == j:
        count += 1

print(count -1)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(4100000)

N = int(input())
A = list(map(int, input().split()))
pricelist = []


def dfs(day, money,stock):
    if day == N:
        pricelist.append(money+ stock * A[N-1])
        return
    price = A[day-1]
    dfs(day+1, money % price, stock + money//price)
    dfs(day+1, money, stock)
    dfs(day+1, money + stock * price, 0)
    return

dfs(1,1000,0)

print(max(pricelist))




Fixed submission:
N = int(input())
A = list(map(int, input().split()))
money = 1000
for i in range(N-2):
    today, tomorrow = A[i], A[i+1]
    if today < tomorrow:
        money = (money//today)*tomorrow + money%today
if A[N-2]< A[N-1]:
    money = (money//A[N-2]) * A[N-1] + money%A[N-2]

print(money)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
DP = [[-1 for _1 in range(10000)] for _ in range(N) ]

for i in range(1000//A[0]+1):
    DP[0][i] = 1000 - A[0]*i

max_stock = 1000//A[0]
for j in range(1, N):
    today = A[j]
    DP[j][0] = max(DP[j-1][0], DP[j-1][max_stock] + max_stock*today)
    max_stock = DP[j-1][0]//today
    DP[j][max_stock] =  DP[j-1][0] - max_stock*today




print(DP[N-1][0])

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
money = 1000
for i in range(N-2):
    today, tomorrow = A[i], A[i+1]
    if today < tomorrow:
        money = (money//today)*tomorrow + money%today
if A[N-2]< A[N-1]:
    money = (money//A[N-2]) * A[N-1] + money%A[N-2]

print(money)
Buggy python submission (verdict: Runtime Error):
N = int(input())
arr = [0]*(N)
lim = int(N**0.5 + 1)
for i in range(1,lim):
    for j in range(1,lim):
        for k in range(1,lim):
            num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1
            if num <= N:
                arr[num] += 1

print(*arr, sep='\n')



Fixed submission:
N = int(input())
arr = [0]*(N)
lim = int(N**0.5 + 1)
for i in range(1,lim):
    for j in range(1,lim):
        for k in range(1,lim):
            num = i**2 + j**2 + k**2 + i*j + j*k + k*i - 1
            if num <= N-1:
                arr[num] += 1

print(*arr, sep='\n')
Buggy python submission (verdict: Runtime Error):
N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

dp = [[-1 for _1 in range(N+1)] for _2 in range(M+1)]
dp[0][0] = 0
for i in range(N):
    dp[0][i+1] = dp[0][i] + A[i]
for j in range(M):
    dp[j+1][0] = dp[j][0] + B[j]
#print(dp)
for m in range(1,M+1):
    for n in range(1,N+1):
        dp[m][n] = dp[m][0] + dp[0][n]
#print(dp)
ans = 0
for a in range(N+M+1):
    for b in range(a+1):
        #print(a,b,dp[M-a+b][N-b])
        if dp[M-a+b][N-b] <= K:
            ans =N+M -a
            print(ans)
            exit()


Fixed submission:
import numpy as np
N,M,K = map(int, input().split())
a = np.array([0] + list(map(int, input().split())),dtype=np.int64)
b = np.array([0] + list(map(int, input().split())),dtype=np.int64)

asum = a.cumsum()
bsum = b.cumsum()

ans = 0
for ind,i in enumerate(asum):
    if i>K:
        break
    mx = np.searchsorted(bsum, K-i ,side='right') - 1
    ans = max(ans, ind + mx,)

print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import njit


@njit('(i8)', cache=True)
def solve(x):
    count = np.zeros(x + 1, dtype=np.int64)
    for i in range(1, x + 1):
        for j in range(i, x + 1, i):
            count[j] += j
    return count.sum()


if __name__ == "__main__":
    x = int(input())
    print(solve(x))



Fixed submission:
import numpy as np
from numba import *

@njit('i8(i8,i8[:])', cache=True)
def solve(x,count):
    for i in range(2,x+1):
        for j in range(i,x+1,i):
            count[j] += 1
    return int(np.sum(np.arange(x+1)*count))

if __name__== "__main__":
    x = int(input())
    count = np.ones(x + 1, dtype=np.int64)
    print(solve(x,count))

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import njit
 
@njit('i8(i8)', cache=True)
def solve(x):
    count = np.ones(x + 1, dtype=np.int8)
    for i in range(2,x+1):
        for j in range(i,x+1,i)
            count[j] += 1
    return int(np.sum(np.arange(x + 1) * count))
 
if __name__== "__main__":
    x = int(input())
    print(solve(x))

Fixed submission:
import numpy as np
from numba import *

@njit('i8(i8,i8[:])', cache=True)
def solve(x,count):
    for i in range(2,x+1):
        for j in range(i,x+1,i):
            count[j] += 1
    return int(np.sum(np.arange(x+1)*count))

if __name__== "__main__":
    x = int(input())
    count = np.ones(x + 1, dtype=np.int64)
    print(solve(x,count))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numba import njit

@njit('i8(i8,i8[:])', cache=True)
def solve(x,count):
    for i in range(2,x+1):
        count[i:x+1:i] += 1
    return int(np.sum(np.arange(x + 1) * count))

if __name__== "__main__":
    x = int(input())
    count = np.ones(x + 1, dtype=np.int64)
    print(solve(x,count))

Fixed submission:
import numpy as np
from numba import *

@njit('i8(i8,i8[:])', cache=True)
def solve(x,count):
    for i in range(2,x+1):
        for j in range(i,x+1,i):
            count[j] += 1
    return int(np.sum(np.arange(x+1)*count))

if __name__== "__main__":
    x = int(input())
    count = np.ones(x + 1, dtype=np.int64)
    print(solve(x,count))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numba import *

@njit('i8(i8,i8[:],i8[:])', cache=True)
def solve(x,nums, count):
    for i in range(2,x+1):
        count[np.arange(i,x+1,i)] += 1
    count[0] = 0
    return int(np.sum(nums*count))

if __name__== "__main__":
    x = int(input())
    nums = np.arange(x + 1, dtype=np.int64)
    count = np.ones(x + 1, dtype=np.int64)
    print(solve(x,nums,count))

Fixed submission:
import numpy as np
from numba import *

@njit('i8(i8,i8[:])', cache=True)
def solve(x,count):
    for i in range(2,x+1):
        for j in range(i,x+1,i):
            count[j] += 1
    return int(np.sum(np.arange(x+1)*count))

if __name__== "__main__":
    x = int(input())
    count = np.ones(x + 1, dtype=np.int64)
    print(solve(x,count))
Buggy python submission (verdict: Runtime Error):
def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    
    for i in range(K):
        
        arr = [0] * (N + 1)

        for ind,j in enumerate(A):
            arr[max(ind-j,0)] += 1
            arr[min(ind+j+1, N)] -= 1

        A[0] = arr[0]
        for k in range(N-1):
            A[k+1] = A[k] + arr[k+1]

        if arr[0] ==N and arr[-1] == -N:
            return A
    return A


if __name__ == "__main__":
    ans = solve()
    print(*ans)



Fixed submission:
def solve():
    S = input()
    print(S[:3])


if __name__ == "__main__":
    solve()