ZhenlongDai/ACPR huggingface dataset:
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
cnt4=0
cnt2=0
for i in a:
    if i%4==0:
        cnt4+=1
    elif i%2==0:
        cnt2+=1
print("Yes" if cnt4*2+1+cnt2-1>=n else "No")

Failing test case input:
3
-1 0 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
cnt4=0
cnt2=0
cnt1=0
for i in a:
    if i%4==0:
        cnt4+=1
    elif i%2==0:
        cnt2+=1
    else:
        cnt1+=1
if cnt2==0 and cnt4+1>=cnt1:
    print("Yes")
elif cnt4>=cnt1:
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
a2 = [i % 2 for i in a].count(0)
a4 = [i % 4 for i in a].count(0)
a0 = n - a2
if a2 >0:
    if a0 < a4+1:
        ans = "Yes"
    else:
        ans = "No"
else:
    if a0 <= a4:
        ans = "Yes"
    else:
        ans = "No"
print(ans)

Failing test case input:
3
-1 1 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
a2 = [i % 2 for i in a].count(0)
a4 = [i % 4 for i in a].count(0)
a0 = n - a2
a2 -= a4
if a2 == 0:
    if a0 <= a4+1:
        ans = "Yes"
    else:
        ans = "No"
else:
    if a0 <= a4:
        ans = "Yes"
    else:
        ans = "No"
print(ans)

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero >= odd -1 and two >= 2:
    print('Yes')
elif zero >= odd:
    print('Yes')
else:
    print('No')

Failing test case input:
3
0 -1 -1

Expected output:
Yes


Actual output:
No


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

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero >= odd -1 and two == 0:
    print('Yes')
elif zero >= odd:
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
l=list(map(int,input().split()))
count2=0
count4=0
for i in range(n):
  if l[i]%4==0:
    count4+=1
  elif l[i]%2==0:
    count2+=1
if count4*2+count2>n or count4*2+1>n:
  print("Yes")
else:
  print("No")


Failing test case input:
3
0 -1 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
l=list(map(int,input().split()))
count2=0
count4=0
for i in range(n):
  if l[i]%4==0:
    count4+=1
  elif l[i]%2==0:
    count2+=1
if count4*2+count2>=n or count4*2+1>=n:
  print("Yes")
else:
  print("No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split(" ")))

one = 0
two = 0
four = 0
for a in A:
    if not(a % 4):
        four += 1
    elif a % 2:
        one += 1
    else:
        two += 1

if one > four:
    print("No")
    exit()

print("Yes")

Failing test case input:
3
0 -1 5

Expected output:
Yes


Actual output:
No


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

one = 0
two = 0
four = 0
for a in A:
    if a % 4:
        if a % 2:
            one += 1
        else:
            two += 1
    else:
        four += 1

if two:
    if one <= four:
        print("Yes")
    else:
        print("No")
else:
    if one - 1 <= four:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
an = list(map(int,input().split()))

odd = list(filter((lambda x:x%2==1),an))
div4 = list(filter((lambda x:x%4 ==0),an))
div2 = set(an).difference(set(odd)).difference(set(div4))
if len(div2) == 0:
  div4.append(0)
if len(odd) <= len(div4)+1:
  print('Yes')
else:
  print('No')

Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
_ = int(input())
an = list(map(int,input().split()))

odd = list(filter((lambda x:x%2==1),an))
div4 = list(filter((lambda x:x%4 ==0),an))
div2 = set(an).difference(set(odd)).difference(set(div4))
if len(div2) == 0:
  div4.append(0)
if len(odd) <= len(div4):
  print('Yes')
else:
  print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int()
lst = list(map(int,input().split()))

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    sonota = len(lst) - four - two
    two = 1 if two>=1 else 0

    if four + 1 - sonota - two >= 0:
        return "Yes"
    else:
        return "No"

print(solve(lst))



Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int(input())
lst = list(map(int,input().split()))

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int(input())
lst = list(map(int,input().split()))

four = count_four(lst)
two = count_two(lst) - four
others = n - four - two


four += 1
four -= others




if four < 0 :
    answer = "No"
else:
    answer = "Yes"

print(answer)

Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int(input())
lst = list(map(int,input().split()))

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int()
lst = list(map(int,input().split()))

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    sonota = len(lst) - four - two
    if four == 0 and sonota >= 1:
        return "No"

    if sonota < four + 1:
        return "Yes"
    elif ((four + 1 - sonota) == 0) and (two == 0):
        return "Yes"
    else:
        return "No"

print(solve(lst))



Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int(input())
lst = list(map(int,input().split()))

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
an = list(map(int, input().split()))
four = 0
odd = 0
for a in an:
    if a % 2 == 1:
        odd += 1
    elif a % 4 == 0:
        four += 1
print('Yes' if 2*odd-2 <= four or odd+max(1, four) == N else 'No')


Failing test case input:
4
-1 2 3 7

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
an = list(map(int, input().split()))
four = 0
odd = 0
for a in an:
    if a % 2 == 1:
        odd += 1
    elif a % 4 == 0:
        four += 1
print('Yes' if odd <= four or N

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))

c = [0,0,0,0]
for x in a:
    c[x % 4] += 1

if (c[1]==0) and (c[3]==0):
    print('Yes')
elif c[1] + 1 <= c[0]:
    print('Yes')
else:
    print('No')

Failing test case input:
3
0 22 101

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))

c = [0,0,0,0]
for x in a:
    c[x % 4] += 1

if (c[1]==0) and (c[3]==0):
    print('Yes')
elif c[1] + c[3] < c[0] + 1:
    print('Yes')
elif (c[1] + c[3] == c[0] + 1)and(c[2] == 0):
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
tmp = int(input())
arr = [int(x) for x in input().split()]
nep = 0
krat = 0
for elem in arr:
    if elem % 4 == 0:
        krat += 1
        break
    if elem % 2 == 1:
        nep += 1
if krat - nep >= -1:
    if krat - nep == -1:
        if nep + krat == tmp:
            print("Yes")
        else:
            print("No")
    else:
        print("Yes")
else:
    print("No")

Failing test case input:
6
2 7 1 8 4 8

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
tmp = int(input())
arr = [int(x) for x in input().split()]
nep = 0
krat = 0
for elem in arr:
    if elem % 4 == 0:
        krat += 1
        continue
    if elem % 2 == 1:
        nep += 1
if krat - nep >= -1:
    if krat - nep == -1:
        if nep + krat == tmp:
            print("Yes")
        else:
            print("No")
    else:
        print("Yes")
else:
    print("No")
Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))

e = []
even4 = 0
even = 0
odd = 0
for i in a:
    if i % 4 == 0:
        even4 += 1
        e.append(i)
    elif i % 2 == 0:
        even += 1
    if i % 2 != 0:
        odd += 1

if even != 0:
    if even4 >= odd:
        print("Yes")
        exit()
    else:
        print("No")
        exit()
else:
    if even4 >= odd+1:
        print("Yes")
        exit()
    else:
        print("No")
        exit()


Failing test case input:
3
1 7 100

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))

even4, even, odd = 0, 0, 0
for i in a:
    if i % 4 == 0:
        even4 += 1
    elif i % 2 == 0:
        even += 1
    else:
        odd += 1

if N % 2 == 0:
    if even4 >= odd:
        print("Yes")
    else:
        print("No")
else:
    if even4 >= odd - 1:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

odd = []
even2 = []
even4 = []

for ai in a:
    if ai%4==0:even4.append(ai)
    elif ai%2==0:even2.append(ai)
    else:odd.append(ai)
if len(even4)==len(odd):print('Yes')
elif len(even4)+1==len(odd) and len(even2)==0:print('Yes')
else:print('No')

Failing test case input:
3
0 18 100

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())

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

odd = []
even2 = []
even4 = []

for ai in a:
    if ai%4==0:even4.append(ai)
    elif ai%2==0:even2.append(ai)
    else:odd.append(ai)
if len(even4)>=len(odd):print('Yes')
elif len(even4)+1==len(odd) and len(even2)==0:print('Yes')
else:print('No')

Problem: p03637
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().rstrip().split(" ")))
counter = [0,0,0]
for i in a:
    if i % 4 == 0:
        counter[2] += 1
    elif i % 2 == 0:
        counter[1] += 1
    else:
        counter[0] += 1
p = (max(counter[1] - 1,0)) + (counter[2] + 1)

if p >= counter[0]:
    print("Yes")
else:
    print("No")


Failing test case input:
6
6 7 0 8 3 5

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int,input().rstrip().split(" ")))
counter = [0,0,0]
for i in a:
    if i % 4 == 0:
        counter[2] += 1
    elif i % 2 == 0:
        counter[1] += 1
    else:
        counter[0] += 1
counter[0] += min(1,counter[1])

if counter[2] + 1 >= counter[0]:
    print("Yes")
else:
    print("No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = list(map(int, input().split()))

    count_4 = 0
    count_2 = 0
    for i in range(N):
        if a[i]%4 == 0:
            count_4 += 1
        elif a[i]%2 == 0:
            count_2 += 1
    odd = N - count_4 - count_2
    if odd <= count_4:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

Failing test case input:
3
1 0 -5

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    a = list(map(int, input().split()))

    count_4 = 0
    count_2 = 0
    for i in range(N):
        if a[i]%4 == 0:
            count_4 += 1
        elif a[i]%2 == 0:
            count_2 += 1
    odd = N - count_4 - count_2
    if count_2 == 0:
        if odd - 1 <= count_4:
            print("Yes")
        else:
            print("No")
    else:
        if odd <= count_4:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
    main()

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections


n = int(input())
a = list(map(int,input().split()))
li = []
li2 = []
li4 = []
for i in range(n):
    if a[i]%4 == 0:
        li4.append(a[i])
    elif a[i]%2 == 0:
        li2.append(a[i])
    else:
        li.append(a[i])
if len(li2) == 1:
    li.append(2)
if len(li4)>=len(li):
    print("Yes")
else:
    print("No")

Failing test case input:
3
1 -3 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections


n = int(input())
a = list(map(int,input().split()))
n1 = 0
n2 = 0
n4 = 0
for i in range(n):
    if a[i]%4 == 0:
        n4+=1
    elif a[i]%2 == 0:
        n2 +=1
    else:
        n1+=1

if n2 == 1:
    n2 = 0

if n4*2 + n2 >= n or n4*2 + 1 == n:
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

cnt4 = 0
cnt2 = 0
for a in A:
    if a % 4 == 0:
        cnt4 += 1
    elif a % 2 == 0:
        cnt2 += 1

ans = "No"

if cnt4*2 >= N: 
    ans =  "Yes"
elif cnt4 > 0: 
    if N - cnt4*2 < cnt2*2:
        ans = "Yes"
else: 
    if N == cnt2*2:
        ans = "Yes"

print(ans)

Failing test case input:
3
3 -8 -1

Expected output:
Yes


Actual output:
No


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

cnt4 = 0
cnt2 = 0
for a in A:
    if a % 4 == 0:
        cnt4 += 1
    elif a % 2 == 0:
        cnt2 += 1

ans = "No"

if N - cnt4*2 <= 1:
    ans =  "Yes"
elif N - cnt4*2 > 1:
    if N - cnt4*2 <= cnt2:
        ans = "Yes"
elif N - cnt4*2 == N:
    if N == cnt2*2:
        ans = "Yes"

print(ans)
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

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


i, j, k = 0, 0, 0

for n in range(N):
    if a[n] % 4 == 0:
        i += 1
    elif a[n] % 2 == 0:
        j += 1
    else:
        k += 1

print(i, j, k)

if k >= i + 2:
    print('No')
elif k == i + 1 and j >= 1:
    print('No')
else:
    print('Yes')

Failing test case input:
3
-1 -2 0

Expected output:
Yes


Actual output:
1 1 1
Yes


Fixed submission (verdict: Accepted):

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


i, j, k = 0, 0, 0

for n in range(N):
    if a[n] % 4 == 0:
        i += 1
    elif a[n] % 2 == 0:
        j += 1
    else:
        k += 1

if k >= i + 2:
    print('No')
elif k == i + 1 and j >= 1:
    print('No')
else:
    print('Yes')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
odds = len(list(filter(lambda x: x%2 == 1,A)))
baisu4 = len(list(filter(lambda x: x%4 == 0,A)))
evens = N-odds
if odds == 0:print('Yes')
elif odds%2 == 1 and baisu4 >= odds:
    print('Yes')
elif odds%2 == 0 and baisu4 >= odds:
    print('Yes')
else:
    print("No")



Failing test case input:
3
1 0 -3

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
odds = len(list(filter(lambda x: x%2 == 1,A)))
baisu4 = len(list(filter(lambda x: x%4 == 0,A)))
evens = N-odds
if odds == 0:print('Yes')
elif evens == baisu4 and baisu4+1 >= odds:
    print('Yes')
elif evens != baisu4 and baisu4 >= odds:
    print('Yes')
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(i) for i in input().split()]
cnta = 0
cntb = 0

for i in range(n):
    if a[i]%4==0:
        cnta += 1
    elif a[i]%2 == 0:
        cntb += 1
else:
    if cntb == 1:
        cntb = 0
        
if cnta*3+cntb >= n:
    ans = "Yes"
else:
    ans = "No"

print(ans)

Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(i) for i in input().split()]
cnta = 0
cntb = 0

for i in range(n):
    if a[i]%4 == 0:
        cnta += 1
    elif a[i]%2 == 0:
        cntb += 1

if 2*cnta+1 >= n or 2*cnta + cntb >= n:
    ans = "Yes"
else:
    ans = "No"

print(ans)
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys


def main():
    args = sys.stdin.readline().split()
    N = int(args[0])
    A = map(int, input().split())

    non_factor_cnt = 0
    factor_of_two_cnt = 0
    factor_of_four_cnt = 0
    for num in A:
        remainder = num % 4
        if remainder != 0:
            if remainder == 2:
                factor_of_two_cnt += 1
            else:
                non_factor_cnt += 1
        else:
            factor_of_four_cnt += 1

    if factor_of_four_cnt >= non_factor_cnt: 
        print('Yes')
    else:
        print('No')

main()

Failing test case input:
3
1 -16 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys


def main():
    args = sys.stdin.readline().split()
    N = int(args[0])
    A = map(int, input().split())

    non_factor_cnt = 0
    factor_of_two_cnt = 0
    factor_of_four_cnt = 0
    for num in A:
        remainder = num % 4
        if remainder != 0:
            if remainder == 2:
                factor_of_two_cnt += 1
            else:
                non_factor_cnt += 1
        else:
            factor_of_four_cnt += 1

    if factor_of_two_cnt == 0:
        if factor_of_four_cnt >= non_factor_cnt - 1:
            print('Yes')
            sys.exit()
    if factor_of_four_cnt >= non_factor_cnt: 
        print('Yes')
        sys.exit()
    print('No')

main()

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = [int(i) for i in input().split()]

cnt0 = 0
cnt2 = 0
cnt4 = 0

for i in range(n):
    if A[i] % 4 == 0:
        cnt4 += 1
    elif A[i] % 2 == 0:
        cnt2 += 1
    else:
        cnt0 += 1
        
if cnt4 >= cnt0:
    print('Yes')
else:
    print('No')

Failing test case input:
3
3 -8 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
A = [int(i) for i in input().split()]


cnt2 = 0
cnt4 = 0

for i in range(n):
    if A[i] % 4 == 0:
        cnt4 += 1
    elif A[i] % 2 == 0:
        cnt2 += 1

        
if cnt4*2 + cnt2 >= n or (cnt4 * 2 + 1) >= n:
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
a=list(map(int,input().split()))

k2=k4=0

for ai in a:
    if ai%4==0:
        k4+=1
    elif ai%2==0:
        k2+1

print('Yes' if k4*2+k2>=N else 'No')

Failing test case input:
3
1 10 100

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
a=list(map(int,input().split()))

k0=k1=k2=0
for ai in a:
    if ai%4==0:
        k2+=1
    elif ai%2==0:
        k1+=1
    else:
        k0+=1

if k1==0:
    f=k2*2+1>=N
else:
    f=k2*2+k1>=N

print('Yes' if f else 'No')
Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
a=list(map(int,input().split()))
l=[0]*N
for i in range(N):
    if a[i]%4:
        if a[i]%2:l[i]=1
        else:l[i]=2
    else:l[i]=4
print('Yes'if l.count(1)+(1 if l.count(2)else 0)<=l.count(4)else'No')

Failing test case input:
3
0 1 -2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N=int(input())
a=list(map(int,input().split()))
l=[0]*N
for i in range(N):
    if a[i]%4:
        if a[i]%2:l[i]=1
        else:l[i]=2
    else:l[i]=4
print('Yes'if l.count(1)+(1 if l.count(2)else 0)<=1+l.count(4)else'No')

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))

four=0
two=0
for i in range(n):
    if a[i]%4==0:
        four+=1
    elif a[i]%2==0:
        two+=1
two-=two%2
ans=four*3+two

if ans>=n:
    print("Yes")
else:
    print("No")

Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


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

four=0
two=0
for i in range(n):
    if a[i]%4==0:
        four+=1
    elif a[i]%2==0:
        two+=1
if two>0:
    ans=four*2+two
else:
    ans=four*2+1

if ans>=n:
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(x) for x in input().split()]
D = [0]*5
for a in A:
    if a % 4 == 0:
        D[4] += 1
    elif a % 2 == 0:
        D[2] += 1
    else:
        D[1] += 1

if D[4] + 1 >= D[1]:
    print("Yes")
else:
    print("No")








Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
A = [int(x) for x in input().split()]
D = [0]*5
for a in A:
    if a % 4 == 0:
        D[4] += 1
    elif a % 2 == 0:
        D[2] += 1
    else:
        D[1] += 1

if D[2] > 0:
    if D[4] >= D[1]:
        print("Yes")
    else:
        print("No")
else:
    if D[4] + 1 >= D[1]:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

others_count = N - four_count - two_count

if two_count:
    if others_count <= four_count:
        print("Yes")
    else:
        print("No")
else:
    if others_count < four_count:
        print("Yes")
    else:
        print("No")
    

Failing test case input:
3
3 -8 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

others_count = N - four_count - two_count

if two_count:
    if others_count <= four_count:
        print("Yes")
    else:
        print("No")
else:
    if others_count <= four_count + 1:
        print("Yes")
    else:
        print("No")
Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
li = list(map(int,input().split()))
lis = []
x = 0
y = 0
z = 0
for i in range(n):
    if li[i] % 4 == 0:
        x += 1
    elif li[i] % 2 == 0:
        y = 1
    else:
        z += 1
if y == 0:
    if x >= z + 1:
        print("Yes")
    else:
        print("No")
else:
    if x >= z:
        print("Yes")
    else:
        print("No")


Failing test case input:
3
0 -1 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
li = list(map(int,input().split()))
lis = []
x = 0
y = 0
z = 0
for i in range(n):
    if li[i] % 4 == 0:
        x += 1
    elif li[i] % 2 == 0:
        y = 1
    else:
        z += 1
if y == 0:
    if x + 1 >= z:
        print("Yes")
    else:
        print("No")
else:
    if x >= z:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
cnt1=0
cnt4=0
if n==2:
    if a[0]*a[1]%4==0:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
for i in range(n):
    if a[i]%4==0:
        cnt4+=1
    else:
        cnt1+=1
if 2 in a:
    if cnt4 >= cnt1:
        print('Yes')
    else:
        print('No')
else:
    if cnt4+1 >= cnt1:
        print('Yes')
    else:
        print('No')



Failing test case input:
6
6 7 0 8 6 9

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
cnt1=0
cnt2=0
cnt4=0
if n==2:
    if a[0]*a[1]%4==0:
        print('Yes')
        exit()
    else:
        print('No')
        exit()
for i in range(n):
    if a[i]%4==0:
        cnt4+=1
    elif a[i]%2==0:
        cnt2+=1
    else:
        cnt1+=1
if cnt1 == 0 or (cnt2 == 0 and cnt4+1 >= cnt1) or (cnt2 >= 1 and cnt4 >= cnt1):
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
four, odd = 0, 0
for a in A:
    if a%4 == 0:
        four += 1
    elif a%2 == 1:
        odd += 1
result = 'No' if four > odd else 'Yes'
print(result)


Failing test case input:
4
-1 2 3 7

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
four, two, odd = 0, 0, 0
for a in A:
    if a%4 == 0:
        four += 1
    elif a%2 == 0:
        two += 1
    else:
        odd += 1
result = 'Yes' if four + 1 >= odd + bool(two) else 'No'
print(result)
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

f = 0
d = 0
for x in a:
    if x % 4 == 0:
        f += 1
    elif x % 2 == 0:
        d += 1

if d == 1:
    d = 0

n -= f * 3 + d

if n > 0:
    print('No')
else:
    print('Yes')

Failing test case input:
6
5 7 0 0 6 9

Expected output:
No


Actual output:
Yes


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

f = 0
d = 0
for x in a:
    if x % 4 == 0:
        f += 1
    elif x % 2 == 0:
        d += 1

if 0 < d < n:
    d -= 1

if n > f * 2 + 1 + d:
    print('No')
else:
    print('Yes')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
A=list(map(int,input().split()))

d={
    2:0,
    4:0,
    1:0
}

for a in A:
    if a%4==0:
        d[4]+=1
    elif a%2==0:
        d[2]+=1
    else:
        d[1]+=1

four=d[4]
odd=d[1] + int((d[2]+2-1)/2)

if odd<=four+1:     
    print("Yes")
else:
    print("No")

Failing test case input:
3
2 10 110

Expected output:
Yes


Actual output:
No


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

d={
    2:0,
    4:0,
    1:0
}

for a in A:
    if a%4==0:
        d[4]+=1
    elif a%2==0:
        d[2]+=1
    else:
        d[1]+=1

four=d[4]
odd=d[1]
if d[2]>2:
    four+=1
    odd+=2
else:
    odd+=int((d[2]+2-1)/2)

if odd<=four+1:     
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

c_4 = 0
c_2 = 0
odd = 0
for i in range(n):
    if a[i]%4==0:
        c_4+=1
    elif a[i]%2==1:
        odd += 1
    else:
        c_2 += 1
if odd <= c_4:
    print("Yes")
elif odd+1 == c_4 and c_2==0:
    print("Yes")
else:
    print("No")

Failing test case input:
3
1 -5 0

Expected output:
Yes


Actual output:
No


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

c_4 = 0
c_2 = 0
odd = 0
for i in range(n):
    if a[i]%4==0:
        c_4+=1
    elif a[i]%2==1:
        odd += 1
    else:
        c_2 += 1
if odd <= c_4:
    print("Yes")
elif odd <= c_4+1 and c_2==0:
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
a2 = len([i % 2 == 0 and i % 4 != 0 for i in a])
a4 = [i % 4 for i in a].count(0)
a0 = n - a2 - a4
if a2 > 0:
    if a0 < a4+1:
        ans = "Yes"
    else:
        ans = "No"
else:
    if a0 <= a4:
        ans = "Yes"
    else:
        ans = "No"
print(ans)

Failing test case input:
4
0 2 3 7

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int,input().split()))
a2 = [i % 2 for i in a].count(0)
a4 = [i % 4 for i in a].count(0)
a0 = n - a2
a2 -= a4
if a2 == 0:
    if a0 <= a4+1:
        ans = "Yes"
    else:
        ans = "No"
else:
    if a0 <= a4:
        ans = "Yes"
    else:
        ans = "No"
print(ans)
Problem: p03637
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a_lst = list(map(int, input().split()))

cnt = 0
for a in a_lst:
  if a % 4 == 0:
    cnt += 1
  else:
    pass
if cnt == 0:
  print('No')
else:
  print('Yes')

Failing test case input:
3
2 10 110

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a_lst = list(map(int, input().split()))

cnt = 0
for a in a_lst:
  if a % 4 == 0:
    cnt += 2
  elif a % 2 == 0:
    cnt += 1
  else:
    pass

if cnt 
  print('Yes')
else:
  print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
di, tetra = 0, 0

for i in a:
    if i%4 == 0:
        tetra += 1
    elif i%4 == 2:
        di += 1

if tetra*2+di >= n:
    print("Yes")
else:
    print("No")

Failing test case input:
3
0 -1 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
di, tetra = 0, 0

for i in a:
    if i%4 == 0:
        tetra += 1
    elif i%4 == 2:
        di += 1

if tetra*2+di >= n or tetra*2+1 >= n:
    print("Yes")
else:
    print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero == odd:
    print('Yes')
else:
    print('No')

Failing test case input:
4
2 2 0 4

Expected output:
Yes


Actual output:
No


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

zero = 0
two = 0
odd = 0

for i in range(len(a)):
    if a[i] % 4 == 1 or a[i] % 4 == 3:
        odd = odd + 1
    elif a[i] % 4 == 0:
        zero = zero + 1
    else:
        two = two + 1
        
if zero >= odd -1 and two == 0:
    print('Yes')
elif zero >= odd:
    print('Yes')
else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


n = int(input())
arr = list(map(int, input().split()))
dividable4 = 0
dividable2 = 0
odds = 0
for a in arr:
  if a % 4 == 0:
    dividable4 += 1
  elif a % 2 == 1:
    odds += 1
  elif a % 2 == 0:
    dividable2 += 1
print("Yes" if odds <= dividable4 or (odds - dividable4 == 1 and dividable2 == 9)  else "No")

Failing test case input:
3
0 -1 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):


n = int(input())
arr = list(map(int, input().split()))
dividable4 = 0
dividable2 = 0
odds = 0
for a in arr:
  if a % 4 == 0:
    dividable4 += 1
  elif a % 2 == 1:
    odds += 1
  elif a % 2 == 0:
    dividable2 += 1
print("Yes" if odds <= dividable4 or (odds - dividable4 == 1 and dividable2 == 0)  else "No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
  n=int(input())
  a=tuple(map(int,input().split()))
  cnt2,cnt4=0,0
  for i in a:
    cnt2+=1 if i%2==0 and i%4>0 else 0
    cnt4+=1 if i%4==0 else 0
  print('Yes' if (n-cnt2)/2<=cnt4 else 'No')
if __name__=='__main__':
  main()

Failing test case input:
3
0 -1 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def main():
  n=int(input())
  a=tuple(map(int,input().split()))
  cnt2,cnt4=0,0
  for i in a:
    cnt2+=1 if i%2==0 and i%4>0 else 0
    cnt4+=1 if i%4==0 else 0
  print('Yes' if (cnt2>=2 and cnt4>=(n-cnt2)/2) or (cnt2<2 and cnt4>=n
if __name__=='__main__':
  main()

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
an = list(map(int, input().split()))
four = 0
odd = 0
for a in an:
    if a % 2 == 1:
        odd += 1
    elif a % 4 == 0:
        four += 1
print('Yes' if 2*odd-2 <= four or odd+four == N else 'No')


Failing test case input:
3
1 1 -3

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
an = list(map(int, input().split()))
four = 0
odd = 0
for a in an:
    if a % 2 == 1:
        odd += 1
    elif a % 4 == 0:
        four += 1
print('Yes' if odd <= four or N

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split(' ')))
L = []
for i in A:
  if i % 2 != 0:
    L.append(0)
  elif i % 4 == 0:
    L.append(2)
  else:
    L.append(1)
if L.count(2) == 0:
  if L.count(0) -1  <= L.count(2):
    print('Yes')
  else:
    print('No')
else:
  if L.count(0) <= L.count(2):
    print('Yes')
  else:
    print('No')



Failing test case input:
3
-1 1 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split(' ')))
L = []
for i in A:
  if i % 2 != 0:
    L.append(0)
  elif i % 4 == 0:
    L.append(2)
  else:
    L.append(1)
if L.count(1) == 0:
  if L.count(0) -1  <= L.count(2):
    print('Yes')
  else:
    print('No')
else:
  if L.count(0) <= L.count(2):
    print('Yes')
  else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N =int(input())
A = list(map(int,input().split()))
cnt4 = 0
cnt2 = 0
for a in A:
    if a % 4 == 0:
        cnt4 += 1
    elif a % 2 == 0:
        cnt2 += 1
com = math.ceil((N - cnt2 + (cnt2 % 2)) / 3)
if com <= cnt4:
    print("Yes")
else:
    print("No")

Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N =int(input())
A = list(map(int,input().split()))
cnt4 = 0
cnt2 = 0
for a in A:
    if a % 4 == 0:
        cnt4 += 1
    elif a % 2 == 0:
        cnt2 += 1
if cnt2 >= 2:
    com = N - cnt2 + 1
else:
    com = N
if com 
    print("Yes")
else:
    print("No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
p=0
f=0
for ai in a:
    if ai%2!=0:
        p+=1
    else:
        if ai/2%2==0:
            f+=1
if f==0:
    print('No')
elif f==1:
    if n>3:
        print('No')
    else:
        print('Yes')
elif p-2>f:
    print('No')
else:
    print('Yes')

Failing test case input:
3
2 10 110

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
p=0
f=0
for ai in a:
    if ai%2==1:
        p+=1
    else:
        if ai/2%2==0:
            f+=1
if p==0:
    print('Yes')
elif p>f:
    if n%2==1 and 2*f+1==n:
        print('Yes')
    else:
        print('No')
else:
    print('Yes')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def m():
    N = int(input())
    a = list(map(int, input().split()))
    fours = []
    twes = []
    others = []
    for i in range(N):
        if a[i] % 4 == 0:
            fours.append(a[i])
            continue

        if a[i] % 2 == 0:
            twes.append(a[i])
            continue
        others.append(a[i])

    len4s = len(fours)
    len2s = len(twes)
    others = len(others)
    if (others + len2s) <= len4s + 1:
        return 'Yes'
    if others <= len4s + 1:
        if len2s % 2 == 0:
            return 'Yes'
    return 'No'


print(m())


Failing test case input:
6
2 7 2 12 2 8

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def m():
    N = int(input())
    a = list(map(int, input().split()))
    fours = []
    twes = []
    others = []
    for i in range(N):
        if a[i] % 4 == 0:
            fours.append(a[i])
            continue

        if a[i] % 2 == 0:
            twes.append(a[i])
            continue
        others.append(a[i])

    len4s = len(fours)
    len2s = len(twes)
    others = len(others)
    if len2s:
        others += 1
    if others <= len4s + 1:
        return 'Yes'
    return 'No'


print(m())

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

input()
xs = map(int, input().split())

n1, n4 = 0, 0

for x in xs:
    if x % 4 == 0:
         n4 += 1
    elif x % 2 == 0:
         continue
    else:
         n1 += 1

print("Yes" if n4 >= n1 else "No")








Failing test case input:
3
1 -5 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):

input()
xs = map(int, input().split())

n1, n2, n4 = 0, 0, 0

for x in xs:
    if x % 4 == 0:
        n4 += 1
    elif x % 2 == 0:
        n2 += 1
    else:
        n1 += 1

if n2 == 0:
    print("Yes" if n4 >= n1 - 1 else "No")
else:
    print("Yes" if n4 >= n1 else "No")
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

a, b, c = 0, 0, 0

for e in A:
    if e % 2 == 0:
        if e % 4 == 0:
            c += 1
        else:
            b += 1
    else:
        a += 1

print('Yes' if c * 2 + 1 - b % 2 - a >= 0 else 'No')


Failing test case input:
6
6 7 0 8 3 9

Expected output:
No


Actual output:
Yes


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

a, b, c = 0, 0, 0

for e in A:
    if e % 2 == 0:
        if e % 4 == 0:
            c += 1
        else:
            b += 1
    else:
        a += 1

print('Yes' if c - a + (b == 0) >= 0 else 'No')

Problem: p03637
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
f = 0
t = 0
k = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 0:
        t += 1
    else:
        k += 1


if t > 0:
    if f >= k:
        print("Yes")
    else:
        print("No")
else:
    if f >= k + 1:
        print("Yes")
    else:
        print("No")


Failing test case input:
3
3 -4 -1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
f = 0
t = 0
k = 0
for i in a:
    if i % 4 == 0:
        f += 1
    elif i % 2 == 0:
        t += 1
    else:
        k += 1

if t > 0:
    if f >= k:
        print("Yes")
    else:
        print("No")
else:
    if f + 1 >= k:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int()
lst = list(map(int,input().split()))

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    sonota = len(lst) - four - two

    if sonota < four + 1:
        return "Yes"
    elif (four + 1 - sonota == 0) and (two == 0):
        return "Yes"
    else:
        return "No"

print(solve(lst))



Failing test case input:
3
1 -3 -2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
def count_four(lst):
    counter = 0
    for i in lst:
        if i%4 == 0:
            counter += 1
    return counter

def count_two(lst):
    counter = 0
    for i in lst:
        if i%2 == 0:
            counter += 1
    return counter

n = int(input())
lst = list(map(int,input().split()))

def solve(lst):
    four = count_four(lst)
    two = count_two(lst) - four
    others = n - four - two

    if two == 0:
        if four + 1 - others >= 0:
            return "Yes"
        else:
            return "No"

    if two > 0:
        two = 1
        if four + 1 - others - two >= 0:
            return "Yes"
        else:
            return "No"


print(solve(lst))
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
a=0
b=0
c=0
for i in range(n):
    if i%4==0:
        a+=1
    elif i%2==0:
        b+=1
    else:
        c+=1
if c==0:
    if complex<=a+1:
        print("Yes")
    else:
        print("No")
else:
    if c<=a:
        print("Yes")
    else:
        print("No")

Failing test case input:
3
3 -5 -1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
num2=0
num4=0
num0=0
for i in a:
    if i%4==0:
        num4+=1
    elif i%2==0:
        num2+=1
    else:
        num0+=1
if num2==0:
    if num0<=num4+1:
        print("Yes")
    else:
        print("No")
else:
    if num0<=num4:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):








N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

const = N 

if const > four_count:
    if const - four_count <= two_count:
        print("Yes")
    else:
        print("No")
elif const == four_count:
    print("Yes")
else:
    print("Yes")

Failing test case input:
6
3 7 2 8 2 8

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
input_list = [int(i) for i in input().split()]
four_count = 0
two_count = 0

for i in input_list:
    if i % 4 == 0:
        four_count += 1
    elif i % 2 == 0:
        two_count += 1

others_count = N - four_count - two_count

if two_count:
    if others_count <= four_count:
        print("Yes")
    else:
        print("No")
else:
    if others_count <= four_count + 1:
        print("Yes")
    else:
        print("No")

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N =input()
a =input().split()
b,c,d =0,0,0
for i in range(0,int(N)-1):
    hoge = int(a[i])%2
    if hoge ==0:
        b =b+1
for i in range(0,int(N)-1):
    hoge = int(a[i])%4
    if hoge ==0:
        c =c+1
d = b-c
if d ==0:
    if c-(int(N)-b)+1>=0:
        print('Yes')
    else:
        print('No')
else:
    if c-(int(N)-b)>=0:
        print('Yes')
    else:
        print('No')


Failing test case input:
3
-1 -1 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N =input()
a =input().split()
b,c,d =0,0,0
for i in range(0,int(N)):
    hoge = int(a[i])%2
    if hoge ==0:
        b =b+1
for i in range(0,int(N)):
    hoge = int(a[i])%4
    if hoge ==0:
        c =c+1
d = b-c
if d ==0:
    if c-(int(N)-b)+1>=0:
        print('Yes')
    else:
        print('No')
else:
    if c-(int(N)-b)>=0:
        print('Yes')
    else:
        print('No')
Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split(' ')))
L = []
for i in A:
  if i % 2 != 0:
    L.append(0)
  elif i % 4 == 0:
    L.append(2)
  else:
    L.append(1)
if L.count(2) == 0:
  if L.count(0)   <= L.count(2):
    print('Yes')
  else:
    print('No')
else:
  if L.count(0) - 1 <= L.count(2):
    print('Yes')
  else:
    print('No')



Failing test case input:
6
4 7 0 -1 6 9

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split(' ')))
L = []
for i in A:
  if i % 2 != 0:
    L.append(0)
  elif i % 4 == 0:
    L.append(2)
  else:
    L.append(1)
if L.count(1) == 0:
  if L.count(0) -1  <= L.count(2):
    print('Yes')
  else:
    print('No')
else:
  if L.count(0) <= L.count(2):
    print('Yes')
  else:
    print('No')

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def m():
    N = int(input())
    a = list(map(int, input().split()))
    fours = []
    twes = []
    others = []
    for i in range(N):
        if a[i] % 4 == 0:
            fours.append(a[i])
            continue

        if a[i] % 2 == 0:
            twes.append(a[i])
            continue
        others.append(a[i])

    len4s = len(fours)
    len2s = len(twes)
    others = len(others)
    if (others + len2s) + 1 <= len4s:
        return 'Yes'
    if others + 1 <= len4s:
        if len2s % 2 == 0:
            return 'Yes'
    return 'No'

print(m())

Failing test case input:
6
2 7 1 8 2 8

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
def m():
    N = int(input())
    a = list(map(int, input().split()))
    fours = []
    twes = []
    others = []
    for i in range(N):
        if a[i] % 4 == 0:
            fours.append(a[i])
            continue

        if a[i] % 2 == 0:
            twes.append(a[i])
            continue
        others.append(a[i])

    len4s = len(fours)
    len2s = len(twes)
    others = len(others)
    if len2s:
        others += 1
    if others <= len4s + 1:
        return 'Yes'
    return 'No'


print(m())

Problem: p03637
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
d = {1:0, 2:0, 4:0}
for i in a:
  if i % 4 == 0:
    d[4] += 1
  elif i % 2 == 0:
    d[2] += 1
  else:
    d[1] += 1
print(d)
if (d[2] >= 1 and d[1] <= d[4]) or d[1]-1 <= d[4]:
  print("Yes")
else:
  print("No")


Failing test case input:
3
1 28 010

Expected output:
Yes


Actual output:
{1: 1, 2: 1, 4: 1}
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
d = {1:0, 2:0, 4:0}
for i in a:
  if i % 4 == 0:
    d[4] += 1
  elif i % 2 == 0:
    d[2] += 1
  else:
    d[1] += 1
if d.get(2, 0) >= 1:
  d[1] += 1
if d.get(1, 0) <= d.get(4, 0)+1:
  print("Yes")
else:
  print("No")