Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
import fraction
g = fraction.gcd(a,b)

print(round(a*b/g))

Fixed submission:
a,b = map(int,input().split())
import fractions
g = fractions.gcd(a,b)

print(round(a*b/g))

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
import math
g = math.gcd(a,b)

print(round(a*b/g))

Fixed submission:
a,b = map(int,input().split())
import fractions
g = fractions.gcd(a,b)

print(round(a*b/g))

Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
g = math.gcd(a,b)

print(round(a*b/g))

Fixed submission:
a,b = map(int,input().split())
import fractions
g = fractions.gcd(a,b)

print(round(a*b/g))
Buggy python submission (verdict: Runtime Error):
import sys
a,b,x = map(int,input().split())

def bisect(M,m):
    while(abs(M-m)>1):
        mid = (M+m)//2
        if a*mid + b*len(str(mid)) <= x:
            m = mid
        else:
            M = mid
            
    return m
print(bisect(10**9+1,0))

Fixed submission:
s = input()
l = ['SUN','MON','TUE','WED','THU','FRI','SAT']
i = 7-l.index(s)
print(i)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(1,n+1):
    b += [a.index(i)+ 1]
print(*b)

Fixed submission:
import numpy 
n = int(input())
a = list(map(int,input().split()))

print(*numpy.argsort(a)+1)

Buggy python submission (verdict: Time Limit Exceeded):
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 submission:
import numpy 
n = int(input())
a = list(map(int,input().split()))

print(*numpy.argsort(a)+1)

Buggy python submission (verdict: Time Limit Exceeded):
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 submission:
import numpy 
n = int(input())
a = list(map(int,input().split()))

print(*numpy.argsort(a)+1)
Buggy python submission (verdict: Runtime Error):
s=sorted(input())
s.replace(s[0],"").replace(s[2],"")

print(s)
                       

Fixed submission:
c = 0 ; a = []

s = input()

for i in range(4):
    if s[i] not in  a:
        a.append(s[i])
    else:
        c += 1
    
if len(a) == 2 and c == 2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
A = [map(int,input().split()) for i in range(1)]

A.sort()

print(A[0]+A[1])





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

A.sort()

print(A[0]+A[1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
s = list(s)
k = int(input())
word = s[k]
for i in range(n):
    if s[i] != word:
        s[i] = "*"
print("".join(s))

Fixed submission:
n = int(input())
s = input()
s = list(s)
k = int(input())
word = s[k-1]
for i in range(n):
    if s[i] != word:
        s[i] = "*"
print("".join(s))
Buggy python submission (verdict: Runtime Error):
s = input()
a = ['A','T','G','C']
ans = []
c = 0

for i in s:
    if i in a:
        c += 1
    else:
        ans += [c]
        c = 0
print(max(ans))

Fixed submission:
s = input()
a = ['A','T','G','C']
ans = []
c = 0

for i in s:
    if i in a:
        c += 1
    else:
        ans += [c]
        c = 0
ans += [c]
if ans == []:
    print(len(s))
else:
    print(max(ans))

Buggy python submission (verdict: Runtime Error):
s = input() ; c = 0 ; l = []

for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        c += 1
    if i != 'A' and i != 'T' and i != 'G' and i != 'C':
        l.append(c)
        c = 0
        
print(max(l))
            

Fixed submission:
s = input()
a = ['A','T','G','C']
ans = []
c = 0

for i in s:
    if i in a:
        c += 1
    else:
        ans += [c]
        c = 0
ans += [c]
if ans == []:
    print(len(s))
else:
    print(max(ans))

Buggy python submission (verdict: Runtime Error):
s = input() ; c = 0 ; l = []

for i in s:
    if i == 'A' or i == 'T' or i == 'G' or i == 'C':
        c += 1
    if i != 'A' and i != 'T' and i != 'G' and i != 'C':
        l.append(c)
        c = 0
        
print(l(max))
            

Fixed submission:
s = input()
a = ['A','T','G','C']
ans = []
c = 0

for i in s:
    if i in a:
        c += 1
    else:
        ans += [c]
        c = 0
ans += [c]
if ans == []:
    print(len(s))
else:
    print(max(ans))
Buggy python submission (verdict: Runtime Error):
n,t = map(int,input().split())
cost = []
time = []
ncost = []
for i in range(n):
    c,T = input().split()
    cost.append(int(c))
    time.append(int(T))

    
for i in range(n):
    if time[i] <= t:
        ncost.append(cost[i])
    elif all(time) > t:
        print('TLE')
    else:
        pass
    
print(min(ncost))
    


Fixed submission:
n,t = map(int,input().split())
cost = []
time = []
ncost = []
f = 0
e = 0
for i in range(n):
    c,T = input().split()
    cost.append(int(c))
    time.append(int(T))

for i in time:
    if i > t:
        e += 1
    
if e == n:
    print('TLE')
    
for i in range(n):
    if time[i] <= t:
        ncost.append(cost[i])
        f = 1
    else:
        pass
if  f == 1:
    print(min(ncost))
Buggy python submission (verdict: Runtime Error):
s = input()
s[3] = '8'

print(s)

Fixed submission:
s = input()
s = list(s)
s[3] = '8'

s = ''.join(s)

print(s)
Buggy python submission (verdict: Time Limit Exceeded):
#ABC 085C
import sys
f = 1
n,y = map(int,input().split())
for s in range(2001):
    for t in range(2001):
        for z in range(2001):
            if y-(10000*s+5000*t+1000*z) == 0 and s+t+z == n  :
                print(s,t,z)
                f = 0
                sys.exit()
if f == 1:
    print(-1,-1,-1)

Fixed submission:
N,Y = map(int,input().split())
f = 0
loop = 0

for x in range(2001):
    for y in range(2001):
        z = N - x - y
        if 10000*x + 5000*y + 1000*z == Y and z >= 0:
            print(x,y,z)
            f = 1
            loop = 1
            break
    if loop == 1:
        break
if f == 0:
    print('-1','-1','-1')

Buggy python submission (verdict: Time Limit Exceeded):
N,Y = map(int,input().split())
f = 0

for x in range(2001):
    for y in range(4001):
        for z in range(20001):
            if 10000*x + 5000*y + 1000*z == Y and x + y + z == N:
                print(x,y,z)
                f = 1
                break
        else:
            break
    else:
        break
        
if f == 0:
    print('-1','-1','-1')

Fixed submission:
N,Y = map(int,input().split())
f = 0
loop = 0

for x in range(2001):
    for y in range(2001):
        z = N - x - y
        if 10000*x + 5000*y + 1000*z == Y and z >= 0:
            print(x,y,z)
            f = 1
            loop = 1
            break
    if loop == 1:
        break
if f == 0:
    print('-1','-1','-1')
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
res = 0
for i in range(N+1):
    if A <= sum([int(s) for s in str(i)]) <= B:
        res += i
print(res)

Fixed submission:
a,b,c,d = map(int,input().split())

if a + b > c + d:
    print('Left')
elif a + b == c + d:
    print('Balanced')
else:
    print('Right')
Buggy python submission (verdict: Runtime Error):
n = int(input())
nums = list(map(int,input().split()))
ans = 0
while True:
    for i in range(n):
        if nums[i] % 2 == 0:
            nums[i] = nums[i] / 2
        else:
            break
    if nums[i] % 2 != 0:
      ans += 1
      print(ans)
      break   
    else:
      ans +=1


Fixed submission:
s = list(input())
c = 0


for i in range(3):
  if s[i] == '1':
    c += 1
   

print(c)

Buggy python submission (verdict: Runtime Error):
s=int(input())
s=str(s)
a=int(s[0]);b=int(s[1]);c=int(s[2])
sum=a+b+c

if sum == 0:
  print(0)
elif sum == 1:
  print(1)
elif sum == 2:
  print(2)
else:
  print(3)

Fixed submission:
s = list(input())
c = 0


for i in range(3):
  if s[i] == '1':
    c += 1
   

print(c)

Buggy python submission (verdict: Runtime Error):
s=int(input())
s=str(s)
a=int(s[0]);b=int(s[1]);c=int(s[2])
sum=a+b+c

if sum == 0:
  print('0')
elif sum == 1:
  print('1')
elif sum == 2:
  print('2')
else:
  print('3')

Fixed submission:
s = list(input())
c = 0


for i in range(3):
  if s[i] == '1':
    c += 1
   

print(c)
Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
nums = list(map(int,input().split()))
ans = 0
while True:
  for i in range(n):
    if nums[i] % 2 == 0:
      nums[i] = nums[i] / 2
    else:
      print(ans)
      break
  ans += 1

Fixed submission:
n = int(input())
A = [int(x) for x in input().split()]
c = 0

while all(a % 2 == 0 for a in A):
        A = [a / 2 for a in A]
        c += 1
            
print(c)
Buggy python submission (verdict: Runtime Error):
def s(n):
  s = 0
  for i in range(len(n)):
    s += int(s[i])
    
  return s

n = input()

if int(n) % s(n) == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
n = input()
N = int(n)
I = []

for i in range(len(n)):
    I = I + [int(n[i])]

S = sum(I)

if N % S == 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import sys
a,b,c,d= input()
for i in range(2**(len(op)-1)):
    op = ["+"]*3
    for j in range(len(op)-1):
        if (i >> j) & 1 == 1:
            op[j] = "-"
    if eval(a+op[0]+b+op[1]+c+op[2]+d) == 7:
        print(a+op[0]+b+op[1]+c+op[2]+d+'=7')
        sys.exit()

Fixed submission:
import sys
a,b,c,d = input()

for i in range(2**3):
    l = ['+','+','+']
    for j in range(3):
        if (i>>j) & 1 == 1:
            l[j] = '-'
    if eval(a+l[0]+b+l[1]+c+l[2]+d) == 7:
        print(a+l[0]+b+l[1]+c+l[2]+d+'=7')
        sys.exit()
Buggy python submission (verdict: Runtime Error):
r,g,b = input().split()

l = g*b

if int(l) % 4 == 0:
  print('YES')
else:
  print('NO')

Fixed submission:
r,g,b = input().split()

l = g+b

if int(l) % 4 == 0:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s += [int(input())]
a = sum(s)
if a % 10 != 0:
    print(a)
    exit()
else:
    for i in range(n):
        if s[i] % 10 != 0:
            a -= s[i]
        if a % 10 != 0:
            print(a)
            f = 0
            exit()
        else:
            f = 1
if f:
    print(0)

Fixed submission:
a,b = map(int,input().split())
s=a+b
if s >= 10:
  print('error')
else:
  print(s)
Buggy python submission (verdict: Runtime Error):
s = input()
s = sort.s

for i in range(1,len(s)):
    if s[i] == s[i-1]:
        print('no')
        exit()
print('yes')

Fixed submission:
s = input()
t = set(s)
if len(s) == len(t):
    print('yes')
else:
    print('no')
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s += [int(input())]

if sum(s) % 10 != 0:
    print(sum(s))
else:
    a = []
    for i in range(n):
        a += [s[i]]
        if a[i] % 10 != 0 and (sum(s) - sum(a)) % 10 != 0:
            print(sum(s) - sum(a))
            f = 0
            exit()
        else:
            f = 1
if f:
    print(0)

Fixed submission:
n = int(input())
s = []
for i in range(n):
    s += [int(input())]
s = sorted(s)
a = sum(s)
if a % 10 != 0:
    print(a)
    exit()
else:
    for i in range(n):
        if s[i] % 10 != 0:
            a -= s[i]
            if a % 10 != 0:
                print(a)
                f = 0
                exit()
        else:
            f = 1
if f:
    print(0)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = []
for i in range(n):
    s += [int(input())]

if sum(s) % 10 != 0:
    print(sum(s))
else:
    a = []
    for i in range(n):
        a += [s[i]]
        if (sum(s) - sum(a)) % 10 != 0:
            print(sum(s) - sum(a))
            f = 0
            exit()
        else:
            f = 1
if f:
    print(0)

Fixed submission:
n = int(input())
s = []
for i in range(n):
    s += [int(input())]
s = sorted(s)
a = sum(s)
if a % 10 != 0:
    print(a)
    exit()
else:
    for i in range(n):
        if s[i] % 10 != 0:
            a -= s[i]
            if a % 10 != 0:
                print(a)
                f = 0
                exit()
        else:
            f = 1
if f:
    print(0)
Buggy python submission (verdict: Runtime Error):
import sys

s = input()
c = 0
C = 0

for i in range(len(s)):
    if s[i] == 'A':
        while(s[i] != 'Z'):
            c += 1
            i += 1
        if s[i] == 'Z':
            i += 1
            c += 1
            if s[i] == 'Z':
                c += 1
                break
    else:
        continue
    break
            
print(c)

Fixed submission:
import sys

s = input()
c = 0
C = 0

for i in range(len(s)):
    if s[i] == 'A':
        break

for j in range(len(s)):
    if s[-j] == 'Z':
        break
print(len(s[i:len(s) - j + 1]))
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
c = 0

for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i+j+l == s:
                c += 1
print(c)

Fixed submission:
k,s = map(int,input().split())
c = 0

for y in range(k+1):
    for z in range(k+1):
        if 0 <= s-(y+z) <= k:
            c += 1
print(c)
Buggy python submission (verdict: Runtime Error):
c=input()
list=[a,i,u,e,o]
if c in list:
  print('vowel')
else:
  ('consonant')

Fixed submission:
c=input()
list=['a','i','u','e','o']
if c in list:
  print('vowel')
else:
  print('consonant')
Buggy python submission (verdict: Runtime Error):
result = 0;
for i in range(1,N+1):
    result += i
        
print(result)

Fixed submission:
N=int(input())
result = 0;
for i in range(1,N+1):
    result += i
        
print(result)

Buggy python submission (verdict: Runtime Error):
result = 0;
    for i in range(1,N+1):
        result += i
        
    print(result)

Fixed submission:
N=int(input())
result = 0;
for i in range(1,N+1):
    result += i
        
print(result)

Buggy python submission (verdict: Runtime Error):
for i in range(N):
    print(i)

Fixed submission:
N=int(input())
result = 0;
for i in range(1,N+1):
    result += i
        
print(result)

Buggy python submission (verdict: Runtime Error):
S=sum(N/2(N+1))
print(S)

Fixed submission:
N=int(input())
result = 0;
for i in range(1,N+1):
    result += i
        
print(result)

Buggy python submission (verdict: Runtime Error):
S=sum(N/2(N-1))
print(S)

Fixed submission:
N=int(input())
result = 0;
for i in range(1,N+1):
    result += i
        
print(result)
Buggy python submission (verdict: Runtime Error):
s = input()
t = ''

for i in range(len(s)):
  if s[i] == 'B':
    t = t[:-1]
  else:
    t += i
    
print(t)

Fixed submission:
s = input()
t = ''

for i in range(len(s)):
  if s[i] == 'B':
    t = t[:-1]
  else:
    t += s[i]
    
print(t)
Buggy python submission (verdict: Runtime Error):
A,B,C=map(int,input().split())
if A*B*C == 5*5*7
    print('YES')
else:
    print('NO')

Fixed submission:
A,B,C=map(int,input().split())
if A*B*C == 5*5*7:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Runtime Error):
A,B,C=map(int,input().split)
if A+B+C == 17:
  print('YES')
else:
  print('NO)

Fixed submission:
A,B,C=map(int,input().split())
if A*B*C == 5*5*7:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**6)

def main():
    N = int(input())
    def calcSumOfDigit(x,acc=0):
        if x == 0:
            return acc
        else:
            return calcSumOfDigit(x//10,acc+x%10)
    def judge(x):
        return x % 9 == 0
    print("Yes" if judge(calcSumOfDigit(N)) else "No")
    return


if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**6)

def main():
    N = int(input())
    def calcSumOfDigit(x):
        str_x = str(x)
        acc = 0
        for s in str_x:
            acc += int(s)
            acc %= 9
        return acc
    
    print("Yes" if calcSumOfDigit(N)==0 else "No")
    return


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    N = int(input())
    def calcSumOfDigit(x,acc=0):
        if x == 0:
            return acc
        else:
            return calcSumOfDigit(x//10,acc+x%10)
    def judge(x):
        return x % 9 == 0
    print("Yes" if judge(calcSumOfDigit(N)) else "No")
    return


if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3

import sys
sys.setrecursionlimit(10**6)

def main():
    N = int(input())
    def calcSumOfDigit(x):
        str_x = str(x)
        acc = 0
        for s in str_x:
            acc += int(s)
            acc %= 9
        return acc
    
    print("Yes" if calcSumOfDigit(N)==0 else "No")
    return


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def solve(n):
  l = [0]*(n+1)
  for i in range(1,n+1):
    for j in range(i,n+1,i):
      if j % i == 0:
        l[j] += 1
  s = 0
  for i in range(n):
    s += (i+1)*l[i+1]
  return s

def main():
  N = int(input())
  print(solve(N))
  return

main()

Fixed submission:
def solve(n):
  ans = 0
  for i in range(1,n+1):
    for j in range(i,n+1,i):
      if j % i == 0:
        ans += j
  return ans

def main():
  N = int(input())
  print(solve(N))
  return

main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    a = [0] + list(map(int,input().split()))
    d = [0] + [a.count(i+1) for i in range(10**5)]
    Q = int(input())
    s = sum(a)
    for _ in range(Q):
        B,C = map(int,input().split())
        if d[B] != 0:
            tmp = d[B]
            d[B] = 0
            d[C] += tmp
            s = s - tmp*B + tmp*C
        print(s)




if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
from collections import Counter

def main():
    N = int(input())
    a = list(map(int,input().split()))
    l = Counter(a)
    d = [0] + [l[i+1] for i in range(10**5)]
    Q = int(input())
    s = sum(a)
    for _ in range(Q):
        B,C = map(int,input().split())
        if d[B] != 0:
            tmp = d[B]
            d[B] = 0
            d[C] += tmp
            s = s - tmp*B + tmp*C
        print(s)




if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3

def main():
    N = int(input())
    a = [0] + list(map(int,input().split()))
    d = [0] + [a.count(i+1) for i in range(10**5)]
    Q = int(input())
    s = sum(a)
    for _ in range(Q):
        B,C = map(int,input().split())
        if d[B] != 0:
            tmp = d[B]
            d[B] = 0
            d[C] += tmp
            s = s - tmp*B + tmp*C
        print(s)




if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3
from collections import Counter

def main():
    N = int(input())
    a = list(map(int,input().split()))
    l = Counter(a)
    d = [0] + [l[i+1] for i in range(10**5)]
    Q = int(input())
    s = sum(a)
    for _ in range(Q):
        B,C = map(int,input().split())
        if d[B] != 0:
            tmp = d[B]
            d[B] = 0
            d[C] += tmp
            s = s - tmp*B + tmp*C
        print(s)




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    X,N = map(int,input().split())
    if N == 0:
        print(X)
        exit()
    p = set(map(int,input().split()))
    lst = set(range(1,101)) - p
    tmp = 130
    if min(lst) >= X:
        print(min(lst))
        exit()
    if max (lst) <= X:
        print(max(lst))
        exit()
    prev = min(lst)
    for s in lst:
        if abs(s - X) >= tmp:
            print(prev)
            exit()
        prev = s
        tmp = abs(s - X)
    print(max(lst))

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3

def main():
    X,N = map(int,input().split())
    if N == 0:
        print(X)
        exit()
    p = set(map(int,input().split()))
    if N == 100:
        print(0 if X<=50 else 101)
        exit()
    lst = [0] + list(set(range(1,101)) - p) + [101]
    lst2 = [abs(lst[i] - X) for i in range(len(lst))]
    min_ = min(lst2)
    print(lst[lst2.index(min_)])    



if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

def main():
    X,N = map(int,input().split())
    if N == 0:
        print(X)
        exit()
    p = set(map(int,input().split()))
    lst = set(range(1,101)) - p
    tmp = 130
    prev = min(lst)
    for s in lst:
        if abs(s - X) >= tmp:
            print(prev)
            exit()
        prev = s
        tmp = abs(s - X)
    print(max(lst))

if __name__ == '__main__':
    main()

Fixed submission:
#!/usr/bin/env python3

def main():
    X,N = map(int,input().split())
    if N == 0:
        print(X)
        exit()
    p = set(map(int,input().split()))
    if N == 100:
        print(0 if X<=50 else 101)
        exit()
    lst = [0] + list(set(range(1,101)) - p) + [101]
    lst2 = [abs(lst[i] - X) for i in range(len(lst))]
    min_ = min(lst2)
    print(lst[lst2.index(min_)])    



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
A = list(map(int,input().split()))

def s(n,a):
  b = [0]*n
  for i in range(n):
    l = max(0,i-a[i])
    r = min(n-1,i+a[i])
    b[l] += 1
    if r < n - 1:
      b[r+1] -= 1
  for i in range(n-1):
    b[i+1] += b[i]
  return b

for i in range(min(41,K)):
  A = s(N,A)
  
print(*A)
      


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

def s(n,a):
  b = [0]*n
  for i in range(n):
    l = max(0,i-a[i])
    r = min(n-1,i+a[i])
    b[l] += 1
    if r < n - 1:
      b[r+1] -= 1
  for i in range(n-1):
    b[i+1] += b[i]
  return b

for i in range(min(41,K)):
  A = s(N,A)
  
print(*A)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))

def s(n,a):
  b = [0]*n
  for i in range(n):
    l = max(0,i-a[i])
    r = min(n-1,i+a[i])
    b[l] += 1
    if r < n - 1:
      b[r+1] -= 1
  for i in range(n):
    b[i+1] = b[i]
  return b

for i in range(min(41,K)):
  A = s(N,A)
  
print(A)
      


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

def s(n,a):
  b = [0]*n
  for i in range(n):
    l = max(0,i-a[i])
    r = min(n-1,i+a[i])
    b[l] += 1
    if r < n - 1:
      b[r+1] -= 1
  for i in range(n-1):
    b[i+1] += b[i]
  return b

for i in range(min(41,K)):
  A = s(N,A)
  
print(*A)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = list(map(int,input().split()))

def s(n,a):
  b = [0]*n
  for i in range(n):
    l = max(0,i-a[i])
    r = min(n-1,i+a[i])
    b[l] += 1
    if r < N - 1:
      b[r+1] -= 1
  for i in range(n):
    b[i+1] = b[i]
  return b

for i in range(min(41,K)):
  A = s(N,A)
  
print(A)
      

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

def s(n,a):
  b = [0]*n
  for i in range(n):
    l = max(0,i-a[i])
    r = min(n-1,i+a[i])
    b[l] += 1
    if r < n - 1:
      b[r+1] -= 1
  for i in range(n-1):
    b[i+1] += b[i]
  return b

for i in range(min(41,K)):
  A = s(N,A)
  
print(*A)
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = input()

if len(S) <=K:
  print(S)
else:a
  print(S[:K] + "...")

Fixed submission:
N = int(input()) % 10

hon = {2, 4, 5, 7, 9}
pon = {0, 1, 6, 8}
bon = {3}

if N in hon:
  print("hon")
if N in pon:
  print("pon")
if N in bon:
  print("bon")
Buggy python submission (verdict: Runtime Error):
A,B,C,K = map(int,input().split())

def solve(a,b,c,k):
  s = 0
  while k > 0:
    if a > 0:
      a -= 1
      s += 1
      k -= 1
    elif b > 0:
      b -= 1
      k -= 1
    else:
      c -= 1
      s -= 1
      k -= 1

  return s
    
print(solve(A,B,C,K))

Fixed submission:
s = input()
t = input()

if t[:-1] == s:
  print("Yes")
else:
  print("No")