Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
  b.append(a[i])
  b = b[::-1]
print(*b)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],end=" ")
print(*A[N%2::2])

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
a = deque(list(map(int,input().split())))
b = []
for i in range(n):
  b.append(a.popleft())
  b = b[::-1]
print(*b)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],end=" ")
print(*A[N%2::2])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
b = []
for i in range(n):
  b.append(a.pop(0))
  b = b[::-1]
print(*b)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
print(*A[::-2],end=" ")
print(*A[N%2::2])
Buggy python submission (verdict: Runtime Error):
r,g,b = input().split()
print('YES 'int(r+g+b)%4==0 else 'NO')

Fixed submission:
r,g,b = input().split()
print('YES 'if int(r+g+b)%4==0 else 'NO')
Buggy python submission (verdict: Runtime Error):
#ABC060D
N, W = map(int,input().split())
WV = [list(map(int,input().split())) for _ in range(N)]
dp = [[0] * (N+10) for _ in range(W+10)]

#DPループ
for i in range(N):
    for w in range(W+1):
        if w >= WV[i][0]:
            dp[i+1][w] = max(dp[i][w-WV[i][0]] + WV[i][1],dp[i][w])
        else:
            dp[i+1][w] = dp[i][w]
#print(*dp,sep="\n")
print(dp[N][W])



Fixed submission:
#ABC060D
N, W = map(int,input().split())
WV = [list(map(int,input().split())) for _ in range(N)]
A = WV[0][0]
B = A + 1
C = A + 2
D = A + 3

AA = []
BB = []
CC = []
DD = []

for wv in WV:
  if wv[0] == A:
    AA.append(wv[1])
  elif wv[0] == B:
    BB.append(wv[1])
  elif wv[0] == C:
    CC.append(wv[1])
  else:
    DD.append(wv[1])

AA = sorted(AA)[::-1]
BB = sorted(BB)[::-1]
CC = sorted(CC)[::-1]
DD = sorted(DD)[::-1]

ans = 0
for a in range(N+1):
  for b in range(N+1-a):
    for c in range(N+1-a-b):
      for d in range(N+1-a-b-c):
        if a > len(AA) or b > len(BB) or c > len(CC) or d > len(DD):
          continue
        if A * a + B * b + C * c + D * d > W:
          continue
        tmp = sum(AA[:a])+sum(BB[:b])+sum(CC[:c])+sum(DD[:d])
        ans = max(ans,tmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
print(upper(a[0]+b[0]+c[0]))

Fixed submission:
a,b,c = input().split()
print((a[0]+b[0]+c[0]).upper())
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
print("GREATER" if a > b else "LESS" a < b else "EQUAL")


Fixed submission:
a = int(input())
b = int(input())
print("GREATER" if a > b else "LESS" if a < b else "EQUAL")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print("GREATER" if a > b else "LESS" a < b else "EQUAL")

Fixed submission:
a = int(input())
b = int(input())
print("GREATER" if a > b else "LESS" if a < b else "EQUAL")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
count=0
if a[0]>0:
  for i in range(n):
    if i%2==0:
      if sum(a[:i+1])<0:
        count+=-1*sum(a[:i+1])+1
        a[i]+=-1*sum(a[:i+1])+1
    else:
      if sum(a[:i+1])>0:
        count+=sum(a[:i+1])+1
        a[i]-=sum(a[:i+1])-1
else:
  for i in range(n):
    if i%2==0:
      if sum(a[:i+1])>0:
        count+=sum(a[:i+1])+1
        a[i]+=-1*sum(a[:i+1])-1
    else:
      if sum(a[:i+1])<0:
        count+=-1*sum(a[:i+1])+1
        a[i]+=-1*sum(a[:i+1])+1
if sum(a)==0:
  count+=1
print(count)

Fixed submission:
n=input()
a=[int(i) for i in input().split()]
def chk(a,t):
    ans=0
    x=0
    for i in a:
        x+=i
        if t==True and x<1:
            ans+=1-x
            x=1
        elif t==False and x>-1:
            ans+=x+1
            x=-1
        t=not t
    return ans
print(min(chk(a,True),chk(a,False)))
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
print('YES' if b-a=c-b else 'NO')

Fixed submission:
a,b,c = map(int,input().split())
print('YES' if b-a==c-b else 'NO')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
def isPrime(n):
  if n < 2:
    return False
  i = 2
  while i*i <= n:
    if n%i == 0:
      return False
    i += 1
  return True
if isPrime(N):
  print(len(str(N)))
else:
  ans = float("inf")
  for i in range(1,N+1):
    if N % i == 0:
      if i >= N // i:
        ans = min(ans,len(str(i)))
      else:
        ans = min(ans,len(str(N // i)))
  print(ans)    

Fixed submission:
import math
N = int(input())
def isPrime(n):
  if n < 2:
    return False
  i = 2
  while i*i <= n:
    if n%i == 0:
      return False
    i += 1
  return True
if isPrime(N):
  print(len(str(N)))
else:
  ans = float("inf")
  i = 1
  while i <= math.sqrt(N):
    if N % i == 0:
      if i >= N // i:
        ans = min(ans,len(str(i)))
      else:
        ans = min(ans,len(str(N // i)))
    i += 1
  print(ans)
Buggy python submission (verdict: Runtime Error):
a,b = map(input().split())
print("H" if a==b=="H" or a==b=="D" else "D")

Fixed submission:
a,b = input().split()
print("H" if a==b=="H" or a==b=="D" else "D")
Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
ans = 0
while N > 0 and M > 0:
  N -= 1
  M -= 2
  ans += 1
print(ans + M // 4)

Fixed submission:
N,M = map(int,input().split())
ans = 0
if N > M // 2:
  print(M // 2)
  exit()
print(N + (M - N * 2) // 4)

Buggy python submission (verdict: Time Limit Exceeded):
N,M = map(int,input().split())
if M < N * 2:
  print(M // 2)
else:
  while M > N * 2:
    M -= 2
    N += 1
  print(M // 2)

Fixed submission:
N,M = map(int,input().split())
ans = 0
if N > M // 2:
  print(M // 2)
  exit()
print(N + (M - N * 2) // 4)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
import math
N = int(input())
A = list(map(int,input().split()))
R = []
T = []
C = Counter(A)
cnt = 0
for c in C.items():
  if c[1] > 1:
    cnt += c[1] - 1
    T.append(c[0])
  else:
    R.append(c[0])
Max_R = max(T)
Min_R = min(T)
flg = False
for r in R:
  if Min_R <= r <= Max_R:
    flg = True
    break
if cnt % 2 != 0:
  ans = N - cnt - 1
else:
  if flg:
    ans = N - cnt
  else:
    ans = N - cnt - 2
print(ans)

Fixed submission:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
C = Counter(A)
L = len(C)
print(L-1 if L % 2 == 0 else L)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
count = 0
if 3*k==s:
  print(1)
else:
  for x in range(k+1):
    if x+2*k<s:continue
    for y in range(k+1):
      if x+y+k<s:continue
      for z in range(k+1):
        if x+y+z==s:
          count += 1
  print(count)

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int,input().split())
if 3*k==s:
  print(1)
else:
  list = [ x + y + z for x in range(k+1) for y in range(k+1) for z in range(k+1)] 
  print(list.count(s))

Fixed submission:
k,s=map(int,input().split())
print(len([1 for z in range(k+1) for y in range(k+1) if 0<=s-y-z<=k]))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
A = list(set(a))
flag = True
if n%2==0:
  if a.count(0)>0:
    flag=False
  else:
    for i in A:
      if a.count(i)!=2:
        flag=False
        break
else:
  if a.count(0)!=1:
    flag=False
  else:
    A.pop(A.index(0))
    for j in A:
      if a.count(j)!=2:
        flag=False
        break
if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
A = list(set(a))
flag = True
if n%2==0:
  if a.count(0)>0 or len(A)!=len(a)//2:
    flag=False
else:
  if a.count(0)!=1 or len(A)!=len(a)//2+1:
    flag=False
if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
A = list(set(a))
flag = True
if n%2==0:
  if a.count(0)>0:
    flag=False
  else:
    for i in A:
      if a.count(i)!=2:
        flag=False
        break
else:
  if a.count(0)!=1:
    flag=False
  else:
    A.pop(A.index(0))
    for j in A:
      if a.count(j)!=2:
        flag=False
        break
if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
A = list(set(a))
flag = True
if n%2==0:
  if a.count(0)>0 or len(A)!=len(a)//2:
    flag=False
else:
  if a.count(0)!=1 or len(A)!=len(a)//2+1:
    flag=False
if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
A = list(set(a))
flag = True
if n%2==0:
  if a.count(0)>0:
    flag=False
  else:
    for i in A:
      if a.count(i)!=2:
        flag=False
else:
  if a.count(0)!=1:
    flag=False
  else:
    A.pop(A.index(0))
    for j in A:
      if a.count(j)!=2:
        flag=False
if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
A = list(set(a))
flag = True
if n%2==0:
  if a.count(0)>0 or len(A)!=len(a)//2:
    flag=False
else:
  if a.count(0)!=1 or len(A)!=len(a)//2+1:
    flag=False
if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
flag = True
if n%2==0:
  if a.count(0)>0:
    flag=False
  else:
    for i in range(n):
      if a.count(a[i])!=2:
        flag=False
else:
  if a.count(0)!=1:
    flag=False
  else:
    a.pop(a.index(0))
    for i in range(n-1):
      if a.count(a[i])!=2:
        flag=False

if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
A = list(set(a))
flag = True
if n%2==0:
  if a.count(0)>0 or len(A)!=len(a)//2:
    flag=False
else:
  if a.count(0)!=1 or len(A)!=len(a)//2+1:
    flag=False
if flag==True:
    print((2**(n//2))%(10**9+7))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
S = list(input())
cnt = len(S)
while len(S) > 0:
  i = 0
  while i < len(S)-1:
    if S[i] == "S" and S[i+1] == "T":
      S.pop(i)
      S.pop(i+1)
    i += 1
  if cnt == len(S):
    print(len(S))
    exit()
  cnt = len(S)
print(len(S))

Fixed submission:
S = input()
Stack = []
for i in range(len(S)):
  if S[i] == "S":
    Stack.append("S")
  elif S[i] == "T" and len(Stack) == 0:
    Stack.append("T")
  elif S[i] == "T" and Stack[-1] == "T":
    Stack.append("T")
  elif S[i] == "T" and Stack[-1] == "S":
    Stack.pop()
print(len(Stack))
Buggy python submission (verdict: Runtime Error):
n,k,x,y = [int(split()) for _ in range(4)]
print(k*x+(n-k)*y if n>=k else k*x)


Fixed submission:
n,k,x,y = [int(input()) for _ in range(4)]
print(k*x+(n-k)*y if n>=k else n*x)

Buggy python submission (verdict: Runtime Error):
n,k,x,y = [int().split() for _ in range(4)]
print(k*x+(n-k)*y if n>=k else k*x)

Fixed submission:
n,k,x,y = [int(input()) for _ in range(4)]
print(k*x+(n-k)*y if n>=k else n*x)
Buggy python submission (verdict: Runtime Error):
n,l = map(int,input().split())
s = sorted[input() for _ in range(n)]
for i in range(n):
  print(*s,sep="")

Fixed submission:
n,l = map(int,input().split())
s = [input() for _ in range(n)]
s_sorted = sorted(s)
for i in range(n):
  print(s_sorted[i],end="")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
print(a*b)2 

Fixed submission:
a, b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
import bisect

N = int(input())
L = list(map(int, input().split()))

L.sort()

buff = []
ll = []


for i in range(N):
    l_b = []
    for j in range(i+1, N):
        l_b.append(L[i]+L[j])
        ll.append(L[i]+L[j])
    if i != N-1:
        buff.append(l_b)
# buff.sort()
# print(L)
# print(buff)

ans = 0
_len = len(buff)

for i in range(_len):
    for j in range(len(buff[i])):
        index = bisect.bisect_left(L[i+j+1+1:], buff[i][j])
        # print(L[i+j+1+1:])
        # print(index, buff[i][j])
        ans += index
print(ans)


# for i in range(N):
#     index = bisect.bisect_left(buff, L[i])
#     print(index)
#     ans += index
# print(ans)


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

if A - (B*2) > 0:
    print(A - (B*2))
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

N = int(input())
L = list(map(int, input().split()))

L.sort()

buff = []
ll = []


for i in range(N):
    l_b = []
    for j in range(i+1, N):
        l_b.append(L[i]+L[j])
        ll.append(L[i]+L[j])
    if i != N-1:
        buff.append(l_b)
# buff.sort()
# print(L)
# print(buff)

ans = 0
_len = len(buff)

for i in range(_len):
    for j in range(len(buff[i])):
        index = bisect.bisect_left(L[i+j+1+1:], buff[i][j])
        # print(L[i+j+1+1:])
        # print(index, buff[i][j])
        ans += index
print(ans)


# for i in range(N):
#     index = bisect.bisect_left(buff, L[i])
#     print(index)
#     ans += index
# print(ans)


Fixed submission:
import bisect

N = int(input())
L = list(map(int, input().split()))

L.sort()

buff = []
# ll = []


for i in range(N):
    l_b = []
    for j in range(i+1, N):
        l_b.append(L[i]+L[j])
        # ll.append(L[i]+L[j])
    if i != N-1:
        buff.append(l_b)
# buff.sort()
# print(L)
# print(buff)

ans = 0
_len = len(buff)

for i in range(_len):
    for j in range(len(buff[i])):
        index = bisect.bisect_left(L[i+j+1+1:], buff[i][j])
        # print(L[i+j+1+1:])
        # print(index, buff[i][j])
        ans += index
print(ans)


# for i in range(N):
#     index = bisect.bisect_left(buff, L[i])
#     print(index)
#     ans += index
# print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
H = list(map(int, input().split()))
c = 0
ans = 0
for i in range(1,N):
    buff = i
    while True:
        if buff < N:
            if H[buff]<=H[buff-1]:
                c += 1
            else:
                break
        else:
            break
        buff += 1

    ans = max(c, ans)
    c = 0

print(ans)

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

buff = [0 for i in range(N)]
c = 0
for i in range(1,N):
    if H[i] <= H[i-1]:
        buff[i] = 1

# print(buff)

ans = 0
c = 0
a = 0
for i in range(N):
    if buff[i]:
        c+= 1
        a += 1
        # print(a, c)
    else:
        ans = max(c, ans)
        c = 0

    ans = max(c, ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
import heapq
from collections import defaultdict
cnt = defaultdict(int)
N = int(input())
A = list(map(int, input().split()))
# A = []
# for i in range(N):
#     A.append(int(input()))
ans = 0
_ans = []
buff = [0 for i in range(N)]
for i in range(N-1, -1, -1):
    if i > N//2:
        buff[i] = A[i]
    else:
        _m = 0
        # for j in range(i, N, max(1, i)):
        #     _m += buff[j]
        # _m = sum(buff[i:N])
        for j in range(i*2, N, max(1, i)):
            _m += buff[j]
        if _m % 2 != A[i]:
            buff[i] = 1
            ans += 1
            _ans.append(i+1)

mm = 0
for i in range(ans):
    if buff[i] == 1:
        mm = i

print(sum(buff))
print(*_ans)

Fixed submission:
N = int(input())
A = []

for i in range(N):
    A.append(int(input()))

buff = A.copy()
buff.sort()
buff = buff[::-1]

for i in range(N):
    if A[i] == buff[0]:
        print(buff[1])
    else:
        print(buff[0])

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = []

for i in range(N):
    A.append(int(input()))

buff = A.copy()
buff.sort()
buff = buff[::-1]

for i in range(N):
    if A[i] == buff[0]:
        print(buff[1])
    else:
        print(buff[0])

Fixed submission:
N = int(input())
A = []

for i in range(N):
    A.append(int(input()))

buff = A.copy()
buff.sort()
buff = buff[::-1]

for i in range(N):
    if A[i] == buff[0]:
        print(buff[1])
    else:
        print(buff[0])
Buggy python submission (verdict: Runtime Error):
P = list(map(int, input().split()))

print(n)
print(P)

counter = 0
for i in range(1, n-1):
    buff = []
    buff = P[i-1:i+2]
    buff.sort()
    if P[i] == buff[1]:
        counter += 1


print(counter)


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

counter = 0
for i in range(1, n-1):
    buff = []
    buff = P[i-1:i+2]
    buff.sort()
    if P[i] == buff[1]:
        counter += 1


print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
import heapq

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

B = []
C = []
BC = []

A.sort()

for i in range(M):
    b, c = map(int, input().split())
    B.append(b)
    C.append(c)
    BC.append([b, c])


sorted(BC, key=lambda x: x[1])
BC = BC[::-1]
C = C.sort()

heapq.heapify(A)

# print(A)
# print(BC)

buff = []
counter = 0
for i in range(M):
    # if counter > N*2:
    #     break
    for j in range(BC[i][0]):
        # buff.append(BC[i][1])
        # counter += 1
        heapq.heappush(A, BC[i][1])
        heapq.heappop(A)
        if counter > N*2:
            break

# A = A + buff
# A.sort()
# A = A[::-1]
# print(A)
print(sum(A))

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

B = []
C = []
BC = []

A.sort()

for i in range(M):
    b, c = map(int, input().split())
    B.append(b)
    C.append(c)
    BC.append([b, c])


BC = sorted(BC, key=lambda x: x[1])
BC = BC[::-1]
C = C.sort()

# print(A)
# print(BC)

buff = []
counter = 0
for i in range(M):
    if counter > N*2:
        break
    for j in range(BC[i][0]):
        buff.append(BC[i][1])
        counter += 1
        if counter > N*2:
            break

A = A + buff
A.sort()
A = A[::-1]
print(sum(A[:N]))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

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

X.sort()

buff = []

for i in range(M-1):
    buff.append(abs(X[i+1]-X[i]))


buff.sort()
buff = buff[::-1]

for i in range(min(N-1, len(buff))):
    # print(buff.pop(0))

print(sum(buff))

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

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

X.sort()

buff = []

for i in range(M-1):
    buff.append(abs(X[i+1]-X[i]))


buff.sort()
buff = buff[::-1]

for i in range(min(N-1, len(buff))):
    buff.pop(0)

print(sum(buff))
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

_number = []
P = []
Y = []
yp = [[] for i in range(N+1)]
_yp = []

for i in range(M):
    p, y = map(int, input().split())
    yp[p].append([y, i])

# print(yp)

_l_yp = len(yp)

for i in range(_l_yp):
    yp[i].sort()


ans_yp = [[] for i in range(N+1)]

for i in range(_l_yp):
    nga_yp = len(yp[i])

    for j in range(nga_yp):
    #    print(i, j)
    #    print(yp[i][j][1])
       ans_yp[yp[i][j][1]].append(i)
       ans_yp[yp[i][j][1]].append(j+1)


__len = len(ans_yp)

for i in range(__len):
    buff = ''
    for d in range(2):
        ans = ''
        for j in range((6-len(str(ans_yp[i][d])))):
            ans += '0'

        buff += ans + str(ans_yp[i][d])

    print(buff)



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

_number = []
P = []
Y = []
yp = [[] for i in range(N+1)]
_yp = []

for i in range(M):
    p, y = map(int, input().split())
    yp[p].append([y, i])

# print(yp)

_l_yp = len(yp)

for i in range(_l_yp):
    yp[i].sort()


ans_yp = [[] for i in range(M)]

for i in range(_l_yp):
    nga_yp = len(yp[i])

    for j in range(nga_yp):
    #    print(i, j)
    #    print(yp[i][j][1])
       ans_yp[yp[i][j][1]].append(i)
       ans_yp[yp[i][j][1]].append(j+1)


__len = len(ans_yp)

for i in range(__len):
    buff = ''
    for d in range(2):
        ans = ''
        for j in range((6-len(str(ans_yp[i][d])))):
            ans += '0'

        buff += ans + str(ans_yp[i][d])

    print(buff)
Buggy python submission (verdict: Time Limit Exceeded):
import math
#試し割法
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割っていく
    # c = 0
    tmp = math.sqrt(n) + 1
    tmp = int(tmp)
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数
    if not factor:
        return 'prime number'
    else:
        factor.append(n)
        return factor


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

ans = 0
for i in range(N):
    if A[i] == 2:
        ans += 1
    buff = trial_division(A[i])
    for el in buff:
        if el == 2:
            ans += 1

print(ans)



Fixed submission:
def gu(x):
    counter = 0
    while x % 2 == 0 and x != 0:
        x /= 2
        counter += 1
    return counter


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

ans = 0
for i in range(N):
    if A[i] % 2 == 0:
        ans += gu(A[i])

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
def prime_decomposition(n):
  i = 2
  table = []
  counter = 0
  while i * i <= n:
    while n % i == 0:
      n /= i
      if i == 2:
          counter += 1
      table.append(i)
    i += 1
  if n > 1:
    if n == 2:
        counter += 1
    table.append(n)
  return counter


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

ans = 0
for i in range(N):
    if A[i] % 2 == 0:
        ans += prime_decomposition(A[i])

print(ans)

Fixed submission:
def gu(x):
    counter = 0
    while x % 2 == 0 and x != 0:
        x /= 2
        counter += 1
    return counter


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

ans = 0
for i in range(N):
    if A[i] % 2 == 0:
        ans += gu(A[i])

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
X = list(map(int, input().split()))

# _sum = sum(X)
buff_x = X.copy()


X.sort()
mm = X[N//2-1]
mx = X[N//2]
for i in range(N):
    if buff_x[i] < mx:
        print(mx)
    else:
        print(mm)

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

# _sum = sum(X)
buff_x = X.copy()


X.sort()
mm = X[N//2-1]
mx = X[N//2]
for i in range(N):
    if buff_x[i] < mx:
        print(mx)
    else:
        print(mm)

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

_sum = sum(X)
buff_x = X.copy()


X.sort()
mm = X[N//2-1]
mx = X[N//2]
for i in range(N):
    if buff_x[i] < mx:
        print(mx)
    else:
        print(mm)

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

# _sum = sum(X)
buff_x = X.copy()


X.sort()
mm = X[N//2-1]
mx = X[N//2]
for i in range(N):
    if buff_x[i] < mx:
        print(mx)
    else:
        print(mm)

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

_sum = sum(X)
buff_x = X.copy()


X.sort()
mm = X[N//2-1]
mx = X[N//2]
for i in range(N):
    if buff_x[i] < mx:
        print(mx)
    else:
        print(mm)

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

# _sum = sum(X)
buff_x = X.copy()


X.sort()
mm = X[N//2-1]
mx = X[N//2]
for i in range(N):
    if buff_x[i] < mx:
        print(mx)
    else:
        print(mm)
Buggy python submission (verdict: Runtime Error):
# coding:utf-8
N = int(input())
a = input().split()
a_ = list(map(int, a))

#back_a = list(map(lambda x:x*0, list(range(N))))

back_i = 0
back_i2 = 0
for i in range(N):
    a_count = a[i-back_i]
    if a_count > int(a[i-back_i]):
        del a[i-back_i]
        back_i += 1
        back_i2 += 
    if a_count < int(a[i-back_i]):
        del a[i-back_i]
        back_i += 1

print(back_i)


Fixed submission:
# coding:utf-8
a, b = list(map(float, input().split()))
c = (a + b)/2
c_int = int(c)
if c > c_int:
    print(c_int+1)
else:
    print(c_int)