Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

def check(x):
  dp = [0] * (K + 1)
  dp[0] = 1
  for i in range(N):
    for j in range(K - 1, -1, -1):
      if i == x: continue
      if dp[j]:
        dp[min(K, j + a[i])] = dp[j]
  for j in range(max(0, K - a[x]), K):
    if dp[j]: return True
  return False
#for i in range(N): print(check(i))

if check(0):
  print(0)
  exit(0)
ok = N
ng = 0
while ok - ng > 1:
  m = (ok + ng) // 2
  if check(m): ok = m
  else: ng = m
print(ok)


Fixed submission:
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
t = 0
res = -1
for i in range(N):
  if t + a[i] < K: t += a[i]
  else: res = i
print(N - res - 1)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()

def check(x):
  dp = [0] * (K + 1)
  dp[0] = 1
  for i in range(N):
    for j in range(K - 1, -1, -1):
      if i == x: continue
      if dp[j]:
        dp[min(K, j + a[i])] = dp[j]
  for j in range(max(0, K - a[x]), K):
    if dp[j]: return True
  return False
#for i in range(N): print(check(i))

if check(0):
  print(0)
  exit(0)
ok = N + 1
ng = 0
while ok - ng > 1:
  m = (ok + ng) // 2
  if check(m): ok = m
  else: ng = m
print(ok)


Fixed submission:
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
t = 0
res = -1
for i in range(N):
  if t + a[i] < K: t += a[i]
  else: res = i
print(N - res - 1)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split())) + [10 ** 10]
a.sort()

def check(x):
  dp = [0] * (K + 1)
  dp[0] = 1
  for i in range(N):
    for j in range(K - 1, -1, -1):
      if i == x: continue
      if dp[j]:
        dp[min(K, j + a[i])] = dp[j]
  for j in range(max(0, K - a[x]), K):
    if dp[j]: return True
  return False
#for i in range(N): print(check(i))

if check(0):
  print(0)
  exit(0)
ok = N + 1
ng = 0
while ok - ng > 1:
  m = (ok + ng) // 2
  if check(m): ok = m
  else: ng = m
print(ok)

Fixed submission:
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
t = 0
res = -1
for i in range(N):
  if t + a[i] < K: t += a[i]
  else: res = i
print(N - res - 1)
Buggy python submission (verdict: Runtime Error):
from math import sqrt
N = int(input())
mod = 10 ** 9 + 7 
divs = [0] * (N + 1)
for i in range(1, N + 1):
  for j in range(1, sqrt(i)):
    if i % j == 0:
      divs[j] += 1
print(sum(divs))

Fixed submission:
N = int(input())
mod = 10 ** 9 + 7 
f = 1
res = 1
for i in range(2, N + 1): f *= i
for i in range(2, N + 1):
  c = 0
  while f % i == 0:
    c += 1
    f //= i
  res *= (c + 1) % mod
  res %= mod
print(res % mod)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
res = 0
for i in range(N - 1):
  if X[i + 1] - X[i] > B:
    res += B
  else:
    res += X[i + 1] = X[i]
print(res)

Fixed submission:
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
res = 0
for i in range(N - 1):
  if (X[i + 1] - X[i]) * A > B:
    res += B
  else:
    res += (X[i + 1] - X[i]) * A
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations as combi
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1]*(n+1)
    self.rnk = [0]*(n+1)

  def Find_Root(self, x):
    if(self.root[x] < 0):
      return x
    else:
      self.root[x] = self.Find_Root(self.root[x])
      return self.root[x]

  def Unite(self, x, y):
    x = self.Find_Root(x)
    y = self.Find_Root(y)
    if(x == y):
      return 
    elif(self.rnk[x] > self.rnk[y]):
      self.root[x] += self.root[y]
      self.root[y] = x
    else:
      self.root[y] += self.root[x]
      self.root[x] = y
      if(self.rnk[x] == self.rnk[y]):
        self.rnk[y] += 1

  def isSameGroup(self, x, y):
    return self.Find_Root(x) == self.Find_Root(y)
    
  def Count(self, x):
    return -self.root[self.Find_Root(x)]
N, K, L = map(int, input().split())
k = UnionFind(N)
l = UnionFind(N)
checkset = set()
res = [1] * (N + 1)
for _ in range(K):
  x, y = map(int, input().split())
  k.Unite(x, y)
  checkset.add(x)
  checkset.add(y)
for _ in range(L):
  x, y = map(int, input().split())
  l.Unite(x, y)
  checkset.add(x)
  checkset.add(y)
for c in combi(list(checkset), 2):
  if k.isSameGroup(c[0], c[1]) and l.isSameGroup(c[0], c[1]):
    res[c[0]] += 1
    res[c[1]] += 1
print(*(res[1: ]))



Fixed submission:
from collections import defaultdict as dd
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1]*(n+1)
    self.rnk = [0]*(n+1)

  def Find_Root(self, x):
    if(self.root[x] < 0):
      return x
    else:
      self.root[x] = self.Find_Root(self.root[x])
      return self.root[x]

  def Unite(self, x, y):
    x = self.Find_Root(x)
    y = self.Find_Root(y)
    if(x == y):
      return 
    elif(self.rnk[x] > self.rnk[y]):
      self.root[x] += self.root[y]
      self.root[y] = x
    else:
      self.root[y] += self.root[x]
      self.root[x] = y
      if(self.rnk[x] == self.rnk[y]):
        self.rnk[y] += 1

  def isSameGroup(self, x, y):
    return self.Find_Root(x) == self.Find_Root(y)
    
  def Count(self, x):
    return -self.root[self.Find_Root(x)]
N, K, L = map(int, input().split())
k = UnionFind(N)
l = UnionFind(N)
checkset = set()
res = [1] * (N + 1)
roots = dd(int)
for _ in range(K):
  x, y = map(int, input().split())
  k.Unite(x, y)
  checkset.add(x)
  checkset.add(y)
for _ in range(L):
  x, y = map(int, input().split())
  l.Unite(x, y)
  checkset.add(x)
  checkset.add(y)
for i in list(checkset):
  kr = k.Find_Root(i)
  lr = l.Find_Root(i)
  roots[(kr, lr)] += 1
#print(roots)
for i in list(checkset):
  kr = k.Find_Root(i)
  lr = l.Find_Root(i)
  res[i] = roots[(kr, lr)]
  
print(*(res[1: ]))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import heapq
from collections import defaultdict as dd
input = sys.stdin.readline
N, x = map(int, input().split())
a = list(map(int, input().split()))
res = float("inf")

class prim:
  def __init__(self, n, e):
    self.e = e
    self.n = n
  def MSTcost(self):
    h = []
    visited = [0] * (self.n + 1)
    ks = list(self.e.keys())
    b = pow(10, 10)
    for edge in self.e[ks[0]]:
      heapq.heappush(h, edge[1] * b + edge[0])
    res = 0
    visited[ks[0]] = 1
    while len(h):
      p = heapq.heappop(h)
      p0 = p // b
      p1 = p % b
      if visited[p1]: continue
      visited[p1] = 1
      for q in self.e[p1]:
        if visited[q[0]]:
          continue
        heapq.heappush(h, q[1] * b + q[0])
      res += p0
    return res
e = dd(list)
for k in range(N + 1):
  for i in range(N):
    e[N].append(((i + k) % N, a[i]))
    e[(i + k) % N].append((N, a[i]))
  pri = prim(N, e)
  res = min(res, pri.MSTcost() + k * x)
print(res)

Fixed submission:
import sys
input = sys.stdin.readline
N, x = map(int, input().split())
a = list(map(int, input().split()))
res = float("inf")

t = [float("inf")] * N
for k in range(N + 1):
  for i in range(N):
    t[(i + k) % N] = min(t[(i + k) % N], a[i])
  res = min(res, sum(t) + k * x)
print(res)
Buggy python submission (verdict: Runtime Error):
from bisect import bisect_left as bl
N, K = map(list, input().split())
D = list(map(int, input().split()))
D = [i for i in range(10) if not i in D]
res = []
big = 0
if int("".join([str(D[-1])] * len(N))) < int("".join(N)):
  if D[0] == 0:
    res = [D[1]] + [0] * len(N)
  else:
    res = [D[1]] * (len(N) + 1)
else:
  for i in range(len(N)):
    if big == 0:
      res.append(D[bl(D, int(N[i]))])
    else: res.append(D[0])
    if res[i] > int(N[i]): big = 1
print("".join(list(map(str, res))))

Fixed submission:
from bisect import bisect_left as bl
N, K = map(list, input().split())
D = list(map(int, input().split()))
D = [i for i in range(10) if not i in D]
res = []
big = 0
if int("".join([str(D[-1])] * len(N))) < int("".join(N)):
  if int(K[0]) < 9:
    if D[0] == 0:
      res = [D[1]] + [0] * len(N)
    else:
      res = [D[0]] * (len(N) + 1)
  else:
    res = [D[0]] * (len(N) + 1)
else:
  for i in range(len(N)):
    if big == 0:
      res.append(D[bl(D, int(N[i]))])
    else: res.append(D[0])
    if res[i] > int(N[i]): big = 1
print("".join(list(map(str, res))))
Buggy python submission (verdict: Runtime Error):
n,x,m=map(int,input().split())

yj=[x]

for i in range(n):
  an=(yj[i]**2)%m
  if an in yj:
    lps=yj.index(an)
    break
  yj.append(an)
  
blp=yj[:lps]
lp=yj[lps:]
ans=sum(blp)+sum(lp)*((n-len(blp))//len(lp))+sum(lp[:(n-len(blp))%len(lp)])
print(ans)


Fixed submission:
n,x,m=map(int,input().split())

yj=[x]
lps=0
for i in range(n):
  an=(yj[i]**2)%m
  if an in yj:
    lps=yj.index(an)
    break
  yj.append(an)

blp=yj[:lps]
lp=yj[lps:]
ans=sum(blp)+sum(lp)*((n-len(blp))//len(lp))+sum(lp[:(n-len(blp))%len(lp)])
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())

if a*b>0 and c*d>0 and (a<0 ^ c<0):
  ans=max(a*d,b*c)
else:
  ans=max(a*c,b*d)
print(ans)

Fixed submission:
n=int(input())
mod=(1e+9)+7
x=1
if n>=2:
  ans=1
else:
  ans=0
for i in range(n):
  x*=10
  ans*=8
  ans%=mod
  x%=mod
nin=1

for i in range(n):
  nin*=9
  nin%=mod
x+=ans
x%=mod
x-=(nin*2)%mod
if x<0:
  x+=mod
if n==1:
  print(0)
else:
  print(int(x%mod))
Buggy python submission (verdict: Runtime Error):
#import random
n=int(input())

pnt=[]
for i in range(n):
  pnt.append(list(map(int,input().split())))
  #pnt.append([random.randint(int(-1e9),int(1e9)),random.randint(int(-1e9),int(1e9))])
pnt.sort(key=lambda x:abs(x[0])+abs(x[1]),reverse=True)
mn=list(reversed(pnt))
mx=0

for i in range(min(n,5000)):
  for j in range(i+1,min(n,5000)):
    mx=max(abs(pnt[i][0]-pnt[j][0])+abs(pnt[i][1]-pnt[j][1]),mx)
    mx=max(abs(pnt[i][0]-mn[j][0])+abs(pnt[i][1]-mn[j][1]),mx)
print(mx)


Fixed submission:
n=int(input())
ans=0
mod=int((1e+9)+7)
def cmb(n,r):
  if r<0 or r>n:
    return 0
  r=min(r,n-r)
  return g[n]*gg[r]*gg[n-r]%mod
g=[1,1]
gg=[1,1] 
inv=[0,1] 
for i in range(2,n+1):
  g.append((g[-1]*i)%mod)
  inv.append((-inv[mod%i]*(mod//i))%mod)
  gg.append((gg[-1]*inv[-1])%mod)

for i in range(n//3):
  x=n-(3*(i+1))
  ans+=cmb(x+i,i)

  ans%=mod
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())

pnt=[]
for i in range(n):
  pnt.append(list(map(int,input().split())))
pnt.sort(key=lambda x:abs(x[0])+abs(x[1]),reverse=True)
mn=list(reversed(pnt))
mx=0

for i in range(min(n,16000)):
  for j in range(i+1,min(n,16000)):
    mx=max(abs(pnt[i][0]-pnt[j][0])+abs(pnt[i][1]-pnt[j][1]),mx)
    mx=max(abs(pnt[i][0]-mn[j][0])+abs(pnt[i][1]-mn[j][1]),mx)
print(mx)


Fixed submission:
pnt=[]
n=int(input())
for i in range(n):
  pnt.append(list(map(int,input().split())))

z=[]
w=[]

for i in pnt:
  z.append(i[0]+i[1])
  w.append(i[0]-i[1])
print(max(max(z)-min(z),max(w)-min(w)))
Buggy python submission (verdict: Runtime Error):
#a,b=map(int,input().split())
#lis=list(map(int,input().split()))
#n=int(input())
#s=input()
def yana(int(input())>=30):
  if boo:
    print("Yes")
  else:
    print("No")

Fixed submission:
def yana(boo):
  if boo:
    print("Yes")
  else:
    print("No")
yana(int(input())>=30)
Buggy python submission (verdict: Runtime Error):
import math as mt
n,k=map(int,input().split())
a=list(map(int,input().split()))
bot=0
top=max(a)


while 1:
  cen=(top+bot)//2
  x=0
  if cen==0:
    print(1)
  for i in a:
    x+=mt.ceil(i/cen)-1
  #print(x,top,cen,bot)
  if x>k:
    bot=cen+1
  else:
    top=cen
  
  if top<=bot:
    print(top)
    break
  if bot==cen:
    print(cen+1)
    break

Fixed submission:
import math as mt
n,k=map(int,input().split())
a=list(map(int,input().split()))
bot=0
top=max(a)


while 1:
  cen=(top+bot)//2
  x=0
  if cen==0:
    print(1)
    break
  for i in a:
    x+=mt.ceil(i/cen)-1
  #print(x,top,cen,bot)
  if x>k:
    bot=cen+1
  else:
    top=cen
  
  if top<=bot:
    print(top)
    break
  if bot==cen:
    print(cen+1)
    break

Buggy python submission (verdict: Runtime Error):
import math as mt
n,k=map(int,input().split())
a=list(map(int,input().split()))
bot=0
top=max(a)


while 1:
  cen=(top+bot)//2
  x=0
  for i in a:
    x+=mt.ceil(i/cen)-1
  #print(x,top,cen,bot)
  if x>k:
    bot=cen+1
  else:
    top=cen
  
  if top<=bot:
    print(top)
    break
  if bot==cen:
    print(cen+1)
    break

Fixed submission:
import math as mt
n,k=map(int,input().split())
a=list(map(int,input().split()))
bot=0
top=max(a)


while 1:
  cen=(top+bot)//2
  x=0
  if cen==0:
    print(1)
    break
  for i in a:
    x+=mt.ceil(i/cen)-1
  #print(x,top,cen,bot)
  if x>k:
    bot=cen+1
  else:
    top=cen
  
  if top<=bot:
    print(top)
    break
  if bot==cen:
    print(cen+1)
    break
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))

f=1
for i in a[:k]:
  f*=i
bef=f
for (i,j)in zip(a[k:],a[:-k]):
  f*=i
  f//=j

  if bef<f:
    print("Yes")
  else:
    print("No")
  bef=f

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

for (i,j)in zip(a[k:],a[:-k]):
  if j<i:
    print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(input())

ch=[0]*10001

for i in range(1,100):
  for j in range(1,100):
    for k in range(1,100):
      x=i**2+j**2+k**2+i*j+j*k+k*i
      if x<=10000:
        ch[x]+=1
for i in range(n):
  print(ch[i+1])


Fixed submission:
x,y,d=map(int,input().split())
ans=0
for i in range(x,y+1):
  if i%d==0:
    ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=input()
while n>0:
  n-=1000
print(abs(n))

Fixed submission:
n=int(input())
while n>0:
  n-=1000
print(abs(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()))
ruia=[0]
ruib=[0]
mx=0
for (i,j) in zip(a,range(n)):
  ruia.append(ruia[j]+i)

for (i,j) in zip(b,range(m)):
  ruib.append(ruib[j]+i)

for i in range(n+1,-1,-1):
  ans=-1
  if ruia[i]>k:
    continue
  for j in range(mx,m):
    if rui[i]+rui[j]>k:
      ans=i+j-1
      break
  else:
    ans=i+m
  if ans>mx:
    mx=ans
print(mx)


Fixed submission:
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ruia=[0]
ruib=[0]
mx=0
for (i,j) in zip(a,range(n)):
  ruia.append(ruia[j]+i)

for (i,j) in zip(b,range(m)):
  ruib.append(ruib[j]+i)
ans=0
for i in range(n+1):
  if ruia[i] > k:
    break
  while ruib[m] > k - ruia[i]:
    m -= 1
  ans = max(ans, i + m)
print(ans)

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()))
ans=0
ati=[0]
bti=[0]
for i in range(n):
  ati.append(ati[i]+a[i])
for i in range(m):
  bti.append(bti[i]+b[i])
x=0
y=0
while 1:
  if x==m and ati[x]+bti[y+1]<k:
    y+=1
  elif y==n and ati[x+1]+bti[y]<k:
    x+=1
  elif  ati[x+1]>bti[y+1]:
    y+=1
  elif y<n-1 and x<m-1 and ati[x+1]<bti[y+1]:
    x+=1
  else:
    ans=x+y
    break
  z=ati[x]+bti[y]
  if z>k:
    ans=x+y-1
    break
print(ans)


Fixed submission:
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ruia=[0]
ruib=[0]
mx=0
for (i,j) in zip(a,range(n)):
  ruia.append(ruia[j]+i)

for (i,j) in zip(b,range(m)):
  ruib.append(ruib[j]+i)
ans=0
for i in range(n+1):
  if ruia[i] > k:
    break
  while ruib[m] > k - ruia[i]:
    m -= 1
  ans = max(ans, i + m)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=int(input())
alp=list("abcdefghijklmnopqrstuvwxyz")
ans=""
i=0
while 26**i<s:
  i+=1
i-=1
while s!=0:
  x=s//(26**i)
  s-=(26**i)*x
  ans+=alp[x-1]
  i-=1
print(ans)

Fixed submission:
s=int(input())
a=s
alp=list("abcdefghijklmnopqrstuvwxyz")
ans=""
i=1
#try:
while s!=0:
    jo=(26**i)
    x=s%jo
    if x==0:
      x=jo
    s-=x
    x//=26**(i-1)
    #print("{}%{} {} {}".format(s+x,jo,i,x))
    ans=alp[x-1]+ans
    i+=1
#except:
#  pass
  
print(ans)
Buggy python submission (verdict: Runtime Error):
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

if a>b:
  muki=-1
else:
  muki=1

at=a+v*muki*t
bt=b+w*muki*t

if muki:
  if at>=bt:
    print("YES")
  else:
    print("NO")
else:
  if at=<bt:
    print("YES")
  else:
    print("NO")

Fixed submission:
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())

if a>b:
  muki=-1
else:
  muki=1

at=a+v*muki*t
bt=b+w*muki*t

if muki==1:
  if at>=bt:
    print("YES")
  else:
    print("NO")
else:
  if at<=bt:
    print("YES")
  else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))

def ligh(li):
  for x in range(k):
    if li==[n]*n:
      return li
    ne=[0]*n
    ar=[]
    for (i,a) in zip(range(n),li):
      for j in range(max(0,i-a),min(i+a+1,n)):
        ne[j]+=1
    li=ne
    #print(li)
  return li

for i in ligh(a):
  print(i,end=" ")


Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
def ligh(li):
  for x in range(k):
    if li==[n]*n:
      return li
    ne=[0]*(n+1)
    zr=[]
    lis=[]
    for (i,a) in zip(range(n),li):
      if a==0:
        zr.append(i)
      else:
        ne[max(0,i-a)]+=1
        ne[min(i+a+1,n)]-=1

    for i in range(1,n):
      ne[i]+=ne[i-1]
    for i in zr:
      ne[i]+=1
    li=ne[:-1]
    #print(li)
  return li

for i in ligh(a):
  print(i,end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))
def ligh(li):
  for x in range(k):
    if li==[n]*n:
      return li
    ne=[0]*(n+1)
    zr=[]
    lis=[]
    for (i,a) in zip(range(n),li):
      if a==0:
        zr.append(i)
      else:
        ne[max(0,i-a)]+=1
        ne[min(i+a+1,n)]-=1

    for i in range(1,n):
      ne[i]+=ne[i-1]
    for i in zr:
      ne[i]+=1
    li=ne[:-1]
    #print(li)
  return li

for i in ligh(a):
  print(i,end=" ")


Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
def ligh(li):
  for x in range(k):
    if li==[n]*n:
      return li
    ne=[0]*(n+1)
    zr=[]
    lis=[]
    for (i,a) in zip(range(n),li):
      if a==0:
        zr.append(i)
      else:
        ne[max(0,i-a)]+=1
        ne[min(i+a+1,n)]-=1

    for i in range(1,n):
      ne[i]+=ne[i-1]
    for i in zr:
      ne[i]+=1
    li=ne[:-1]
    #print(li)
  return li

for i in ligh(a):
  print(i,end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
a=list(map(int,input().split()))

def ligh(li):
  for x in range(k):
    if li==[n]*n:
      return li
    ne=[0]*n
    ar=[]
    for (i,a) in zip(range(n),li):
      for j in range(max(0,i-a),min(i+a+1,n)):
        ne[j]+=1
    li=ne
    #print(li)
  return li

for i in ligh(a):
  print(i,end=" ")

Fixed submission:
n,k=map(int,input().split())
a=list(map(int,input().split()))
def ligh(li):
  for x in range(k):
    if li==[n]*n:
      return li
    ne=[0]*(n+1)
    zr=[]
    lis=[]
    for (i,a) in zip(range(n),li):
      if a==0:
        zr.append(i)
      else:
        ne[max(0,i-a)]+=1
        ne[min(i+a+1,n)]-=1

    for i in range(1,n):
      ne[i]+=ne[i-1]
    for i in zr:
      ne[i]+=1
    li=ne[:-1]
    #print(li)
  return li

for i in ligh(a):
  print(i,end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
li = input().split()
zero=False
for i in li:
  ans*=int(i)
  if ans==0:
    zero=True
  if ans>1000000000000000000:
    ans=-1

if ans<0:
  ans=-1
if zero:
  ans=0
print(ans)


Fixed submission:
n=int(input())
ans=1
zero=False
minus=False
li = input().split()
for i in li:
  a=int(i)
  if a==0:
    zero=True
    break
  if minus:
    continue
  ans*=a
  if ans>1000000000000000000:
    minus=True

if minus:
  ans=-1
if zero:
  ans=0
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
li = input().split()
for i in li:
  ans*=int(i)
  if ans>1000000000000000000:
    ans*=-1

if ans<0:
  ans=-1
print(ans)


Fixed submission:
n=int(input())
ans=1
zero=False
minus=False
li = input().split()
for i in li:
  a=int(i)
  if a==0:
    zero=True
    break
  if minus:
    continue
  ans*=a
  if ans>1000000000000000000:
    minus=True

if minus:
  ans=-1
if zero:
  ans=0
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
li = input().split()
for i in li:
  ans*=int(i)
  if ans>1000000000000000000:
    ans*=-1

if ans<0:
  ans=-1
print(ans)

Fixed submission:
n=int(input())
ans=1
zero=False
minus=False
li = input().split()
for i in li:
  a=int(i)
  if a==0:
    zero=True
    break
  if minus:
    continue
  ans*=a
  if ans>1000000000000000000:
    minus=True

if minus:
  ans=-1
if zero:
  ans=0
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=1
num= list(map(int,input().split()))
for i in num:
  ans*=i
  if ans>1000000000000000000:
    ans*=-1

if ans<0:
  ans=-1
print(ans)

Fixed submission:
n=int(input())
ans=1
zero=False
minus=False
li = input().split()
for i in li:
  a=int(i)
  if a==0:
    zero=True
    break
  if minus:
    continue
  ans*=a
  if ans>1000000000000000000:
    minus=True

if minus:
  ans=-1
if zero:
  ans=0
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
x,y = map(str,input().split())
y=int(float(y)*100)
a=int(x)*y

a=int(str(a)[:-2])
print(a)

Fixed submission:
from decimal import *
a,b=input().split()
a=Decimal(a)
b=Decimal(b)
ans=int(a*b)
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
ans=1
li = input().split()
zero=False
for i in li:
  ans*=int(i)
  if ans==0:
    zero=True
  if ans>1000000000000000000:
    ans=-1

if ans<0:
  ans=-1
if zero:
  ans=0
print(ans)


Fixed submission:
from decimal import *
a,b=input().split()
a=Decimal(a)
b=Decimal(b)
ans=int(a*b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
dic=[]
for i in range(n):
  x=input()
  if not x in dic:
    dic.append(x)
    dic.sort()
print(len(dic))

Fixed submission:
n=int(input())
s = list(set([input() for i in range(n)]))
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
dic=[]
for i in range(n):
  x=input()
  if not x in dic:
    dic.append(x)
    dic.sort()
print(len(dic))

Fixed submission:
n=int(input())
s = list(set([input() for i in range(n)]))
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n=input()
count=0;
lis=[]
for i in range(0,int(n)):
    s=input()
    if s in lis:
        pass
    else :
        lis.append(s)
        count+=1
print(count)

Fixed submission:
n=int(input())
s = list(set([input() for i in range(n)]))
print(len(s))
Buggy python submission (verdict: Runtime Error):
from decimal import *
a,b=input().split()
a=Decimal(a)
b=Decimal(b)
ans=int(a*b)
print(ans)

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

d=c-a-b
if d>0 and d*d>4*a*b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math as mt
n,k=map(int,input().split())
print(mt.ceil(mt.log(n,k)))


Fixed submission:
n,r=map(int,input().split())
print(r+(100*(10-min(n,10))))
Buggy python submission (verdict: Runtime Error):
import math as mt
n,k=map(int,input().split())
print(mt.ceil(mt.log(n,k))


Fixed submission:
x,k=map(int,input().split())
ans=0
while k**ans<=x:
  ans+=1

print(ans)