Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(input()) for i in range(N)]
for i in range(N):
    A[i] *= -1
    print(max(A))
    A[i] *= -1

Fixed submission:
N = int(input())
A = [int(input()) for i in range(N)]
a, b = sorted(A, reverse = True)[0: 2]
for i in range(N):
    if A[i] == a:
        print(b)
    else:
        print(a)
Buggy python submission (verdict: Runtime Error):
def Fib(n):    
    if n == 2 or n == 3:
        return 1
    else:
        return Fib(n - 1) + Fib(n - 2)
    
N, M = map(int, input().split())
S = [-1]
for i in range(M):
    S.append(int(input()))
S.append(N + 1)
S = [S[i + 1] - S[i] for i in range(M + 1)]
if any([x == 1 for x in S]):
    print(0)
    exit()
num = 1
for x in S:
    num *= Fib(x)
    num = num % 1000000007
print(num)

Fixed submission:
def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]
    
N, M = map(int, input().split())
if N == 1:
    print(1)
    quit()
S = [-1]
for i in range(M):
    S.append(int(input()))
S.append(N + 1)
S = [S[i + 1] - S[i] for i in range(M + 1)]
if any([x == 1 for x in S]):
    print(0)
    exit()
num = 1
for x in S:
    num *=  fib(x - 1)
    num = num % 1000000007
print(num)

Buggy python submission (verdict: Runtime Error):
def Fib(n):    
    if n == 2 or n == 3:
        return 1
    else:
        return Fib(n - 1) + Fib(n - 2)
    
N, M = map(int, input().split())
S = [-1]
for i in range(M):
    S.append(int(input()))
S.append(N + 1)
S = [S[i + 1] - S[i] for i in range(M + 1)]
if any([x == 1 for x in S]):
    print(0)
    exit()
num = 1
for x in S:
    num *= Fib(x)
print(num % 1000000007)

Fixed submission:
def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]
    
N, M = map(int, input().split())
if N == 1:
    print(1)
    quit()
S = [-1]
for i in range(M):
    S.append(int(input()))
S.append(N + 1)
S = [S[i + 1] - S[i] for i in range(M + 1)]
if any([x == 1 for x in S]):
    print(0)
    exit()
num = 1
for x in S:
    num *=  fib(x - 1)
    num = num % 1000000007
print(num)
Buggy python submission (verdict: Runtime Error):
x, n = input().split(' ')
line = input()
if line == '':
    print(x)
    exit()

x = int(x)

alist = line.split(' ')
for i in range(int(n)):
    alist[i] = int(alist[i])
if not x in alist:
    print(x)
    exit()

blist = [i for i in range(1,101)]
bset = set(blist)
aset = set(alist)
cset = bset-aset
clist = list(cset)
clist.append(x)
clist.sort()

count = 0
for i,v in enumerate(clist):
    if v == x:
        count = i
        print(len(clist),i,v,x)
if count == 0:
    print(clist[1])
elif count == len(clist)-1:
    print(clist[-2])
else:
    minx = x - clist[count-1]
    maxx = clist[count+1]-x
    if minx > maxx:
        print(clist[count+1])
    else:
        print(clist[count-1])

Fixed submission:
x, n = input().split(' ')
line = input()
if line == '':
    print(x)
    exit()

x = int(x)

alist = line.split(' ')
for i in range(int(n)):
    alist[i] = int(alist[i])
if not x in alist:
    print(x)
    exit()

blist = [i for i in range(0,102)]
bset = set(blist)
aset = set(alist)
cset = bset-aset
clist = list(cset)
clist.append(x)
clist.sort()

count = 0
for i,v in enumerate(clist):
    if v == x:
        count = i
if count == 0:
    print(clist[1])
elif count == len(clist)-1:
    print(clist[-2])
else:
    minx = x - clist[count-1]
    maxx = clist[count+1]-x
    if minx > maxx:
        print(clist[count+1])
    else:
        print(clist[count-1])

Buggy python submission (verdict: Runtime Error):
x, n = input().split(' ')
line = input()
if line == '':
    print(x)
    exit()

x = int(x)

alist = line.split(' ')
for i in range(int(n)):
    alist[i] = int(alist[i])
if not x in alist:
    print(x)
    exit()

blist = [i for i in range(1,101)]
bset = set(blist)
aset = set(alist)
cset = bset-aset
clist = list(cset)
clist.append(x)
clist.sort()

count = 0
for i,v in enumerate(alist):
    if v == int(x):
        count = i
if count == 0:
    print(alist[1])
elif count == 99:
    print(alist[-2])
else:
    minx = x - alist[count-1]
    maxx = alist[count+1]-x
    if minx > maxx:
        print(alist[count+1])
    else:
        print(alist[count-1])

Fixed submission:
x, n = input().split(' ')
line = input()
if line == '':
    print(x)
    exit()

x = int(x)

alist = line.split(' ')
for i in range(int(n)):
    alist[i] = int(alist[i])
if not x in alist:
    print(x)
    exit()

blist = [i for i in range(0,102)]
bset = set(blist)
aset = set(alist)
cset = bset-aset
clist = list(cset)
clist.append(x)
clist.sort()

count = 0
for i,v in enumerate(clist):
    if v == x:
        count = i
if count == 0:
    print(clist[1])
elif count == len(clist)-1:
    print(clist[-2])
else:
    minx = x - clist[count-1]
    maxx = clist[count+1]-x
    if minx > maxx:
        print(clist[count+1])
    else:
        print(clist[count-1])
Buggy python submission (verdict: Runtime Error):
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
length = 0
if B < A:
    length = B-A
else:
    length = A-B
else:
    if (V-W)*T < length:
        print('NO')
    else:
        print('YES')

Fixed submission:
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
length = 0
if B > A:
    length = B-A
else:
    length = A-B
if (V-W)*T < length:
    print('NO')
else:
    print('YES')

Buggy python submission (verdict: Runtime Error):
stdin = [input() for i in range(3)]
line = stdin[0]
A = int(line[0])
V = int(line[1])
line = stdin[1]
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
if (V-W)*T < B-A:
    print('NO')
else:
    print('YES')

Fixed submission:
stdin = [input() for i in range(3)]
line = stdin[0].split(' ')
A = int(line[0])
V = int(line[1])
line = stdin[1].split(' ')
B = int(line[0])
W = int(line[1])
T = int(stdin[2])
length = 0
if B > A:
    length = B-A
else:
    length = A-B
if (V-W)*T < length:
    print('NO')
else:
    print('YES')
Buggy python submission (verdict: Runtime Error):
A B = list(map(int,input().split()))
print(A * B)

Fixed submission:
A,B = list(map(int,input().split()))
print(A * B)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
##print(n)
##print(l)
x = l[0]
for i in range(1,n):
  ##print(i)
  ##print(l[i])
  x *= l[i]
if x >+ 1000000000000000000:
  print(-1)
else:
	print(x)

Fixed submission:
import sys
n = int(input())
l = list(map(int,input().split()))
##print(n)
##print(l)
x = l[0]
if 0 in l:
  print(0)
  sys.exit()
for i in range(1,n):
  ##print(i)
  ##print(l[i])
  x *= l[i]
  if x >+ 1000000000000000000:
    ##print(i)
    ##print(x)
    print(-1)
    sys.exit()
print(x)
Buggy python submission (verdict: Runtime Error):
import math
i = list(map(int, input().split()))
a = i[0]
#print('a=',a)
b = i[1]
#print('b=',b)
h = i[2]
#print('h=',h)
m = i[3]
#print('m=',m)
#長針の角度を求める
ma = m*6
#print('ma=',ma)
#短針の角度を求める
ha = h*30+0.5*m
#print('ha=',ha)
#角度の差の絶対値
if ma ==0 or ha ==0:
  ang = max(ma,ha)
else
ang =abs(ma-ha)
#print(ang)
#長針と短針の角度が同じなら長針ー短針をすればいい。
if ma == ha:
  print(b-a)
else:
  e = math.cos(math.radians(ang))
  #print(e)
  #print(-2*a*b*e)
  #print(a*a + b*b -2*a*b*e)
  d = a*a + b*b -2*a*b* e
  #print(d)
  c = math.sqrt(d)
  print(c)
  
#print('あくまでテスト',math.sqrt(9+16-2*3*4*math.cos(math.radians(80))))

Fixed submission:
import math
i = list(map(int, input().split()))
a = i[0]
#print('a=',a)
b = i[1]
#print('b=',b)
h = i[2]
#print('h=',h)
m = i[3]
#print('m=',m)
#長針の角度を求める
ma = m*6
#print('ma=',ma)
#短針の角度を求める
ha = h*30+0.5*m
#print('ha=',ha)
#角度の差の絶対値
ang = ha -ma
#print(ang)
#長針と短針の角度が同じなら長針ー短針をすればいい。
e = math.cos(math.radians(ang))
d = a*a + b*b -2*a*b* e
#print(d)
c = math.sqrt(d)
print(c)
  
#print('あくまでテスト',math.sqrt(9+16-2*3*4*math.cos(math.radians(80))))
Buggy python submission (verdict: Runtime Error):
l = list(map(int,input().split()))
a = l[0]
b = l[1]
c = l[2]
k = l[3]-1
if (c-k-a-b) >0:
  print(a-1(c-k-a-b))
else:
  print(a)

Fixed submission:
l = list(map(int,input().split()))
a = l[0]
b = l[1]
c = l[2]
k = l[3]
if (k-a-b) >0:
  print(a-1*(k-a-b))
else:
  print(min(a,k))
Buggy python submission (verdict: Runtime Error):
mport math
money = 100
x = int(input())
#print(x)
cnt = 0
while money <= x:
  money += money * 0.01
  money = int(money)
  cnt += 1
  #print(cnt,money)
print(cnt)

Fixed submission:
import math
money = 100
x = int(input())
#print(x)
cnt = 0
while money < x:
  money += money * 0.01
  money = int(money)
  cnt += 1
  #print(cnt,money)
print(cnt)
Buggy python submission (verdict: Runtime Error):
s = input().split()
#print(s)
if s[0] => s[1]:
  print(unsafe)
	else:
      print(safe)
      

Fixed submission:
s = list(map(int, input().split()))
#print(s)
if s[0] <= s[1]:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Runtime Error):
s=input()
if s == Sunny:
  print(Cloudy)
if s== Cloudy:
  print(Rainy)
if s== Rainy:
  print(Sunny)

Fixed submission:
s=input()
if s == 'Sunny':
  print('Cloudy')
if s== 'Cloudy':
  print('Rainy')
if s== 'Rainy':
  print('Sunny')
Buggy python submission (verdict: Time Limit Exceeded):
def calc_minas(n):
    return n - 1

a = list(map(int,input().split()))
n = a[0]
k = a[1]
q = a[2]
#print(n,k,q)
n_list = [k]*n
#print(n_list[0]+100)
#print(n_list)
for i in range(q):
  #print('Q',i)
  seikaisha = int(input())
  #print('seikaishaha',seikaisha)
  n_list = list(map(calc_minas,n_list))
  n_list[seikaisha-1] += 1
  #print(n_list)
for k in range(n):
  if n_list[k] > 0:
    print('Yes')
  else:
    print('No')

Fixed submission:
a = list(map(int,input().split()))
n = a[0]
k = a[1]
q = a[2]
n_list = [0]*n
for i in range(q):
  seikaisha = int(input())
  n_list[seikaisha-1] += 1
  #print(n_list)
for j in range(n):
  if n_list[j]+k-q > 0:
    print('Yes')
  else:
    print('No')

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int,input().split()))
n = a[0]
k = a[1]
q = a[2]
#print(n,k,q)
n_list = [k]*n
#print(n_list[0]+100)
#print(n_list)
for i in range(q):
  #print('Q',i)
  seikaisha = int(input())
  #print('seikaishaha',seikaisha)
  for j in range(n):
    if j == seikaisha:
      n_list[j-1] += 0
    else:
      n_list[j-1] -= 1
  #print(n_list)
for k in range(n):
  if n_list[k] > 0:
    print('Yes')
  else:
    print('No')

Fixed submission:
a = list(map(int,input().split()))
n = a[0]
k = a[1]
q = a[2]
n_list = [0]*n
for i in range(q):
  seikaisha = int(input())
  n_list[seikaisha-1] += 1
  #print(n_list)
for j in range(n):
  if n_list[j]+k-q > 0:
    print('Yes')
  else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
h = list(map(int, input().split()))
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
    else:
      counter = 0
print(countMax)


Fixed submission:
import math
n = int(input())
h = list(map(int, input().split()))
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
  else:
    counter = 0
print(countMax)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
xh = []
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
    else:
      counter = 0
print(countMax)

Fixed submission:
import math
n = int(input())
h = list(map(int, input().split()))
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
  else:
    counter = 0
print(countMax)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
xh = []
#print(n)
#print(h)

for i in range(len(h)-1):
  #print(h[i],h[i+1])
  counter = 0
  #print(i,"kaime",h[i],"wohantei")
  while h[i] >= h[i+1]:
    #print(h[i],">",h[i+1],"counter+1",counter+1)
    counter += 1
    #print(counter)
    i += 1
    #print(i,h[i])
    #print("tugiha",h[i],"to",h[i+1],"wohanteisimasu")
    if i == n-1:
      break
  #print("whilekaranukemasu",h[i],h[i+1])
  xh.append(counter)
print(max(xh))

Fixed submission:
import math
n = int(input())
h = list(map(int, input().split()))
#print(n)
#print(h)
counter = 0
countMax = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    counter +=1
    countMax = max(counter,countMax)
  else:
    counter = 0
print(countMax)
Buggy python submission (verdict: Runtime Error):
s = input()
a = [int(c) for c in s]
  if a[0] == a[1] and a[1]== a[2]:
    print("Yes")
  elif a[1] == a[2] and a[2] == a[3]:
    print("Yes")
  else:
    print("No")

Fixed submission:
s = input()
a = [int(c) for c in s]
if a[0] == a[1] and a[1]== a[2]:
    print("Yes")
elif a[1] == a[2] and a[2] == a[3]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):

#print(x)
y = [int(c) for c in x]
#print(y)
a = y[0]
b = y[1]
c = y[2]
d = y[3]
if a+b+c+d == 7:
  print("a+b+c+d=",a+b+c+d,sep='')
  exit()
if a+b+c-d == 7:
  print("a+b+c-d=",a+b+c-d,sep='')
  exit()
if a+b-c+d == 7:
  print("a+b-c+d=",a+b-c+d,sep='')
  exit()
if a-b+c+d == 7:
  print("a-b+c+d=7")
  exit()
if a-b-c+d == 7:
  print("a-b-c+d=7")
  exit()
if a-b+c-d == 7:
  print("a-b+c-d=7")
  exit()
if a-b-c-d == 7:
  print("a-b-c-d=7")
  exit()
if a+b-c-d == 7:
  print("a+b-c-d=7")
  exit()

Fixed submission:
x = input()
#print(x)
y = [int(c) for c in x]
#print(y)
a = y[0]
b = y[1]
c = y[2]
d = y[3]
if a+b+c+d == 7:
  print(a,"+",b,"+",c,"+",d,"=",a+b+c+d, sep='')
  exit()
if a+b+c-d == 7:
  print(a,"+",b,"+",c,"-",d,"=",a+b+c-d, sep='')
  exit()
if a+b-c+d == 7:
  print(a,"+",b,"-",c,"+",d,"=",a+b-c+d, sep='')
  exit()
if a-b+c+d == 7:
  print(a,"-",b,"+",c,"+",d,"=",a-b+c+d, sep='')
  exit()
if a-b-c+d == 7:
  print(a,"-",b,"-",c,"+",d,"=",a-b-c+d, sep='')
  exit()
if a-b+c-d == 7:
  print(a,"-",b,"+",c,"-",d,"=",a-b+c-d, sep='')
  exit()
if a-b-c-d == 7:
  print(a,"-",b,"-",c,"-",d,"=",a-b-c-d, sep='')
  exit()
if a+b-c-d == 7:
  print(a,"+",b,"-",c,"-",d,"=",a+b-c-d, sep='')
  exit()
Buggy python submission (verdict: Time Limit Exceeded):
i = list(map(int, input().split()))
k = i[0]
s = i[1]
#print("k=",k,"s=",s)
ans = 0
for x in range(k+1):
  for y in range(k+1):
    for z in range(k+1):
#      print("x=",x,"y=",y,"z=",z)
      if x+y+z == s:
#        print("clear!")
        ans += 1
print(ans)

Fixed submission:
i = list(map(int, input().split()))
k = i[0]
s = i[1]
#print("k=",k,"s=",s)
ans = 0
for x in range(k+1):
  for y in range(k+1):
    z = s-x-y
    #print("x=",x,"y=",y,"z=",z)
    if k >= z and z >=0:
        #print("clear!")
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a = [0]*(10000)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            if i**2+j**2+k**2 >= n:
                break
            a[i**2+j**2+k**2+i*j+j*k+i*k]+=1
for i in range(1,n+1):
    print(a[i])



Fixed submission:
n=int(input())
a = [0]*(20000)
for i in range(1,101):
    for j in range(1,101):
        for k in range(1,101):
            if i**2+j**2+k**2 >= n:
                break
            a[i**2+j**2+k**2+i*j+j*k+i*k]+=1
for i in range(1,n+1):
    print(a[i])
Buggy python submission (verdict: Time Limit Exceeded):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
flg = 0

for _ in range(t):
    if a < b:
        if v <= w:
            break
        if a+v >= b+w:
            flg = 1
            break
        a = a+v
        b= b+w
    else:
        if v <= w:
            break
        if a-v <= b-w:
            flg = 1
            break
        a = a-v
        b=b-w
        
if flg == 0:
    print("NO")
else:
    print("YES")

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

if v<=w:
    print("NO")
    sys.exit()

if a<b:
    if a+t*v>=b+t*w:
        print("YES")
    else:
        print("NO")
else:
    if a-t*v<=b-t*w:
        print("YES")
    else:
        print("NO")

Buggy python submission (verdict: Time Limit Exceeded):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
flg = 0

for _ in range(t):
    if a < b:
        if a+v >= b+w:
            flg = 1
        a = a+v
        b= b+w
    else:
        if a-v <= b-w:
            flg = 1
        a = a-v
        b=b-w
        
if flg == 0:
    print("NO")
else:
    print("YES")

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

if v<=w:
    print("NO")
    sys.exit()

if a<b:
    if a+t*v>=b+t*w:
        print("YES")
    else:
        print("NO")
else:
    if a-t*v<=b-t*w:
        print("YES")
    else:
        print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = 1

if 0 in A:
    print(0)
elif max(A) >= 10**18:
    print(-1)
else:
    for i in A:
        B *= i
    if B > 10 ** 18:
        print(-1)
    else:
        print(B)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = 1
# print(max(A))
if 0 in A:
    print(0)
elif max(A) > 10**18:
    print(-1)
else:
    for i in A:
        B *= i
        if B > 10 ** 18:
            B = -1
            break
    print(B)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
B = 1
for i in A:
    B *= i
if B > 10 ** 18:
    print(-1)
else:
    print(B)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
B = 1
# print(max(A))
if 0 in A:
    print(0)
elif max(A) > 10**18:
    print(-1)
else:
    for i in A:
        B *= i
        if B > 10 ** 18:
            B = -1
            break
    print(B)
Buggy python submission (verdict: Runtime Error):
N = input()
if (N % 100) % 10 in [2,4,5,7,9]:
  print("on")
elif (N % 100) % 10 in [0,1,6,8]:
  print("hon")
else:
  print("bon")

Fixed submission:
N = input()
N = int(N)
if (N % 100) % 10 in [2,4,5,7,9]:
  print("hon")
elif (N % 100) % 10 in [0,1,6,8]:
  print("pon")
else:
  print("bon")

Buggy python submission (verdict: Runtime Error):
if (N % 100) % 10 == 3:
  print("bon")
if (N % 100) % 10 in [0,1,6,8]:
  print("pon")
if (N % 100) % 10 in [2,4,5,7,9]:
  print("hon")

Fixed submission:
N = input()
N = int(N)
if (N % 100) % 10 in [2,4,5,7,9]:
  print("hon")
elif (N % 100) % 10 in [0,1,6,8]:
  print("pon")
else:
  print("bon")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    print(A.count(i))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
m = [0]*N #0~N-1

for i in A:
    m[i-1] += 1
# print(m)
for i in range(N):
    print(m[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in range(1,N+1):
    print(A.count(i))


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
m = [0]*N #0~N-1

for i in A:
    m[i-1] += 1
# print(m)
for i in range(N):
    print(m[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))

for i in range(1,N+1):
    print(sum(x == i for x in A))


Fixed submission:
N = int(input())
A = list(map(int,input().split()))
m = [0]*N #0~N-1

for i in A:
    m[i-1] += 1
# print(m)
for i in range(N):
    print(m[i])
Buggy python submission (verdict: Runtime Error):
a,b,c,d = input().split()
for i in ["+","-"]:
    for j in ["+","-"]:
        for k in ["+","-"]:
                if eval(a+i+b+j+c+k+d) == 7:
                    print(a+i+b+j+c+k+d+ "=7")

Fixed submission:
import sys
a,b,c,d = input()
for i in ["+","-"]:
    for j in ["+","-"]:
        for k in ["+","-"]:
                if eval(a+i+b+j+c+k+d) == 7:
                    print(a+i+b+j+c+k+d+ "=7")
                    sys.exit()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = list(map(int,input().split()))

ans = 1

for i in range(n):
  ans = ans * a[i]
      
if ans > (10 ** 18):
  print("-1") 
else:
  print(ans)

Fixed submission:
n = int(input())

a = list(map(int,input().split()))

ans = 1

if 0 in a:
  ans = 0
else:
  for i in range(n):
    ans = ans * a[i]
    if ans > (10 ** 18): 
      break
      
if ans > (10 ** 18):
  print("-1") 
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = list(map(int,input().split()))

ans = 1

for i in range(n):
  ans = ans * a[i]

if ans > (10 ** 18):
  print("-1") 
else:
  print(ans)

Fixed submission:
n = int(input())

a = list(map(int,input().split()))

ans = 1

if 0 in a:
  ans = 0
else:
  for i in range(n):
    ans = ans * a[i]
    if ans > (10 ** 18): 
      break
      
if ans > (10 ** 18):
  print("-1") 
else:
  print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = list(map(int,input().split()))

h.sort(reverse=True)

cnt = 0

for i in range(k):
  h.pop(0)
  if not h:
    break
  
for i in h:
  cnt += i

print(cnt)

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

h.sort()

cnt = 0

for i in range(k):
  h.pop()
  if not h:
    break
  
for i in h:
  cnt += i

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
t=int(math.sqrt(n))
for i in range(1,n+1):
  ans=0
  for j in range(1,t):
    for k in range(1,t):
      for l in range(1,t):
        if j**2+k**2+l**2+j*k+k*l+j*l==i:
          ans+=1
  print(ans)

Fixed submission:
import math
n=int(input())
t=int(math.sqrt(n))
ans=[0 for i in range(100001)]
for j in range(1,t):
  for k in range(1,t):
    for l in range(1,t):
      s=j**2+k**2+l**2+j*k+k*l+j*l
      if s<10001:
        ans[s]+=1
          
for m in range(1,n+1):
  print(ans[m])
Buggy python submission (verdict: Time Limit Exceeded):
n=input()
m=len(n)
l=n.count("?")
for i in range(l):
  s=n.find("?")
  n=n[:s]+"D"+n[s+1:]
  
print(n)

Fixed submission:
n=input()
m=len(n)
li=[]
for i in range(m):
  li.append(n[i])

for i in range(len(li)):
  if li[i]=="?":
    li[i]="D"
  else:
    pass

print("".join(li))
Buggy python submission (verdict: Runtime Error):
a,b,n=map(int,input().split())
a=[]
for i in range(1,n+1):
  a.append(int(a*i/b)-5*int(i/b))
print(max(a))

Fixed submission:
a,b,n = map(int, input().split())
i = min(n,b-1)
print(int(a*i/b) - a*int(i/b))