ZhenlongDai/ACPR huggingface dataset:
Problem: p03438
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

result = False

big_A = sum([ai - bi for ai, bi in zip(a,b) if ai > bi])
big_B = sum([(bi - ai) / 2 for ai, bi in zip(a,b) if bi > ai])

if big_A < big_B:
  result = True

ans = "Yes" if result else "No"
print(ans)

Failing test case input:
3
0 -2 2
0 2 0

Expected output:
Yes


Actual output:
No


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

result = False

big_a = sum([ai - bi for ai, bi in zip(a,b) if ai > bi])
big_b = sum([(bi - ai) 
sum_diff = sum(b) - sum(a)

if big_a <= big_b:
  result = True

ans = "Yes" if result else "No"
print(ans)

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
if __name__ == '__main__':
    N = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    b_minus_a = [tmp_b - tmp_a for tmp_a, tmp_b in zip(a, b)]

    if 2 * -sum([_ for _ in b_minus_a if _ < 0]) <= sum([_ - 1 for _ in b_minus_a if _ > 1]):
        print('Yes')
    else:
        print('No')


Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
if __name__ == '__main__':
    N = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    b_minus_a = [tmp_b - tmp_a for tmp_a, tmp_b in zip(a, b)]

    if 2 * -sum([_ for _ in b_minus_a if _ < 0]) <= sum([_ - 1 for _ in b_minus_a if _ > 1 and _ % 2 == 1]) + sum(
            [_ for _ in b_minus_a if _ > 1 and _ % 2 == 0]):
        print('Yes')
    else:
        print('No')

Problem: p03438
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

operation_num = sum(b) - sum(a)
x = 0 
y = 0 

for i in range(n):
    x += b[i]-a[i]
    y += max(a[i]-b[i], 0)
    y += max(math.ceil((b[i]-a[i])/2), 0)

if x - y < 0:
    print('No')
else:
    print('Yes')


Failing test case input:
3
1 0 -1
-1 3 2

Expected output:
Yes


Actual output:
No


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

operation_num = sum(b) - sum(a)
x = 0 
y = 0
z = 0
for i in range(n):
    x += b[i]-a[i]
    y += max(a[i]-b[i], 0)
    z += max(math.ceil((b[i]-a[i])/2), 0)

if x - y < 0 or x - z < 0:
    print('No')
else:
    print('Yes')

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

x=sum(b)-sum(a)
y=0
for i in range(n):
    if a[i]<b[i]:
        y+=-(a[i]-b[i])
print("No" if x<y else "Yes")

Failing test case input:
3
0 0 1
-1 3 1

Expected output:
Yes


Actual output:
No


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

x=sum(b)-sum(a)
y=0
for i in range(n):
    if a[i]<b[i]:
        y+=-((a[i]-b[i])
print("No" if x<y else "Yes")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N2 = int(input())

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

a.sort()
b.sort()
a.reverse()
b.reverse()

P = 0
N = 0

for i in range(N2):
    if b[i]-a[i]>=0:
        P = P + b[i]-a[i]
    else:
        N = N + a[i]-b[i]
       
P2 = P-2*N
        
if P2>=0:
    print('Yes')
else:
    print('No')
        

Failing test case input:
5
3 1 7 1 5
2 7 1 8 2

Expected output:
No


Actual output:
Yes


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

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

P = 0
N = 0

for i in range(N2):
    if b[i]-a[i]>=0:
        P = P + ((b[i]-a[i])
    else:
        N = N + a[i]-b[i]
       
P2 = P-2*N
        
if P2>=0:
    print('Yes')
else:
    print('No')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
k = sum(B)-sum(A)


if k < 0:
    print('No')
else:
    cnt = 0
    for a, b in zip(A, B):
        if a < b:
            cnt += -(a-b)
        elif b < a:
            cnt += a-b
    if cnt <= k:
        print('Yes')
    else:
        print('No')

Failing test case input:
3
0 -1 0
-2 3 1

Expected output:
Yes


Actual output:
No


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


if k < 0:
    print('No')
else:
    cnt_a = 0
    cnt_b = 0
    for a, b in zip(A, B):
        if a < b:
            x, y = divmod((b-a), 2)
            cnt_a += x+y
            cnt_b += y
        elif b < a:
            cnt_b += a-b
    if max(cnt_a, cnt_b) <= k:
        print('Yes')
    else:
        print('No')

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

b=input().split(" ")
b=list(map(int,b))
counta=0
countb=0
same=0
for i in range(n):
    if a[i]<b[i]: 
        temp=b[i]-a[i] 
        if temp%2==0:
            counta+=int(temp/2)
        else:
            counta+=int((temp+1)/2)
            countb+=1
            
    if a[i]>b[i]:
        temp=a[i]-b[i]
        countb+=temp
        counta-=temp
    
    
if counta==countb:
    print("Yes")
else:
    print("No")
    

Failing test case input:
3
1 0 -1
-1 3 2

Expected output:
Yes


Actual output:
No


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

b=input().split(" ")
b=list(map(int,b))
counta=0
countb=0
for i in range(n):
    if a[i]<b[i]: 
        temp=b[i]-a[i] 
        if temp%2==0:
            counta+=int(temp/2)
            
        else:
            counta+=int((temp+1)/2)
            countb+=1
            
    if a[i]>b[i]:
        temp=a[i]-b[i]
        countb+=temp
       


if counta>=countb:
    print("Yes")
else:
    print("No")
Problem: p03438
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,*a=map(int,open(0).read().split())
u=d=z=0
for i,j in zip(a[:n],a[n:]):
    if j-i>0:u+=j-i
    elif j-i==0:z+=1
    else:d+=j-i
print("Yes" if u+2*d>0 else "No")

Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n,*a=map(int,open(0).read().split())
u=d=z=r=0
for i,j in zip(a[:n],a[n:]):
    if j-i>0:u+=(j-i)
    elif j-i==0:z+=1
    else:d+=j-i
print("Yes" if u+2*d>=0 else "No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
ai = lambda: list(map(int, input().split()))

n = int(input())
a = ai()
b = ai()
d = [b[i] - a[i] for i in range(n)]
if sum(i for i in d if i>0) > sum(i for i in d if i<0)*2:
    print('Yes')
else:
    print('No')


Failing test case input:
5
3 8 0 8 2
0 2 1 0 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
ai = lambda: list(map(int, input().split()))

n = int(input())
a = ai()
b = ai()
d = [b[i] - a[i] for i in range(n)]
s,t = 0,0
for i in d:
    if i > 0:
        s += -(-i
        t += i%2
    else:
        t += -i
if s<t:
    print('No')
else:
    print('Yes')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if abs(suma - sumb) >= N:
            print("No")
        else:
            print("Yes")
                


Failing test case input:
3
1 2 3
5 2 2

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
from math import ceil

N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += ceil((B[i] - A[i]) / 2)

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

total = sum(A) - sum(B)
cnt1, cnt2 = 0,0
for i in range(n):
    if A[i] > B[i]:
        cnt1 += A[i] - B[i]
    elif A[i] < B[i]:
        cnt2 += math.floor((B[i]-A[i])/2)
if max(cnt1, cnt2) <= total:
    print('Yes')
else:
    print('No')

Failing test case input:
3
1 2 2
5 2 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math

n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
total = sum(B) - sum(A)
cnt1, cnt2 = 0,0

for i in range(n):
    if A[i] > B[i]:
        cnt1 += A[i] - B[i]
    elif A[i] < B[i]:
        cnt2 += math.ceil((B[i]-A[i])/2)

if max(cnt1, cnt2) <= total:
    print('Yes')
else:
    print('No')
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
sum_A = sum(A)
sum_B = sum(B)
cnt1 = sum_B - sum_A
cnt2 = 0
for a, b in zip(A, B):
    if a > b:
        cnt2 += a - b
    elif a < b:
        cnt2 += math.ceil((b - a) / 2)
if cnt1 >= cnt2:
    print("Yes")
else:
    print("No")

Failing test case input:
3
1 0 -1
-1 3 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
sum_A = sum(A)
sum_B = sum(B)
cnt1 = sum_B - sum_A
cnt2 = 0
for a, b in zip(A, B):
    
    
    if a < b:
        cnt2 += math.ceil((b - a) / 2)

if cnt1 >= cnt2:
    print("Yes")
else:
    print("No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
k = sum(B)-sum(A)


if k < 0:
    print('No')
else:
    cnt_a = 0
    cnt_b = 0
    for a, b in zip(A, B):
        if a < b:
            cnt_a += -(a-b)
        elif b < a:
            cnt_b += a-b
    if max(cnt_a, cnt_b) <= k:
        print('Yes')
    else:
        print('No')


Failing test case input:
3
0 -1 0
-2 3 1

Expected output:
Yes


Actual output:
No


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


if k < 0:
    print('No')
else:
    cnt_a = 0
    cnt_b = 0
    for a, b in zip(A, B):
        if a < b:
            x, y = divmod((b-a), 2)
            cnt_a += x+y
            cnt_b += y
        elif b < a:
            cnt_b += a-b
    if max(cnt_a, cnt_b) <= k:
        print('Yes')
    else:
        print('No')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum_c = 0
for i in range(n):
    if (a[i] - b[i]) > 0:
        sum_c += (a[i]- b[i])
    else:
        sum_c += (b[i] - a[i]) / 2
sum_a = 0
sum_b = 0
for i in range(n):
    sum_a += a.pop(0)
    sum_b += b.pop(0)
if sum_c <= (sum_b - sum_a):
    print ('Yes')
else:
    print ('No')

Failing test case input:
3
0 -2 2
0 2 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a = a.copy()
b = b.copy()
sum_c = 0
for i in range(n):
    if (a[i] - b[i]) < 0:
        sum_c += int(((b[i] - a[i]) / 2 ) + 0.5)
sum_a = 0
sum_b = 0
for i in range(n):
    sum_a += a.pop(0)
    sum_b += b.pop(0)
if sum_c <= (sum_b - sum_a):
    print ('Yes')
else:
    print ('No')
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
    elif c > 0:
        plus+=c

print("Yes" if minus > plus*2 else "No")


Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0;co=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
        if c%2==1:
            co+=1
    elif c > 0:
        plus+=c

print("Yes" if minus >= plus*2+co else "No")

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

sumA = 0
sumB = 0

for i in range(n):
    sumA = A[i] + sumA
    sumB = B[i] + sumB

if sumA <= sumB:
    print("Yes")
else:
    print("No")


Failing test case input:
5
3 1 8 1 5
2 7 1 8 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sumA = 0
sumB = 0
sumAB = 0

for i in range(n):
    sumA += A[i]
    sumB += B[i]

for i in range(n):
    if A[i] < B[i]:
        sumAB += int((B[i] - A[i]) / 2 + 0.5)

if sumAB <= sumB - sumA:
    print("Yes")
else:
    print("No")

Problem: p03438
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):


import math

import itertools
from collections import deque
from collections import Counter
import heapq


import bisect
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
sa=sum(a)
sb=sum(b)
if sb<sa:
    print("No")
else:
    cnt=sb-sa
    resa=0
    resb=0
    for i in range(n):
        if b[i]<a[i]:
            resa+=a[i]-b[i]
        else:
            resb+=b[i]-a[i]
    if resa+resb/2>=cnt:
        print("No")
    else:
        print("Yes")

Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):


import math

import itertools
from collections import deque
from collections import Counter
import heapq


import bisect
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
sa=sum(a)
sb=sum(b)
if sb<sa:
    print("No")
else:
    cnt=sb-sa
    resa=0
    resb=0
    for i in range(n):
        if b[i]<a[i]:
            resa+=a[i]-b[i]
        else:
            resb+=math.ceil((b[i]-a[i])/2)
    if resa>cnt or resb>cnt:
        print("No")
    else:
        print("Yes")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))
cnt = 0
for i in range(n):
    if a[i] > b[i]:
        cnt += a[i] - b[i]
    else:
        cnt += (b[i] - a[i]) 
if sum(b) - sum(a) >= cnt:
    print('Yes')
else:
    print('No')


Failing test case input:
3
0 0 1
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
a = list(map(int, readline().split()))
b = list(map(int, readline().split()))
cnt = 0
for i in range(n):
    cnt += max(0, (b[i] - a[i] + 1) 
if sum(b) - sum(a) >= cnt:
    print('Yes')
else:
    print('No')

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

if sum(A)>sum(B):
    print("No")
else:
    a=0
    b=0
    for i in range(N):
        if A[i]>B[i]:
            a+=A[i]-B[i]
        else:
            b+=B[i]-A[i]
    if a*2>=b:
        print("No")
    else:
        print("Yes")

Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


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

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

A=0
B=0
for i in range(N):
    if a[i]==b[i]:
        pass
    elif a[i]>b[i]:
        B+=a[i]-b[i]
    else:
        if (b[i]-a[i])%2==1:
            A+=b[i]-a[i]+1
            B+=1
        else:
            A+=b[i]-a[i]
if A<B*2:
    print("No")
else:
    print("Yes")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a= list(map(int,input().split()))
b= list(map(int,input().split()))
c = [a[i]-b[i] for i in range(N)]
d=sum(b)-sum(a)   
if d<0:
  print("No")
  exit()
  
must=0
cnt=0
for num in c:
  if num>0:
    must += abs(num)
  if num>=2:
    cnt +=1
if must>d:
  print("No")
  exit()


nokori = d-must
if cnt<must:
  print("No")
else:
  print("Yes")



Failing test case input:
3
0 -1 0
-1 3 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
a= list(map(int,input().split()))
b= list(map(int,input().split()))
c = [a[i]-b[i] for i in range(N)]
d=sum(b)-sum(a)   
if d<0:
  print("No")
  exit()
  
must=0
cnt=0
for num in c:
  if num>0:
    must += abs(num)
  if num*(-1) >= 2:
    cnt += (-1)*num
if must>d:
  print("No")
  exit()




if cnt<must:
  print("No")
else:
  print("Yes")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in a:
    if i % 2 == 0:
        cnt += 1
b = list(map(int,input().split()))
ccnt = 0
for i in b:
    if i % 2 != 0:
        ccnt += 1

if cnt == ccnt:
    print("Yes")
else:
    print("No")

Failing test case input:
5
2 3 1 19 0
1 2 1 0 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
A = 0
B = 0
for i in range(n):
    A += max(0, (b[i] - a[i]) 
    B += max(0, a[i] - b[i])
if sum(b) >= sum(a):
    if A >= B:
        print("Yes")
        exit()
print("No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin
from math import ceil
def main():
	readline=stdin.readline
	N=int(readline())
	a=list(map(int,readline().split()))
	b=list(map(int,readline().split()))
	a.sort()
	b.sort()
	a_count=0
	s=sum(b)-sum(a)

	for i in range(N):
		if a[i]<b[i]:
			a_count+=ceil((b[i]-a[i])/2)

	if a_count<=s:
		print("Yes")
	else:
		print("No")

if __name__=="__main__":
	main()

Failing test case input:
3
0 -1 3
-1 3 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from sys import stdin
from math import ceil
def main():
	readline=stdin.readline
	N=int(readline())
	a=list(map(int,readline().split()))
	b=list(map(int,readline().split()))
	a_count=0
	s=sum(b)-sum(a)

	for i in range(N):
		if a[i]<b[i]:
			a_count+=ceil((b[i]-a[i])/2)

	if a_count<=s:
		print("Yes")
	else:
		print("No")

if __name__=="__main__":
	main()

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a.sort()
b.sort()
for i in range(n):
    if b[i] < a[i]:
        print("No")
        exit()
print("Yes")

Failing test case input:
3
0 -1 2
-1 3 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
A = 0
B = 0
for i in range(n):
    A += max(0, (b[i] - a[i]) 
    B += max(0, a[i] - b[i])
if sum(b) >= sum(a):
    if A >= B:
        print("Yes")
        exit()
print("No")
Problem: p03438
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    suma = 0
    sumb = 0
    dab = 0

    for i in range(n):
        suma += a[i]
        sumb += b[i]
        if a[i] > b[i]:
            dab += a[i]-b[i]
    if (dab*2+suma) > sumb:
        print("No")
    else:
        print("Yes")
resolve()

Failing test case input:
3
0 -1 0
-2 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def resolve():
    import math
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    suma = 0
    dab = 0
    dba = 0
    for i in range(n):
        suma += b[i]-a[i]
        if a[i] < b[i]:
            dab += math.ceil((b[i]-a[i])/2)
        else:
            dba += a[i]-b[i]
    if max(dba, dab) > suma:
        print("No")
    else:
        print("Yes")
resolve()

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = 0
for i in range(n):
    if (a[i] - b[i]) > 0:
        sum += (a[i]- b[i])
    else:
        sum += (b[i] - a[i]) 
sum_a = 0
sum_b = 0
for i in range(n):
    sum_a += a.pop(0)
    sum_b += b.pop(0)
if sum <= (sum_b - sum_a):
    print ('YES')
else:
    print ('NO')

Failing test case input:
5
3 2 8 1 7
2 7 1 4 4

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a = a.copy()
b = b.copy()
sum_c = 0
for i in range(n):
    if (a[i] - b[i]) < 0:
        sum_c += int(((b[i] - a[i]) / 2 ) + 0.5)
sum_a = 0
sum_b = 0
for i in range(n):
    sum_a += a.pop(0)
    sum_b += b.pop(0)
if sum_c <= (sum_b - sum_a):
    print ('Yes')
else:
    print ('No')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
import math

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

r = 0
q = 0

for x, y in zip(A,B):
    if  x > y:
        r += x - y
    elif x < y:
        q += math.ceil((y - x)/2)

if (sum(B) - sum(A)) > r and (sum(B) - sum(A)) > q:
    print("Yes")
else:
    print("No")

Failing test case input:
3
0 -2 2
0 2 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys
import math

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

d = [ y - x for x, y in zip(A, B)]

q = [ x 
r = [ -x for x in d if x < 0]

if sum(q) >= sum(r):
    print("Yes")
else:
    print("No")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
sys.setrecursionlimit(200000)
input = sys.stdin.readline









N, = map(int, input().split())
A = [int(v) for v in input().split()]
B = [int(v) for v in input().split()]
m = []

ca = 0
cb = 0
for i in range(N):
    a, b = A[i], B[i]
    if a > b:
        ca += a - b
    elif a < b:
        cb += ceil((b - a) / 2)

if sum(B) - sum(A) == ca + cb:
    print("Yes")
else:
    print("No")

Failing test case input:
3
0 -1 1
-1 3 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import sys
from collections import defaultdict, deque
import bisect
from heapq import *
from math import factorial, ceil, floor
sys.setrecursionlimit(200000)
input = sys.stdin.readline









N, = map(int, input().split())
A = [int(v) for v in input().split()]
B = [int(v) for v in input().split()]
m = []

ca = 0
cb = 0
for i in range(N):
    a, b = A[i], B[i]
    if a > b:
        ca += a - b
    elif a < b:
        cb += ceil((b - a) / 2)

t = sum(B) - sum(A)
if ca <= t and cb <= t:
    print("Yes")
else:
    print("No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = []
max_aplus = 0
min_aplus = 0
bplus = 0
for i,j in zip(a,b):
  if i > j:
    min_aplus += (i-j+1) 
    max_aplus += i-j
  else:
    bplus += j-i
if bplus >= min_aplus and bplus <= max_aplus:
  print("Yes")
else:
  print("No")

Failing test case input:
3
0 2 2
4 2 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = [i-j for i,j in zip(a,b)]
plus = 0
minus = 0
for i in c:
  if i >= 0:
    plus += i
  else:
    minus += math.ceil(i / 2)
print("Yes") if abs(minus) >= plus else print("No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
cnt = 0
for i in range(n):
    if A[i] > B[i]:
        cnt -= (A[i] - B[i])
    else:
        cnt += (B[i] - A[i])
print('Yes' if cnt > 0 else 'No')

Failing test case input:
5
3 1 7 1 5
2 7 1 8 2

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import math

n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
total = sum(B) - sum(A)
cnt1, cnt2 = 0,0

for i in range(n):
    if A[i] > B[i]:
        cnt1 += A[i] - B[i]
    elif A[i] < B[i]:
        cnt2 += math.ceil((B[i]-A[i])/2)

if max(cnt1, cnt2) <= total:
    print('Yes')
else:
    print('No')
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))

total = sum(A) - sum(B)
cnt1, cnt2 = 0,0
for i in range(n):
    if A[i] < B[i]:
        cnt1 += math.ceil(A[i] - B[i] / 2)
    else:
        cnt2 += (A[i] - B[i])
if max(cnt1, cnt2) <= total:
    print('Yes')
else:
    print('No')

Failing test case input:
3
0 -1 1
-1 3 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math

n = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
total = sum(B) - sum(A)
cnt1, cnt2 = 0,0

for i in range(n):
    if A[i] > B[i]:
        cnt1 += A[i] - B[i]
    elif A[i] < B[i]:
        cnt2 += math.ceil((B[i]-A[i])/2)

if max(cnt1, cnt2) <= total:
    print('Yes')
else:
    print('No')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from queue import PriorityQueue


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

A_sum = sum(A)
B_sum = sum(B)
diff = B_sum - A_sum
if diff < 0:
    print("No")
    exit()

A.sort()
B.sort()

for a, b in zip(A, B):
    if a > b:
        print("No")
        exit()

print("Yes")


Failing test case input:
3
0 -1 0
-2 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math
from queue import PriorityQueue


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

A_sum = sum(A)
B_sum = sum(B)
diff = B_sum - A_sum
if diff < 0:
    print("No")
    exit()

cnt = 0
for a, b in zip(A, B):
    if a < b:
        cnt += math.ceil((b - a) / 2)

if cnt > diff:
    print("No")
else:
    print("Yes")

Problem: p03438
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
cnt1=[0]*n
cnt2=[0]*n
for i in range(n):
    if a[i]>b[i]:
        cnt2[i]=a[i]-b[i]
    else:
        num4=b[i]-a[i]
        cnt1[i]=num4
        cnt2[i]=num4%2
num5=abs(sum(a)-sum(b))
if sum(cnt1)<=num5 and sum(cnt2)<=num5 and (sum(cnt2)-sum(cnt1))%2==0:
    print("Yes")
else:
    print("No")


Failing test case input:
5
2 3 1 8 0
1 2 1 0 0

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
cnt1=[0]*n
cnt2=[0]*n
for i in range(n):
    if a[i]>b[i]:
        cnt2[i]=a[i]-b[i]
    else:
        num4=b[i]-a[i]
        cnt1[i]=-(num4
        cnt2[i]=num4%2
num5=abs(sum(a)-sum(b))
if max(sum(cnt1),sum(cnt2))+abs(sum(cnt1)-sum(cnt2))<=num5:
    print("Yes")
else:
    print("No")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
    elif c > 0:
        plus+=c

print("Yes" if minus > plus*2+1 else "No")


Failing test case input:
3
0 -1 0
-2 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0;co=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
        if c%2==1:
            co+=1
    elif c > 0:
        plus+=c

print("Yes" if minus >= plus*2+co else "No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
k = sum(B)-sum(A)


if k < 0:
    print('No')
else:
    cnt = 0
    for a, b in zip(A, B):
        if a < b:
            x, y = divmod((b-a), 2)
            cnt += x+2*y
        elif b < a:
            cnt += a-b
    if cnt <= k:
        print('Yes')
    else:
        print('No')


Failing test case input:
3
1 2 3
4 2 2

Expected output:
Yes


Actual output:
No


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


if k < 0:
    print('No')
else:
    cnt_a = 0
    cnt_b = 0
    for a, b in zip(A, B):
        if a < b:
            x, y = divmod((b-a), 2)
            cnt_a += x+y
            cnt_b += y
        elif b < a:
            cnt_b += a-b
    if max(cnt_a, cnt_b) <= k:
        print('Yes')
    else:
        print('No')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]

if A == B:
    print("Yes")
else:
    if suma >= sumb or abs(suma - sumb) % 2 == 0:
        print("No")
    else:
        print("Yes")


Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
from math import ceil

N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += ceil((B[i] - A[i]) / 2)

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

total = sum(B) - sum(A)
each = 0
for i in range(N):
    if B[i] - A[i] == 0:
        continue
    elif B[i] - A[i] > 0:
        each += math.ceil((B[i] - A[i]) / 2)
    else:
        each += 1
if each <= total:
    print('Yes') 
else:
    print('No')

Failing test case input:
3
0 0 1
-1 3 1

Expected output:
Yes


Actual output:
No


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

total = sum(B) - sum(A)
each = 0
for i in range(N):
    if B[i] == A[i]:
        continue
    elif B[i] - A[i] > 0:
        each += math.ceil((B[i] - A[i]) / 2)
if each <= total:
    print('Yes') 
else:
    print('No')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
count = - sum(A) + sum(B)
inv = 0
for i in range(N):
  inv += max(0, A[i] - B[i])
  
if count >= 0 and 2*inv <= count:
  print("Yes")
else :
  print("No")

Failing test case input:
3
0 -1 0
-2 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
count = - sum(A) + sum(B) 
inv = 0
for i in range(N):
  inv += max(0, A[i] - B[i])
  
inv2 = 0
for i in range(N):
  inv2 += max(0, (B[i] - A[i]+1)
  
if count >= 0 and inv <= count and inv2 <= count:
  print("Yes")
else :
  print("No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
if sum(A)>sum(B):
    ans='No'
else:
    l=sum(B)-sum(A)
    cnt_a=l*2
    cnt_b=l
    for i in range(n):
        if A[i]>B[i]:
            cnt_b-=(A[i]-B[i])
        else:
            cnt_a-=(B[i]-A[i])
    if cnt_a==cnt_b:
        ans='Yes'
    else:
        ans='No'
print(ans)

Failing test case input:
3
0 0 1
-2 3 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
if sum(A)>sum(B):
    ans='No'
else:
    l=sum(B)-sum(A)
    cnt_a=l*2
    cnt_b=l
    for i in range(n):
        if A[i]>B[i]:
                cnt_b-=(A[i]-B[i])
        else:
            if (B[i]-A[i])%2==0:
                cnt_a-=(B[i]-A[i])
            else:
                cnt_a-=(B[i]-A[i])+1
                cnt_b-=1
    if cnt_a==cnt_b and cnt_a>=0:
        ans='Yes'
    else:
        ans='No'
print(ans)
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

C = [A[i]-B[i] for i in range(N)]
if 0 in C:
    print("Yes")
    exit()
else:
    P = sum(filter(lambda x: x>0, C))
    M = sum(filter(lambda x: x<-1, C))
    if abs(M) >= abs(2*P):
        print("Yes")
    else:
        print("No")





Failing test case input:
5
0 3 1 8 0
0 2 1 0 0

Expected output:
No


Actual output:
Yes


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

C = [B[i]-A[i] for i in range(N)]

P = sum(filter(lambda x: x<0, C))
M = list(filter(lambda x: x>1, C))
M = list(map(lambda x: x

M = sum(M)
if abs(M) >= abs(P):
    print("Yes")
else:
    print("No")

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

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sumA = 0
sumB = 0

for i in range(n):
    sumA = A[i] + sumA
    sumB = B[i] + sumB

if sumA < sumB:
    print("Yes")
else:
    print("No")


Failing test case input:
3
0 0 1
-2 3 1

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):

n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

sumA = 0
sumB = 0
sumAB = 0

for i in range(n):
    sumA += A[i]
    sumB += B[i]

for i in range(n):
    if A[i] < B[i]:
        sumAB += int((B[i] - A[i]) / 2 + 0.5)

if sumAB <= sumB - sumA:
    print("Yes")
else:
    print("No")

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

import math

count = 0
for a, b in zip(A, B):
    if a - b >= 0:
        continue
    else:
        count += math.ceil((b - a) / 2)

diff = sum(A) - sum(B)


if diff < 0 and diff % 2 == 1 and abs(diff) >= count:
    print("Yes")
else:
    print("No")

Failing test case input:
3
1 2 1
4 2 2

Expected output:
Yes


Actual output:
No


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

import math

count_1up = 0
count_2up = 0

for a, b in zip(A, B):
    if a - b >= 0:
        count_1up += a - b
    else:
        count_2up += math.ceil((b - a) / 2)

diff = sum(B) - sum(A)


if diff < 0:
    print("No")
elif diff < count_1up or diff < count_2up:
    print("No")
else:
    print("Yes")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def inpl(): return [int(i) for i in input().split()]
N = int(input())
A = inpl()
B = inpl()
M = sum(B)-sum(A)
ans = 'Yes'
if M < 0:
    ans = 'No'
ctr = 0
ca = 0
cb = 0
for i in range(N):
    if A[i] < B[i]:
        abdiv = -(A[i]-B[i])
        abmod = (B[i]-A[i])%2
        ca += abdiv
        cb += abmod
        
    else:
        cb += A[i] - B[i]
if M != 2*ca-cb or M < ca:
    ans = 'No'
print(ans)

Failing test case input:
3
0 2 3
4 2 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def inpl(): return [int(i) for i in input().split()]
N = int(input())
A = inpl()
B = inpl()
M = sum(B)-sum(A)
ans = 'Yes'
if M < 0:
    ans = 'No'
ca, cb = 0, 0
for i in range(N):
    dba = B[i] - A[i]
    if dba > 0:
        ca += -(-dba
        cb += dba%2
    else:
        cb -= dba
if M != 2*ca-cb or ca > M:
    ans = 'No'
print(ans)

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def inpl(): return [int(i) for i in input().split()]
N = int(input())
A = inpl()
B = inpl()
M = sum(B)-sum(A)
ans = 'Yes'
if M < 0:
    ans = 'No'
ca, cb = 0, 0
for i in range(N):
    if A[i] < B[i]:
        ca += -(A[i]-B[i])
        cb += (B[i]-A[i])%2
    else:
        cb += A[i] - B[i]
if M != 2*ca-cb:
    ans = 'No'
print(ans)

Failing test case input:
3
0 -1 0
-1 3 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def inpl(): return [int(i) for i in input().split()]
N = int(input())
A = inpl()
B = inpl()
M = sum(B)-sum(A)
ans = 'Yes'
if M < 0:
    ans = 'No'
ca, cb = 0, 0
for i in range(N):
    dba = B[i] - A[i]
    if dba > 0:
        ca += -(-dba
        cb += dba%2
    else:
        cb -= dba
if M != 2*ca-cb or ca > M:
    ans = 'No'
print(ans)

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
    elif c > 0:
        plus+=c

print("Yes" if minus +1 >= plus*2 else "No")


Failing test case input:
5
3 1 4 1 5
2 7 1 8 2

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0;co=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
        if c%2==1:
            co+=1
    elif c > 0:
        plus+=c

print("Yes" if minus >= plus*2+co else "No")
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

a.sort()
b.sort()
a.reverse()
b.reverse()

f = 1

for i in range(N):
    if a[i]>b[i]:
        f = -1
        
if f>0:
    print('Yes')
else:
    print('No')
        

Failing test case input:
3
0 -1 2
-1 3 0

Expected output:
No


Actual output:
Yes


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

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

P = 0
N = 0

for i in range(N2):
    if b[i]-a[i]>=0:
        P = P + ((b[i]-a[i])
    else:
        N = N + a[i]-b[i]
       
P2 = P-2*N
        
if P2>=0:
    print('Yes')
else:
    print('No')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
    elif c > 0:
        plus+=c

print("Yes" if minus >= plus*2+1 else "No")


Failing test case input:
3
0 -2 2
0 2 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
N = int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
plus=0;minus=0;co=0
for i in range(N):
    c=a[i]-b[i]
    if c < 0:
        minus-=c
        if c%2==1:
            co+=1
    elif c > 0:
        plus+=c

print("Yes" if minus >= plus*2+co else "No")

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

d=[]
for i in range(N):
    d.append(a[i]-b[i])

cnt=-sum(d)
p=0
n=0
for j in range(N):
    if d[j]>0:
        p+=d[j]
    if d[j]<0:
        n-=(d[j]+1)
if p<=cnt and n<=cnt:
    print("Yes")
else:
    print("No")

Failing test case input:
3
0 -1 1
-1 3 0

Expected output:
Yes


Actual output:
No


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

d=[]
for i in range(N):
    d.append(a[i]-b[i])

cnt=-sum(d)
p=0
n=0
for j in range(N):
    if d[j]>0:
        p+=d[j]
    if d[j]<0:
        n+=-d[j]-(-d[j])%2
if n>=p*2:
    print("Yes")
else:
    print("No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
sum = 0
for i in range(n):
    if a[i] - b[i] > 0:
        sum += a[i]- b[i]
    else:
        sum += (b[i] - a[i]) / 2
sum_a = 0
sum_b = 0
for i in range(n):
    sum_a += a.pop(0)
    sum_b += b.pop(0)
if sum <= sum_b - sum_a:
    print ('YES')
else:
    print ('NO')

Failing test case input:
5
3 2 8 2 9
2 7 1 4 8

Expected output:
No


Actual output:
NO


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
a = a.copy()
b = b.copy()
sum_c = 0
for i in range(n):
    if (a[i] - b[i]) < 0:
        sum_c += int(((b[i] - a[i]) / 2 ) + 0.5)
sum_a = 0
sum_b = 0
for i in range(n):
    sum_a += a.pop(0)
    sum_b += b.pop(0)
if sum_c <= (sum_b - sum_a):
    print ('Yes')
else:
    print ('No')
Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if abs(suma - sumb) % N == 0:
            print("Yes")
        else:
            print("No")


Failing test case input:
3
1 0 -2
-1 3 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
from math import ceil

N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += ceil((B[i] - A[i]) / 2)

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")

Problem: p03438
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
    import math
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    suma = 0
    sumb = 0
    dab = 0
    dba = 0
    for i in range(n):
        suma += a[i]
        sumb += b[i]
        if a[i] > b[i]:
            dab += a[i]-b[i] 
        else:
            dba += b[i]-a[i]  
    if suma > sumb or  math.ceil(dba/2) *2 + suma > dab+sumb:
        print("No")
    else:
        print("Yes")
resolve()

Failing test case input:
3
0 -1 0
-2 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def resolve():
    import math
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    suma = 0
    dab = 0
    dba = 0
    for i in range(n):
        suma += b[i]-a[i]
        if a[i] < b[i]:
            dab += math.ceil((b[i]-a[i])/2)
        else:
            dba += a[i]-b[i]
    if max(dba, dab) > suma:
        print("No")
    else:
        print("Yes")
resolve()

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def inpl(): return [int(i) for i in input().split()]
N = int(input())
A = inpl()
B = inpl()
M = sum(B)-sum(A)
ans = 'Yes'
if M < 0:
    ans = 'No'
ctr = 0
for i in range(N):
    if A[i] < B[i]:
        ctr += -(A[i]-B[i])
    else:
        ctr += A[i] - B[i]
if ctr-M:
    ans = 'No'
print(ans)

Failing test case input:
3
0 0 1
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def inpl(): return [int(i) for i in input().split()]
N = int(input())
A = inpl()
B = inpl()
M = sum(B)-sum(A)
ans = 'Yes'
if M < 0:
    ans = 'No'
ca, cb = 0, 0
for i in range(N):
    dba = B[i] - A[i]
    if dba > 0:
        ca += -(-dba
        cb += dba%2
    else:
        cb -= dba
if M != 2*ca-cb or ca > M:
    ans = 'No'
print(ans)
Problem: p03438
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

x=sum(b)-sum(a)
y=0
for i in range(n):
    if a[i]<b[i]:
        y+=-(a[i]-b[i])
    else:
        y+=a[i]-b[i]
print("No" if x<=y else "Yes")

Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


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

x=sum(b)-sum(a)
y=0
for i in range(n):
    if a[i]<b[i]:
        y+=-((a[i]-b[i])
print("No" if x<y else "Yes")

Problem: p03438
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,*a=map(int,open(0).read().split())
u=d=z=0
for i,j in zip(a[:n],a[n:]):
    if j-i>0:u+=j-i
    elif j-i==0:z+=1
    else:d+=j-i
print("Yes" if (z==0 and u+2*d==0)or (z>0 and u+d>=0) else "No")

Failing test case input:
3
0 0 2
7 2 0

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
n,*a=map(int,open(0).read().split())
u=d=z=r=0
for i,j in zip(a[:n],a[n:]):
    if j-i>0:u+=(j-i)
    elif j-i==0:z+=1
    else:d+=j-i
print("Yes" if u+2*d>=0 else "No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += (B[i] - A[i]) 

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")


Failing test case input:
3
1 0 -1
-1 3 2

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
from math import ceil

N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]

suma = sumb = num = 0
for i in range(N):
    suma += A[i]
    sumb += B[i]
    if A[i] < B[i]:
        num += ceil((B[i] - A[i]) / 2)

if A == B:
    print("Yes")
else:
    if suma >= sumb:
        print("No")
    else:
        if num > sumb - suma:
            print("No")
        else:
            print("Yes")

Problem: p03438
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    suma = 0
    sumb = 0
    dab = 0

    for i in range(n):
        suma += a[i]
        sumb += b[i]
        if a[i] > b[i]:
            dab += a[i]-b[i]
    if (dab*2+suma) >= sumb:
        print("No")
    else:
        print("Yes")
resolve()

Failing test case input:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def resolve():
    import math
    n = int(input())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    suma = 0
    dab = 0
    dba = 0
    for i in range(n):
        suma += b[i]-a[i]
        if a[i] < b[i]:
            dab += math.ceil((b[i]-a[i])/2)
        else:
            dba += a[i]-b[i]
    if max(dba, dab) > suma:
        print("No")
    else:
        print("Yes")
resolve()