ZhenlongDai/ACPR huggingface dataset:
Problem: p03547
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S = list(map(str, input().split()))
if S[0] == S[1]:
    print("=")
    exit()
if S == S.sort():
    print("<")
else:
    print(">")

Failing test case input:
A F

Expected output:
<


Actual output:
>


Fixed submission (verdict: Accepted):
S = list(map(str, input().split()))
if S[0] == S[1]:
    print("=")
    exit()
if S == sorted(S):
    print("<")
else:
    print(">")
Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, t = map(int, input().split())
ab = []
for _ in range(n):
    ab.append(list(map(int, input().split())))

dp = [-1]*(t+1)
dp[0] = 0

for a, b in ab:
    tmp = dp[:]
    for i in range(t):
        if dp[i] >= 0 and dp[i]+b > tmp[min(i+a, t)]:
            tmp[min(i+a, t)] = dp[i]+b
    dp = tmp
print(max(dp))

Failing test case input:
10 100
15 17
33 9
13 21
85 17
18 49
37 6
14 21
6 35
27 13
22 25

Expected output:
185


Actual output:
181


Fixed submission (verdict: Accepted):
n, t = map(int, input().split())
ab = []
for _ in range(n):
    ab.append(list(map(int, input().split())))

ab.sort(key=lambda x:x[0])

dp = [-1]*(t+1)
dp[0] = 0

for a, b in ab:
    tmp = dp[:]
    for i in range(t):
        if dp[i] >= 0 and dp[i]+b > tmp[min(i+a, t)]:
            tmp[min(i+a, t)] = dp[i]+b
    dp = tmp
print(max(dp))

Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

n,t = map(int,input().split())
now = [0 for _ in range(t+1)]
for _ in range(n):
  w,v = map(int,input().split())
  last = now
  now = []
  for f in range(t):
    if f - w >= 0:
      now.append(max(last[f],last[f-w]+v))
    else:
      now.append(last[f])
  now.append(max(last[-2]+v,last[-1]))
  print(now)
print(now[-1])

Failing test case input:
3 53
30 1
30 6
30 22

Expected output:
28


Actual output:
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 28]
28


Fixed submission (verdict: Accepted):
n,t = map(int,input().split())
now = [0 for _ in range(t+1)]
wv = []
for _ in range(n):
  wv.append(list(map(int,input().split())))
wv.sort(key=lambda x:x[0])
for i in range(n):
  w,v = wv[i]
  last = now
  now = []
  for f in range(t):
    if f - w >= 0:
      now.append(max(last[f],last[f-w]+v))
    else:
      now.append(last[f])
  now.append(max(last[-2]+v,last[-1]))
  
print(now[-1])

Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,t=map(int,input().split())
dp=[0]*(t+3000)
ans=chk=0
for i in range(n):
    a,b=map(int,input().split())
    for j in range(t-1,-1,-1):
        dp[j+a]=max(dp[j+a],dp[j]+b)
        ans=max(ans,dp[j+a])
print(ans)

Failing test case input:
10 100
29 24
35 9
20 12
85 24
18 49
19 9
8 17
18 35
32 2
18 7

Expected output:
161


Actual output:
146


Fixed submission (verdict: Accepted):
n,t=map(int,input().split())
dp=[0]*(t+3005)
ans=chk=0
w=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append((a,b))
w.sort()

for i in w:
    for j in range(t-1,-1,-1):
        dp[j+i[0]]=max(dp[j+i[0]],dp[j]+i[1])
        ans=max(ans,dp[j+i[0]])
print(ans)
Problem: p02863
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, t = map(int, input().split())
lst = [0 for _ in range(t + 1)]

for _ in range(n):
    a, b = map(int, input().split())
    lst[-1] = max(lst[-1], lst[-2] + b)
    for i in range(t, a - 1, -1):
        lst[i] = max(lst[i], lst[i - a] + b)

print(lst[-1])

Failing test case input:
10 100
15 24
20 9
20 12
85 24
18 49
19 20
8 17
18 35
32 2
18 7

Expected output:
181


Actual output:
164


Fixed submission (verdict: Accepted):
n, t = map(int, input().split())
lst = [0 for _ in range(t)]
ab = [list(map(int, input().split())) for _ in range(n)]
ab.sort()
ans = 0
for a, b in ab:
    ans = max(ans, lst[-1] + b)
    for i in range(t - 1, a - 1, -1):
        lst[i] = max(lst[i], lst[i - a] + b)

print(ans)

Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,t=map(int,input().split())
dp=[0]*(t+3005)
ans=chk=0
for i in range(n):
    a,b=map(int,input().split())
    for j in range(t-2,-1,-1):
        dp[j+a+1]=max(dp[j+a+1],dp[j+1]+b)
        ans=max(ans,dp[j+a+1])
print(ans)


Failing test case input:
10 100
15 17
20 9
21 12
85 23
18 49
12 20
15 21
18 35
27 2
22 13

Expected output:
177


Actual output:
164


Fixed submission (verdict: Accepted):
n,t=map(int,input().split())
dp=[0]*(t+3005)
ans=chk=0
w=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append((a,b))
w.sort()

for i in w:
    for j in range(t-1,-1,-1):
        dp[j+i[0]]=max(dp[j+i[0]],dp[j]+i[1])
        ans=max(ans,dp[j+i[0]])
print(ans)

Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, t = [int(i) for i in input().split()]
ab = []
for _ in range(n):
    ab.append([int(i) for i in input().split()])
c = [0] * (t*2)
for i in ab:
    for j in range(t-1, -1, -1):
        k = c[j]
        l = i[0] + j
        if l >= 2*t:
            continue
        c[l] = max(c[l], c[j] + i[1])
print(max(c))


Failing test case input:
10 100
15 24
35 9
20 12
85 24
18 52
19 9
8 17
18 35
32 2
18 7

Expected output:
173


Actual output:
156


Fixed submission (verdict: Accepted):
n, t = [int(i) for i in input().split()]
ab = []
for _ in range(n):
    ab.append([int(i) for i in input().split()])
ab.sort(key=lambda x:x[0])
aa = t+max([i[0] for i in ab])+1
c = [0] * aa
for i in ab:
    d = c[:]
    for j in range(t):
        k = d[j]
        l = i[0] + j
        if l >= aa:
            continue
        c[l] = max(c[l], d[j] + i[1])
print(max(c))
Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, t = [int(i) for i in input().split()]
ab = []
for _ in range(n):
    ab.append([int(i) for i in input().split()])
c = [0] * (t*3)
for i in ab:
    for j in range(t-1, -1, -1):
        k = c[j]
        l = i[0] + j
        if l >= 3*t:
            continue
        c[l] = max(c[l], c[j] + i[1])
print(max(c))


Failing test case input:
10 100
29 24
35 9
20 12
85 24
18 49
19 9
8 17
18 35
32 2
18 7

Expected output:
161


Actual output:
146


Fixed submission (verdict: Accepted):
n, t = [int(i) for i in input().split()]
ab = []
for _ in range(n):
    ab.append([int(i) for i in input().split()])
ab.sort(key=lambda x:x[0])
aa = t+max([i[0] for i in ab])+1
c = [0] * aa
for i in ab:
    d = c[:]
    for j in range(t):
        k = d[j]
        l = i[0] + j
        if l >= aa:
            continue
        c[l] = max(c[l], d[j] + i[1])
print(max(c))

Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,t=map(int,input().split())
dp=[0]*(t+3005)
ans=chk=0
w=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append((b,a))
w.sort()

for i in w:
    for j in range(t-1,-1,-1):
        dp[j+i[1]]=max(dp[j+i[1]],dp[j]+i[0])
        ans=max(ans,dp[j+i[1]])
print(ans)


Failing test case input:
10 100
15 24
9 9
20 3
85 24
4 84
19 1
8 33
18 35
27 2
18 7

Expected output:
219


Actual output:
195


Fixed submission (verdict: Accepted):
n,t=map(int,input().split())
dp=[0]*(t+3005)
ans=chk=0
w=[]
for i in range(n):
    a,b=map(int,input().split())
    w.append((a,b))
w.sort()

for i in w:
    for j in range(t-1,-1,-1):
        dp[j+i[0]]=max(dp[j+i[0]],dp[j]+i[1])
        ans=max(ans,dp[j+i[0]])
print(ans)

Problem: p02863
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, t = [int(i) for i in input().split()]
ab = []
for _ in range(n):
    ab.append([int(i) for i in input().split()])
c = [0] * (t*3)
for i in ab:
    d = c[:]
    for j in range(t):
        k = d[j]
        l = i[0] + j
        if l >= 3*t:
            continue
        c[l] = max(c[l], d[j] + i[1])
print(max(c))


Failing test case input:
10 100
15 24
9 9
20 3
85 24
4 84
19 1
8 33
18 35
27 2
18 7

Expected output:
219


Actual output:
196


Fixed submission (verdict: Accepted):
n, t = [int(i) for i in input().split()]
ab = []
for _ in range(n):
    ab.append([int(i) for i in input().split()])
ab.sort(key=lambda x:x[0])
aa = t+max([i[0] for i in ab])+1
c = [0] * aa
for i in ab:
    d = c[:]
    for j in range(t):
        k = d[j]
        l = i[0] + j
        if l >= aa:
            continue
        c[l] = max(c[l], d[j] + i[1])
print(max(c))
Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
r=sorted(map(int,input().split()))[::-1]
print(r)



Failing test case input:
7
850 1446 941 523 647 1 453

Expected output:
4854


Actual output:
[1446, 941, 850, 647, 523, 453, 1]


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

Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
line = input()
words = line.split()
num_list = []
for word in words:
    num_list.append(int(word))
ans = 0
for num in num_list:
    ans += num-1

print(ans)

Failing test case input:
7
15 1171 375 937 28 -1 587

Expected output:
3105


Actual output:
6


Fixed submission (verdict: Accepted):
line = input()
line= input()
words = line.split()
num_list = []
for word in words:
    num_list.append(int(word))
ans = 0
for num in num_list:
    ans = ans + (num-1)

print(ans)

Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = list(map(int,input().split()))
print(sum(a) - len(a))

Failing test case input:
5
5 23 7 30 6

Expected output:
66


Actual output:
4


Fixed submission (verdict: Accepted):
_ = input()
a = list(map(int,input().split()))
print(sum(a) - len(a))

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

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

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

print(m-1)
  


Failing test case input:
7
850 765 941 523 647 1 568

Expected output:
4288


Actual output:
117604594699181999


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

m=0
for i in range(n):
  m+=a[i]-1

print(m)

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

print(sum([int(s) for s in input().split()]))

Failing test case input:
5
5 23 8 30 0

Expected output:
61


Actual output:
66


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

print(sum([int(s)-1 for s in input().split()]))

Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list()
print(sum(a) - n)


Failing test case input:
7
850 765 941 523 647 1 568

Expected output:
4288


Actual output:
-7


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

Problem: p03294
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n, aa = [list(map(lambda x:int(x), s.split())) for s in open(0)]

sum(a-1 for a in aa)

Failing test case input:
5
7 46 11 17 11

Expected output:
87


Actual output:

Fixed submission (verdict: Accepted):
n, aa = [list(map(lambda x:int(x), s.split())) for s in open(0)]

print(sum(a-1 for a in aa))

Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
lst = list(map(int, input().split()))
print(len(lst)+sum(lst))


Failing test case input:
5
1 28 16 34 -1

Expected output:
73


Actual output:
83


Fixed submission (verdict: Accepted):
n = input()
lst = list(map(int, input().split()))
print(sum(lst) - len(lst))
Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N=int(input())
a=list(map(int,input().split()))
a=set(a)
print(sum(a)-len(a))

Failing test case input:
3
0 0 25

Expected output:
22


Actual output:
23


Fixed submission (verdict: Accepted):

N=int(input())
a=list(map(int,input().split()))
print(sum(a)-len(a))

Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
sa = list(map(int,input().split()))
ans = 0
for i in sa:
    ans += (i-1)
print(ans)

Failing test case input:
7
68 1745 941 602 129 -2 1411

Expected output:
4887


Actual output:
6


Fixed submission (verdict: Accepted):
aaa = input()
sa = list(map(int,input().split()))
ans = 0
for i in sa:
    ans += (i-1)
print(ans)

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

f = sum(a)-N
print(a)

Failing test case input:
7
850 765 941 523 647 1 568

Expected output:
4288


Actual output:
[850, 765, 941, 523, 647, 1, 568]


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

f = sum(a)-N
print(f)

Problem: p03294
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input(int())
l = list(map(int, input().split()))
k = sum(l)-len(l)
print(int(k))

Failing test case input:
7
850 1446 941 413 647 1 453

Expected output:
4744


Actual output:
04744


Fixed submission (verdict: Accepted):
a = input()
l = list(map(int, input().split()))
print(sum(l)-len(l))
Problem: p03593
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter
h, w = map(int, input().split())
s = ''
for i in range(h):
    s += input()
c = list(Counter(s).values())
for i in range(len(c)):
    c[i] %= 2
a = c.count(1)
if h % 2 and w % 2 and a == 1:
    print('Yes')
elif a == 0:
    print('Yes')
else:
    print('No')

Failing test case input:
2 2
aa
bb

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import Counter
h, w = map(int, input().split())
s = ''
for i in range(h):
    s += input()
c = list(Counter(s).values())
for i in range(len(c)):
    c[i] %= 4
a, b, c, d = c.count(0), c.count(1), c.count(2), c.count(3)
if b + d >= 2:
    print('No')
else:
    x = c + d
    if h % 2:
        x -= w 
    if w % 2:
        x -= h 
    if x <= 0:
        print('Yes')
    else:
        print('No')

Problem: p03593
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H,W = map(int,input().strip().split())
lines = []
for i in range(H):
    lines.append(input().strip())

chars = {}
for line in lines:
    for c in line:
        if c not in chars:
            chars[c]=1
        chars[c]+=1
def judge(H,W,chars):
    ones = 1
    twos = H+W-2
    for c in chars:
        if ones<0 or twos<0:
            return False
        if chars[c]%4==0:
            continue
        if chars[c]%2==0:
            twos-=1
        else:
            ones-=1
    return True


if judge(H, W, chars):
    print("Yes")
else:
    print("No")

Failing test case input:
2 5
abxab
acyba

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
H,W = map(int,input().strip().split())
lines = []
for i in range(H):
    lines.append(input().strip())
chars = {}
for line in lines:
    for c in line:
        if c not in chars:
            chars[c]=0
        chars[c]+=1

def judge(H,W,chars):
    if H%2 + W%2==2:
        ones = 1
        twos = (H + W - 2)
    elif H%2 + W%2==0:
        ones = 0
        twos = 0
    elif H%2 == 1:
        ones = 0
        twos = W
    else:
        ones = 0
        twos = H
    for c in chars:
        if ones<0 or twos<0:
            return False
        chars[c] %= 4
        if chars[c]==0:
            continue
        if chars[c] == 2:
            twos-=1
        elif chars[c] == 3:
            twos-=1
            ones-=1
        else:
            ones-=1
    return True


if judge(H, W, chars):
    print("Yes")
else:
    print("No")
Problem: p03593
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
h,w = map(int,input().split())
a = ''

for i in range(h):
    a += input()
from collections import Counter
c = Counter(a)

if h==1 or w==1:
    odd = 0
    for i in c:
        if c[i]%2==1:
            odd += 1
    print('Yes' if odd<=1 else 'No')
    exit()

x = 0
y = 0
z = 0
for i in c:
    x += c[i]
    y += c[i]%4
    c[i] = c[i]%4
    if c[i]%2==1:
        z += 1

print('Yes' if y<=x and z<=1 else 'No')

Failing test case input:
2 2
aa
bb

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
h,w = map(int,input().split())
a = ''

for i in range(h):
    a += input()
from collections import Counter
c = Counter(a)

if h==1 or w==1:
    odd = 0
    for i in c:
        if c[i]%2==1:
            odd += 1
    print('Yes' if odd<=1 else 'No')
    exit()

x = h*(w%2)+w*(h%2)-(h*w)%2
y = 0
z = 0
for i in c:
    y += c[i]%4
    c[i] = c[i]%4
    if c[i]%2==1:
        z += 1

print('Yes' if y<=x and z<=1 else 'No')

Problem: p03593
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def func() :
    n,m=map(int,input().split())
    a={}
    for i in range(n) :
        s = input()
        for c in list(s):
            if c in a:
                a[c]+=1
            else :
                a[c] = 1
    res = 0
    for k,v in a.items() :
        if v%2==1 :
            res += 1
            if res > 1 :
                print('No')
                return
    print('Yes')
func()

Failing test case input:
2 2
aa
bb

Expected output:
No

Actual output:
Yes


Fixed submission (verdict: Accepted):
def func() :
    n,m=map(int,input().split())
    a={}
    for i in range(n) :
        s = input()
        for c in list(s):
            if c in a:
                a[c]+=1
            else :
                a[c] = 1
    c1=sum(map(lambda x : x%2 , a.values()))
    c2=sum(map(lambda x : x
    if c1 != n*m%2 or c2 < (n
        print('No')
    else :
        print('Yes')
func()
Problem: p03593
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from collections import Counter

if __name__ == '__main__':
    h, w = map(int, input().split())
    counts = Counter(''.join(input() for _ in range(h))).values()
    c2 = 0
    odd_flag = False
    for x in counts:
        if x % 2:
            odd_flag = True
            x -= 1
        if x % 4:
            c2 += 1
    if odd_flag and (h * w) & 1 == 0 or odd_flag == False and (h * w) & 1:
        print('No')
        quit(0)
    lim2 = 0
    if h & 1:
        lim2 += w 
    if w & 1:
        lim2 += h 
    if lim2 >= c2:
        print('Yes')
    else:
        print('No')


Failing test case input:
5 1
t
x
d
f
s

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from collections import Counter

if __name__ == '__main__':
    h, w = map(int, input().split())
    counts = Counter(''.join(input() for _ in range(h))).values()
    c1, c2 = 0, 0
    for x in counts:
        if x % 2:
            c1 += 1
            x -= 1
        if x % 4:
            c2 += 1
    if c1 == 1 and (h * w) & 1 == 0 or c1 > 1:
        print('No')
        quit(0)
    lim2 = 0
    if h & 1:
        lim2 += w 
    if w & 1:
        lim2 += h 
    if lim2 >= c2:
        print('Yes')
    else:
        print('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:
3
0 -1 2
-1 3 1

Expected output:
Yes


Actual output:
No


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):
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
B = [int(x) for x in stdin.readline().rstrip().split()]
A.sort()
B.sort()
f = True
for i in range(N):
    if  A[i] - B[i] > 0:
        f = False
if f:
    print("Yes")
else:
    print("No")

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

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
from sys import stdin
N = int(stdin.readline().rstrip())
A = [int(x) for x in stdin.readline().rstrip().split()]
B = [int(x) for x in stdin.readline().rstrip().split()]

cnt1 = 0 
cnt2 = 0

for i in range(N):
    if A[i] > B[i]:
        cnt1 += (A[i] - B[i])
    else:
        cnt2 += ((B[i]-A[i])
        
if cnt1 <= cnt2:
    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()))

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 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()))

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):
import math

N=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]

c=0
d=0
if sum(a)>sum(b):
    print('No')
else:
    for i in range(N):
        c+=max(0,a[i]-b[i])
        d+=max(0,math.ceil((b[i]-a[i])/2))
    if c>N or d>N:
        print('No')
    else:
        print('Yes')


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

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
import math

N = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

c = 0
d = 0
if sum(a) > sum(b):
    print('No')
else:
    for i in range(N):
        c += max(0, a[i]-b[i])
        d += max(0, (b[i]-a[i])
    if c > d:
        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()))

x = sum(B) - sum(A)
cnt1 = 0
cnt2 = 0
for i in range(n):
    if A[i] > B[i]:
        cnt1 += (A[i] - B[i])
    else:
        cnt2 += (B[i] - A[i])

if max(cnt1, cnt2) <= x:
    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 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):
N=int(input())
a=sorted(list(map(int,input().split())))
b=sorted(list(map(int,input().split())))
for i in range(N):
  if a[i]>b[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()))
cnt=0
for i in range(N):
  cnt+=max(0, (b[i]-a[i])
if sum(b)-sum(a)<cnt:
  print('No')
  exit()

print('Yes')

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def b_two_arrays(N, A, B):
    import math
    operation_times = 0
    for a, b in zip(A, B):
        if a >= b:
            operation_times += a - b
        else:
            operation_times += math.ceil((b - a) / 2)
    ans = 'Yes' if operation_times <= (sum(B) - sum(A)) else 'No'
    return ans

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
print(b_two_arrays(N, A, B))

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

Expected output:
Yes


Actual output:
No


Fixed submission (verdict: Accepted):
def b_two_arrays(N, A, B):
    import math
    operation_times = 0
    for a, b in zip(A, B):
        if a < b:
            operation_times += math.ceil((b - a) / 2)
    ans = 'Yes' if operation_times <= (sum(B) - sum(A)) else 'No'
    return ans

N = int(input())
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
print(b_two_arrays(N, A, B))

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, *p = map(int, open(0).read().split())
s = sum(j - i - max(0, i - j) - max(0, j - i)%2 for i, j in zip(p, p[n:]))
print("No" if s >= 0 == s%2 else "Yes")

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

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n, *p = map(int, open(0).read().split())
s = sum(j - i - max(0, i - j) - max(0, j - i)%2 for i, j in zip(p, p[n:]))
print("Yes" if s >= 0 == s%2 else "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()))

diff = sum(b) - sum(a)
if diff < 0:
    print("No")
else:
    count = 0
    for i in range(N):
        if a[i] > b[i]:
            count += a[i] - b[i]
        else:
            count += math.ceil((b[i] - a[i])/2)
    if count > diff:
        print("No")
    else:
        print("Yes")


Failing test case input:
3
0 -2 2
0 2 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()))

diff = sum(b) - sum(a)
if diff < 0:
    print("No")
else:
    count = 0
    count2 = 0
    for i in range(N):
        if a[i] > b[i]:
            count += a[i] - b[i]
        elif a[i] < b[i]:
            count2 += math.ceil((b[i] - a[i])/2)
    if max(count, count2) > diff:
        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()))

diff = sum(b) - sum(a)
if diff < 0:
    print("No")
else:
    count = 0
    for i in range(N):
        if a[i] > b[i]:
            count += a[i] - b[i]
        elif a[i] < b[i]:
            count += math.ceil((b[i] - a[i])/2)
    if count > diff:
        print("No")
    else:
        print("Yes")


Failing test case input:
3
1 2 3
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()))

diff = sum(b) - sum(a)
if diff < 0:
    print("No")
else:
    count = 0
    count2 = 0
    for i in range(N):
        if a[i] > b[i]:
            count += a[i] - b[i]
        elif a[i] < b[i]:
            count2 += math.ceil((b[i] - a[i])/2)
    if max(count, count2) > diff:
        print("No")
    else:
        print("Yes")

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)]
s,t = sum(i for i in d if i>0), -sum(i for i in d if i<0)
if s > t*2:
    print('Yes')
elif s == t*2 and not any(i%2 for i in d):
    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):
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.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = False
rule1 = sum(a) <= sum(b)
rule2 = sum([2 * (ai - bi) for ai, bi in zip(a,b) if ai > bi]) <= sum(b) - sum(a)
rule3 = sum([bi - ai for ai, bi in zip(a,b) if bi > ai]) <= sum(b) - sum(a)
if rule1 and rule2 and rule3:
  ans = True

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


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()))

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):
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
4 2 2

Expected output:
Yes


Actual output:
YES


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 (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
1 0 -2
-1 3 2

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 (PyPy3 (2.4.0), verdict: Wrong Answer):
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

d=[0]*N
p=0
m=0
c=0
for i in range(N):
    d[i]=a[i]-b[i]
    if(d[i]>0):
        p+=d[i]
    else:
        m+=d[i]
        if(abs(d[i])%2==1):
            c+=1
if(abs(m)>=(abs(p)*2+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):
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

d=[0]*N
p=0
m=0
c=0
for i in range(N):
    d[i]=a[i]-b[i]
    if(d[i]>0):
        p+=d[i]
    else:
        m+=d[i]
        if(abs(d[i])%2==1):
            c+=1
m+=c

if(abs(m)>=(abs(p)*2)):
    print("Yes")
else:
    print("No")

Problem: p03438
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
num,A,B = 0,sum(a),sum(b)
for i in range(n): num = max(num,b[i]-a[i])
if num>B-A: print("No")
else: print("Yes")

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 = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
num,A,B = 0,sum(a),sum(b)
for i in range(n): num+=max(0,((b[i]-a[i])+(b[i]-a[i])%2)
if num>B-A: 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()))

ans = False
rule1 = sum(a) <= sum(b)
rule2 = sum([ai - bi for ai, bi in zip(a,b) if ai > bi]) <= sum(b) - sum(a)
rule3 = sum([bi - ai for ai, bi in zip(a,b) if bi > ai]) <= sum(b) - sum(a)
if rule1 and rule2 and rule3:
  ans = True

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


Failing test case input:
3
1 2 3
5 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()))

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):
N=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]

total_do=sum(a)-sum(b)
must_do_a=0
must_do_b=0

for i in range(N):
	dist=a[i]-b[i]
	if dist<0:
		dist=-dist
		must_do_a+=int(dist/2)
		if dist%2!=0:
			must_do_b+=1
	elif dist>0:
		must_do_b+=dist

if must_do_a>=must_do_b:
	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=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]

total_do=sum(b)-sum(a)
must_do_a=0
must_do_b=0

for i in range(N):
	dist=a[i]-b[i]
	if dist<0:
		dist=-dist
		must_do_a+=int((dist+1)/2)
		if dist%2!=0:
			must_do_b+=1
	elif dist>0:
		must_do_b+=dist
left_a=total_do-must_do_a
left_b=total_do-must_do_b

if total_do>=0 and must_do_a>=must_do_b and left_a*2==left_b:
	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
1 2 3
4 2 2

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.8.2), verdict: Wrong Answer):
import math
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=sum(b)-sum(a)
d=0
for i in range(n):d+=a[i]-b[i]if a[i]>b[i]else math.ceil((b[i]-a[i])/2)
print("Yes"if c>=d else"No")

Failing test case input:
3
0 -1 0
-2 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()))
c=sum(b)-sum(a)
d=0
for i in range(n):
 if a[i]>b[i]:d+=a[i]-b[i]
 elif a[i]%2!=b[i]%2:d+=1
print("No"if c<d else"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()))
sum_c = 0
for i in range(n):
    if (a[i] - b[i]) > 0:
        sum_c += (a[i]- b[i])
    else:
        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')

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()))
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()))
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 (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
    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 dab+dba > suma:
        print("No")
    else:
        print("Yes")
resolve()

Failing test case input:
3
0 0 1
-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()
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 (suma + sumb) % 3 == 0:
            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):
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):
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
count = - sum(A) + sum(B)
for i in range(N):
  inv = max(0, A[i] - B[i])
  
if count >= 0 and inv <= count:
  print("YES")
else :
  print("NO")

Failing test case input:
5
-1 0 -1 18 1
1 1 1 0 0

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()))
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.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

ans = False
rule1 = sum(a) <= sum(b)
rule2 = sum([bi - ai for ai, bi in zip(a,b) if ai < bi]) <= sum(b) - sum(a)
if rule1 and rule2:
  ans = True

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

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()))

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):
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:
5
7 2 2 3 11
1 7 3 -1 7

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):
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:
        print("Yes")
                


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

Expected output:
No


Actual output:
Yes


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):
N=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
dif=0
for i in range(N):
  if a[i]!=b[i]:
    dif+=1
if dif>sum(b)-sum(a):
  print('No')
  exit()
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())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
cnt=0
for i in range(N):
  cnt+=max(0, (b[i]-a[i])
if sum(b)-sum(a)<cnt:
  print('No')
  exit()

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

N = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

c = 0
d = 0
if sum(a) > sum(b):
    print('No')
else:
    for i in range(N):
        c += max(0, a[i]-b[i])
        d += max(0, math.ceil((b[i]-a[i])/2))
    if c > N or d > N:
        print('No')
    else:
        print('Yes')


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

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import math

N = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

c = 0
d = 0
if sum(a) > sum(b):
    print('No')
else:
    for i in range(N):
        c += max(0, a[i]-b[i])
        d += max(0, (b[i]-a[i])
    if c > d:
        print('No')
    else:
        print('Yes')

Problem: p03438
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

pm = 0
for i in range(N) :
    if a[i] >= b[i] :
        pm += 2 * (a[i] - b[i])
    else :
        if a[i] % 2 != b[i] % 2 :
            pm += 2
        pm -= b[i] - a[i]
        
if pm > 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):
N = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]

pm = 0
for i in range(N) :
    if a[i] >= b[i] :
        pm += 2 * (a[i] - b[i])
    else :
        if a[i] % 2 != b[i] % 2 :
            pm += 1
        pm -= b[i] - a[i]
        
if pm > 0 :
    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()]
cnt = 0
for i in range(N):
    if(A[i]%2!=B[i]%2):
        cnt += 1
if(cnt%2==0 and cnt!=0):
    print('No')
else:
    print('Yes')


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):
import math
N = int(input())
A = [int(x) for x in input().split()]
B = [int(x) for x in input().split()]
opr = sum(B)-sum(A)
cnt = 0
for i in range(N):
    if(B[i]>A[i]):
        cnt += math.ceil((B[i]-A[i])/2)
if(cnt>opr):
    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()))

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((A[i] - B[i]) / 2 + 0.5)

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


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

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 (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 += num
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):
def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    d = sum(B) - sum(A)

    if d < 0:
        print('No')
        return

    C = [a - b for a, b in zip(A, B)]
    m = sum((x for x in C if x < 0))

    print(d, m)

    if abs(m) > d * 2:
        print('No')
        return

    assert d * 2 + sum((x for x in C if x > 0)) + m == d
    print('Yes')


main()


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

Expected output:
Yes

Actual output:
3 -4
Yes


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

    d = sum(B) - sum(A)

    if d < 0:
        print('No')
        return

    C = [a - b for a, b in zip(A, B)]
    m = sum(((abs(x) + 1) 

    

    if abs(m) > d:
        print('No')
        return

    
    print('Yes')


main()