ZhenlongDai/ACPR huggingface dataset:
Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
s = list(S)
k = []
a = len(s) % 2
if a == 0:
    if s[0] == "h":
        for i in range(a):
            t = [s[i * 2],s[i * 2 + 1]]
            result = ''.join(t)
            k.append(result)
            
        
        
        n = 0
        for j in range(a):
            if k[j] == "hi":
                n = n + 1
        if n == a:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
    
else:
    print("No")   

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
s = list(S)
k = []
a = round(len(s) / 2)
b = len(s) % 2
if b == 0:
    for i in range(a):
        k.append(s[i * 2]+s[i * 2 + 1])
    n = 0
    for j in range(a):
        if k[j] == "hi":
            n = n + 1
    if n == 0:
        print("No")
    elif n == a:
        print("Yes")
    else:
        print("No")
    
else:
    print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

if S.count('hi') >= 1:
    print('Yes')
else:
    print('No')

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
cnt = S.count('hi') * 2
if len(S) == cnt:
    print('Yes')
else:
    print('No')

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
s = s.replace("hi", "")
if s:
  print("Yes")
else:
  print("No")

Failing test case input:
hg

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
s = s.replace("hi", "")
if s == "":
  print("Yes")
else:
  print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = list(input())

if len(S) % 2 != 0:
    print("No")
    exit()

if len(S) == 2 and S == "hi":
    print("Yes")
    exit()
elif len(S) == 4 and S == "hihi":
    print("Yes")
    exit()
elif len(S) == 6 and S == "hihihi":
    print("Yes")
    exit()
elif len(S) == 8 and S == "hihihihi":
    print("Yes")
    exit()
elif len(S) == 10 and S == "hihihihihi":
    print("Yes")
    exit()

Failing test case input:
glfd

Expected output:
No


Actual output:

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

if len(S) % 2 != 0:
    print("No")
    exit()

if len(S) == 2 and S == "hi":
    print("Yes")
    exit()
elif len(S) == 4 and S == "hihi":
    print("Yes")
    exit()
elif len(S) == 6 and S == "hihihi":
    print("Yes")
    exit()
elif len(S) == 8 and S == "hihihihi":
    print("Yes")
    exit()
elif len(S) == 10 and S == "hihihihihi":
    print("Yes")
    exit()

print("No")

Problem: p02747
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n =input()
print("Yes" if "hi" in n else "No")

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
n = input()
print("Yes" if n == "hi" * (len(n)
Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

if len(S) % 2 != 0:
    print("No")
    exit()
    
for i in range(len(S)-1):
    if i % 2 == 0:
        if S[i] == "h":
            pass
        else:
            print("No")
            exit()
    else:
        if S[i] == "i":
            pass
        else:
            print("No")
            exit()

print("Yes")

Failing test case input:
hc

Expected output:
No


Actual output:
Yes


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

if len(S) % 2 != 0:
    print("No")
    exit()
    
for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == "h":
            pass
        else:
            print("No")
            exit()
    else:
        if S[i] == "i":
            pass
        else:
            print("No")
            exit()

print("Yes")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

n = list(s)

if n == ["h", "i"]:
    print("Yes")

else:
    print("No")

Failing test case input:
hihi

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s = input()
s_r = s.replace("hi", "")

if len(list(s_r)) == 0:
    print("Yes")

else:
    print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
string = input()
flag = False

num = len(string)
if num % 2 == 0:
  for i in range(num-2):
    if string[i:i+2] == "hi":
      flag = True

if flag:
  print("Yes")
else:
  print("No")

Failing test case input:
hi

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
string = input()
flag = False
 
num = len(string)
if num % 2 == 0:
  for i in range(num 
    if string[2*i:2*(i+1)] == "hi":
      if i == num 
        flag = True
    else:
      break

if flag:
  print("Yes")
else:
  print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import re
index = re.search(input(),'(hi)+')
if index:
    print("Yes")
else:
    print("No")


Failing test case input:
hihi

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
import re
index = re.fullmatch(r'(hi)+', input())
if index:
    print("Yes")
else:
    print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
cc=s.count('hi')
if cc==0:
  print('No')
else:
  print('Yes')


Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
cc=s.count('hi')
l=len(s)
if cc==0:
  print('No')
elif l/2==cc:
  print('Yes')
else:
  print('No')

Problem: p02747
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
s = input()
if len(s)&1 == 1:
  print("no")
elif all(["hi" == s[i:i+2] for i in range(0, len(s), 2)]):
  print("yes")
else:
  print("no")

Failing test case input:
hhhi

Expected output:
No


Actual output:
no


Fixed submission (verdict: Accepted):
s = input()
if len(s)&1 == 1:
  print("No")
elif all(["hi" == s[i:i+2] for i in range(0, len(s), 2)]):
  print("Yes")
else:
  print("No")
Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
from collections import defaultdict
from bisect import *
mod = 10**9+7

S = input()
for i in range(5):
    if 'hi' * (i+1) == S:
        print('Yes')
        exit()
print('No')


Failing test case input:
hihi

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
from collections import defaultdict
from bisect import *
mod = 10**9+7

S = input()[:-1]
for i in range(5):
    if 'hi' * (i+1) == S:
        print('Yes')
        exit()
print('No')

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S=input()

pre=S[0]

ans='Yes'

if len(S)%2==1:
    print('No')
else:
    for i in range(len(S)):
        if i%2==1:
            if S[i]!='i':
                ans='NO'
        else:
            if S[i]!='h':
                ans='NO'
    print(ans)

Failing test case input:
egkg

Expected output:
No


Actual output:
NO


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

pre=S[0]

ans='Yes'

if len(S)%2==1:
    print('No')
else:
    for i in range(len(S)):
        if i%2==0:
            if S[i]!='h':
                ans='No'
        else:
            if S[i]!='i':
                ans='No'
    print(ans)

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def judge(check_string):

    HITACH_STRING = "hi"

    if not((1 <= len(check_string)) and (len(check_string) <= 10)):
        print("No")

    if HITACH_STRING in check_string:
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    hitachi_string = input()
    judge(hitachi_string)

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import re

def judge(check_string):

    
    if not((1 <= len(check_string)) and (len(check_string) <= 10)):
        print("No")

    
    allow_pattern = "[a-z]+"
    group = re.match(allow_pattern, check_string)

    HITACH_STRING = "^(hi){1,}$"

    if(re.match(HITACH_STRING, check_string)):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    hitachi_string = input()
    judge(hitachi_string)

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()

while len(S) >= 2:
    if S[0:1]== 'hi':
        S=S[2:]
    else:
        break
if len(S)==0:
    print('Yes')
else:
    print('No')


Failing test case input:
hi

Expected output:
Yes

Actual output:
No


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

while len(S) >= 2:
    if S[0:2]== 'hi':
        S=S[2:]
    else:
        break
if len(S)==0:
    print('Yes')
else:
    print('No')

Problem: p02747
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input()
s = s.replace('hii', '')
if s.count('hi') > 0: print('Yes')
else: print('No')


Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
s = s.replace('hi', '')
if s == '': print('Yes')
else: print('No')
Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

if s.count("hi") > 0:
    print("Yes")
else:
    print("No")

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


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

if s.count("hi") == len(s) / 2:
    print("Yes")
else:
    print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = a.count("hi")
if b > 0:
    print("Yes")
else:
    print("No")

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
a = input()
b = a.split("hi")
c = "".join(b)
if len(c) <= 0:
    print("Yes")
else:
    print("No")

Problem: p02747
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
S=input()
N=len(S)
n1=0
n2=0
for i in range(N):
 if S[i]=="h":
  n1=n1+1
 if S[i]=="i":
  n2=n2+1

if (n1==n2)and(n1==N/2):
 print("Yes")
else:
 print("No")

Failing test case input:
ih

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S=input()
N=len(S)
n1=0
n2=0
for i in range(N):
 if (i%2==0)and(S[i]=="h"):
  n1=n1+1
 if (i%2==1)and(S[i]=="i"):
  n2=n2+1

if (n1==n2)and(n1+n2==N):
 print("Yes")
else:
 print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()
si = 'hi'
if s.strip(si) != "":
    print('No')
else:
    print('Yes')

Failing test case input:
hh

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s = input()
si = 'hi'
if s.replace(si, '').strip() == "":
    if len(s) != 0:
        print('Yes')
else:
    print('No')

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input()

n = list(set((s)))
print(n)

if n == ["h", "i"] or ["i", "h"]:
    print("Yes")

else:
    print("No")

Failing test case input:
glff

Expected output:
No


Actual output:
['g', 'f', 'l']
Yes


Fixed submission (verdict: Accepted):
s = input()
s_r = s.replace("hi", "")

if len(list(s_r)) == 0:
    print("Yes")

else:
    print("No")

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

s = list(map(str,input()))
cnt = 0

for i in s:
    if i == "h":
        cnt = 1
    elif i == "i":
        if cnt == 1:
            print("Yes")
            sys.exit()
        else:
            cnt = 0
    else:
        cnt = 0
        continue

print("No")

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
import sys

s = list(map(str,input()))

if len(s)%2 == 1:
    print("No")
    sys.exit()

for i in range(len(s)):
    if i%2 == 0:
        if s[i] != "h":
            print("No")
            sys.exit()
    else:
        if s[i] != "i":
            print("No")
            sys.exit()

print("Yes")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if s.count("hi")>=1:
    print("Yes")
else:
    print("No")

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
s=input()
if s.count("hi")*2==len(s):
    print("Yes")
else:
    print("No")
Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = input()
s = list(S)
k = []
a = len(s) % 2
if a == 0:
    for i in range(a):
        t = [s[i * 2],s[i * 2 + 1]]
        result = ''.join(t)
        k.append(result)
        
    
    
    n = 0
    for j in range(a):
        if k[j] == "hi":
            n = n + 1
    if n == a:
        print("Yes")
    else:
        print("No")
else:
    print("No")   

Failing test case input:
ck

Expected output:
No


Actual output:
Yes


Fixed submission (verdict: Accepted):
S = input()
s = list(S)
k = []
a = round(len(s) / 2)
b = len(s) % 2
if b == 0:
    for i in range(a):
        k.append(s[i * 2]+s[i * 2 + 1])
    n = 0
    for j in range(a):
        if k[j] == "hi":
            n = n + 1
    if n == 0:
        print("No")
    elif n == a:
        print("Yes")
    else:
        print("No")
    
else:
    print("No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
input_str = input()

if input_str.count("hi"):
  print("Yes")
else:
  print("No")

Failing test case input:
hhhi

Expected output:
No


Actual output:
Yes


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

if input_str.replace("hi","") == "":
  print("Yes")
else:
  print("No")

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

d = {"h":0, "i":0}
S = input()
if len(S) == 1:
    print("No")
    exit()
flag = True
for i in range(len(S)-1):
    if S[i:i+2] != "hi":
        flag = False
        break
print("Yes" if flag else "No")

Failing test case input:
hihi

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):

d = {"h":0, "i":0}
S = input()
if len(S) % 2 == 1:
    print("No")
    exit()
flag = True
for i in range(0, len(S)-1, 2):
    if S[i:i+2] != "hi":
        flag = False
        break
print("Yes" if flag else "No")

Problem: p02747
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s=input()
if(s.count("hi")==len(s)):
  print("Yes")
else:
  print("No")

Failing test case input:
hi

Expected output:
Yes

Actual output:
No


Fixed submission (verdict: Accepted):
s=input()
if(2*s.count("hi")==len(s)):
  print("Yes")
else:
  print("No")
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

gain = 0
for i in range(0,N):
    if(V>C):
        gain += V[i] - C[i]

print(gain)

Failing test case input:
4
0 -1 0 133
-2 2 1 1

Expected output:
134


Actual output:
130


Fixed submission (verdict: Accepted):


N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

gain = 0
for i in range(0,N):
    if(V[i]>C[i]):
        gain += V[i] - C[i]

print(gain)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
s=sorted([a-b for a,b in zip(v,c)])[::-1]
d=[sum(s[:i])for i in range(len(s))]
print(max(d))

Failing test case input:
1
56
2

Expected output:
54


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
s=sorted([a-b for a,b in zip(v,c)])[::-1]
d=[sum(s[:i])for i in range(len(s)+1)]
print(max(max(d),0))

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
V.sort()
C.sort()
V_C = []
for i in range(N):
    if V[i] > C[i]:
        V_C.append(V[i]-C[i])
print(sum(V_C))

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

Expected output:
328


Actual output:
326


Fixed submission (verdict: Accepted):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
V_C = []
for i in range(N):
    if V[i] > C[i]:
        V_C.append(V[i]-C[i])
print(sum(V_C))

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


n = int(input())
value = [int(s) for s in input().split()]
cost = [int(t) for t in input().split()]

VnS = []

for i in range(n):
    if value[i]-cost[i] > 0:
        VnS.append(value[i] - cost[i])

VnS.sort(reverse=True)
print(sum(VnS[:2]))


Failing test case input:
4
0 53 1 0
6 2 -2 -2

Expected output:
56


Actual output:
54


Fixed submission (verdict: Accepted):


n = int(input())
value = [int(s) for s in input().split()]
cost = [int(t) for t in input().split()]

VnS = []

for i in range(n):
    if value[i]-cost[i] > 0:
        VnS.append(value[i] - cost[i])

VnS.sort(reverse=True)
print(sum(VnS))
Problem: p03060
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import time
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
start = time.time()
y = 0
for i in range(2 ** n):
  v_total = 0
  c_total = 0
  for j in range(n):  
    if ((i >> j) & 1):  
      v_total += v[j]
      c_total += c[j]
  if (v_total-c_total) > y:
    y = v_total-c_total
print(y)
end_time = time.time() - start
print(end_time)

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

Expected output:
7


Actual output:
7
3.5762786865234375e-05


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
y = 0
for i in range(2 ** n):
  v_total = 0
  c_total = 0
  for j in range(n):  
    if ((i >> j) & 1):  
      v_total += v[j]
      c_total += c[j]
  if (v_total-c_total) > y:
    y = v_total-c_total
print(y)

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


n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

profits = []
z = 0

for i in range(n):
    profits.append(v[i] - c[i])
profits.sort()

print(profits)

for i in profits:
    p = profits.pop()
    if p <= 0:
        print(z)
        exit()
    else:
        z += p
print(z)

Failing test case input:
4
0 -1 0 124
0 2 1 1

Expected output:
123


Actual output:
[-3, -1, 0, 123]
123


Fixed submission (verdict: Accepted):


n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

profits = []
z = 0

for i in range(n):
    profits.append(v[i] - c[i])
profits.sort()


for i in range(n):
    p = profits.pop()
    
    if p <= 0:
        print(z)
        exit()
    else:
        z += p
print(z)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v,c = list(map(int,input().split())),list(map(int,input().split()))
ans = 0
for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]

Failing test case input:
4
0 -1 0 133
-2 2 1 1

Expected output:
134


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
v,c = list(map(int,input().split())),list(map(int,input().split()))
ans = 0
for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]
print(ans)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
V = []
C = []
N = 0

i = 0
ans = 0

str = input().split()
while i < N:
  V[i] = int(str[i])
  i = i+1
  
i=0
str = 0
str = input().split()
while i < N:
  C[i] = int(str[i])

while i<N:
  if V[i] > C[i]:
    ans = ans + V[i] - C[i]
    
    
print(ans)

Failing test case input:
4
1 1 0 26
0 2 6 2

Expected output:
25


Actual output:
0


Fixed submission (verdict: Accepted):
N = 0
V = []
C = []
 
i = 0
ans = 0

str = input()
N = int(str)
 
str = input().split()
while i < N:
  V.append(int(str[i]))
  i = i+1
  
i=0
str = 0
str = input().split()
while i < N:
  C.append(int(str[i]))
  i = i+1

i=0
while i<N:
  if V[i] > C[i]:
    ans = ans + V[i] - C[i]
  i = i+1
    
    
print(ans)
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
List = []
for i in range(N):
    List.append(V[i]-C[i])
List.sort()
for i in List:
    if i > 0:
        print(sum(List[i:]))
        break
print('0')

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

Expected output:
114


Actual output:
0
0


Fixed submission (verdict: Accepted):


N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
List = []
for i in range(N):
    List.append(V[i]-C[i])
List.sort(reverse=True)
total = 0
for i in List:
    if i > 0:
        total += i
print(total)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n= int(input())

v= list(map(int, input().split())) 
c= list(map(int, input().split()))
r=[]

for i in range(n):
  r.append(v[i]-c[i]) 

r.append(0)
r.sort(reverse=True)
print(r)

ret= sum([j for j in r if j>=0])
print(ret)

Failing test case input:
4
13 21 11 26
-1 30 6 10

Expected output:
35


Actual output:
[16, 14, 5, 0, -9]
35


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

v= list(map(int, input().split())) 
c= list(map(int, input().split()))
r=[]

for i in range(n):
  r.append(v[i]-c[i]) 

r.append(0)
r.sort(reverse=True)

ret= sum([j for j in r if j>=0])
print(ret)

Problem: p03060
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n =int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
  if (v[i] - c[i]) > 0:
    ans +~ v[i] - c[i]
print(ans)

Failing test case input:
4
2 -1 0 69
0 2 8 0

Expected output:
71


Actual output:
0


Fixed submission (verdict: Accepted):
n =int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i in range(n):
  if (v[i] - c[i]) > 0:
    ans += v[i] - c[i]
print(ans)

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

def main():
    input = sys.stdin.readline
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    
    
    sa = [ V[i] - C[i] if V[i] - C[i] > 0 else 0 for i in range(N) ]
    
    
    sa.sort()
    
    
    print(sum(sa[-2:]))
    
if __name__ == '__main__':
    main()



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

Expected output:
89


Actual output:
88


Fixed submission (verdict: Accepted):
import sys

def main():
    input = sys.stdin.readline
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    
    
    sa = [ V[i] - C[i] if V[i] - C[i] > 0 else 0 for i in range(N) ]
    
    
    sa.sort()
    
    print(sum(sa))
    
if __name__ == '__main__':
    main()
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

X = 0
Y = 0

for i in range(N):
    if V[i] > C[i]:
        v = V[i]
        c = C[i]
        X = X + v
        Y = Y + c
        

if (X-Y) > 0:
    print(X-Y)

Failing test case input:
1
1
45

Expected output:
0


Actual output:

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

X = 0
Y = 0

for i in range(N):
    if V[i] > C[i]:
        v = V[i]
        c = C[i]
        X = X + v
        Y = Y + c

print(X-Y)

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

X = 0
Y = 0

for i in range(N):
    if V[i] > C[i]:
        v = V[i]
        c = C[i]
        X = X + v
        Y = Y + c
        print(X-Y)

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

Expected output:
327


Actual output:
1
327


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

X = 0
Y = 0

for i in range(N):
    if V[i] > C[i]:
        v = V[i]
        c = C[i]
        X = X + v
        Y = Y + c

print(X-Y)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in range(n):
    if v[i]-c[i]>0:
        ans+=v[i]+c[i]
print(ans)

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

Expected output:
113


Actual output:
119


Fixed submission (verdict: Accepted):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in range(n):
    if v[i]-c[i]>0:
        ans+=v[i]-c[i]
print(ans)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=0

for i in range(a):
  if (b[i]-c[i]) > 0:
    d=b[i]-c[i]

print(d)
  

Failing test case input:
4
6 2 11 26
-1 15 16 10

Expected output:
23


Actual output:
16


Fixed submission (verdict: Accepted):
a=int(input())
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=0
 
for i in range(a):
  if (b[i]-c[i]) > 0:
    d=d+b[i]-c[i]
 
print(d)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
a = 0
for i in range(N):
    a += abs(V[i]-C[i])
print(a)

Failing test case input:
4
0 1 0 39
0 2 6 0

Expected output:
39


Actual output:
46


Fixed submission (verdict: Accepted):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
a = 0
for i in range(N):
    if V[i] > C[i]:
        a += V[i]-C[i]
print(a)
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

total_v = 0

for i in range(n-1):
  if v[i] - c[i] > 0:
    total_v += v[i] - c[i]
print(total_v)



Failing test case input:
1
111
0

Expected output:
111


Actual output:
0


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

total_v = 0

for i in range(n):
  if v[i] - c[i] > 0:
    total_v += (v[i] - c[i])

print(total_v)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
count = 0
for i in range(n):
  if v[i] > c[i]:
    count += 1
print(count)

Failing test case input:
4
1 2 2 328
4 1 2 0

Expected output:
329


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
x, y = 0, 0
for i in range(n):
  if v[i] > c[i]:
    x += v[i]
    y += c[i]
print(x-y)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
C = list(map(int, input().split()))
V = list(map(int, input().split()))
sum = 0
for i in range(N):
    sum += max(0, V[i]-C[i])
print(sum)

Failing test case input:
1
100
0

Expected output:
100


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
sum = 0
for i in range(N):
    sum += max(0, V[i]-C[i])
print(sum)

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

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

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

P = 0

for i in range(0,N):
  Y = V[i] - C[i]
  if Y >0:
    P += Y
print(Y)


Failing test case input:
4
6 2 11 13
-1 1 10 4

Expected output:
18


Actual output:
9


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

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

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

P = 0

for i in range(N):
  Y = V[i] - C[i]
  if Y >0:
    P += Y
print(P)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
      
sumV = 0
sumC = 0
maxi = 0
for i in range(n):
    sumV += v[i]
    sumC += c[i]
    maxi = max(sumV-sumC,maxi)
print(maxi)

Failing test case input:
4
0 -2 1 262
0 4 0 1

Expected output:
262


Actual output:
256


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
      
maxi = 0
for i in range(n):
    if v[i] > c[i]:
        maxi += v[i] -c[i] 
print(maxi)
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

ans=0
for i in range(n):
  if a[i]>b[i]:
    ans+=a[i]

print(ans)

Failing test case input:
4
0 -2 0 180
0 2 2 1

Expected output:
179


Actual output:
180


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

ans=0
for i in range(n):
  if a[i]>b[i]:
    ans+=a[i]-b[i]

print(ans)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = []
for v in range(N):
  dictionary.append([values[v],costs[v]])
x,y=0,0
sort_dict = sorted(dictionary,reverse=True)
result = []
for i in range(N):
  if i+1<N and sort_dict[i][0] > sort_dict[i][1]:
    result.append(sort_dict[i][0]-sort_dict[i][1])
print(sum(result))

Failing test case input:
4
1 53 1 0
5 2 -1 -2

Expected output:
55


Actual output:
53


Fixed submission (verdict: Accepted):
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = []
for v in range(N):
  dictionary.append([values[v],costs[v]])
x,y=0,0
result = []
for i in range(N):
  if dictionary[i][0] - dictionary[i][1]>0:
    result.append(dictionary[i][0]-dictionary[i][1])
print(sum(result))

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

ans=0
for i in range(n):
    diff=v[i]-c[i]
    if diff > 0:
        ans+=diff
print(diff)


Failing test case input:
4
28 0 -5 2
0 0 -8 -1

Expected output:
34


Actual output:
3


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

ans=0
for i in range(n):
    diff=v[i]-c[i]
    if diff > 0:
        ans+=diff
print(ans)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = input().split()
c = input().split()
v = list(map(int, v))
c = list(map(int, c))
diff = list()
for i in range(n):
    diff.append(v[i]- c[i])

diff.sort()
diff.reverse()
if len(diff) >= 2:
    print(diff[0] + diff[1])

elif diff[0] <= 0:
    print(0)

else:
    print(diff[0])

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

Expected output:
139


Actual output:
138


Fixed submission (verdict: Accepted):
n = int(input())
v = input().split()
c = input().split()
v = list(map(int, v))
c = list(map(int, c))
diff = list()
for i in range(n):
    if v[i] - c[i] > 0:
        diff.append(v[i] - c[i])

diff.sort()
diff.reverse()
if len(diff) >= 2:
    print(sum(diff))

elif len(diff) == 1:
    print(diff[0])

elif len(diff) == 0:
    print(0)
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = input()
V = input().split(" ")
C = input().split(" ")

n = int(n)
V_tmp = []
for v in V:
    V_tmp.append(int(v))
V = V_tmp
C_tmp = []
for c in C:
    C_tmp.append(int(v))
C = C_tmp
SA = []
for i in range(n):
    SA.append(V[i]-C[i])
max_ = 0
for i in range(n):
    if SA[i] >= 0:
        max_ += SA[i]
print(max_)

Failing test case input:
4
-2 90 1 1
2 2 -2 4

Expected output:
91


Actual output:
89


Fixed submission (verdict: Accepted):
n = input()
V = input().split(" ")
C = input().split(" ")

n = int(n)
V_tmp = []
for v in V:
    V_tmp.append(int(v))
V = V_tmp
C_tmp = []
for c in C:
    C_tmp.append(int(c))
C = C_tmp
SA = []
for i in range(n):
    SA.append(V[i]-C[i])
max_ = 0
for i in range(n):
    if SA[i] >= 0:
        max_ += SA[i]
print(max_)

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

import sys
input = sys.stdin.readline

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = []
for i in range(n):
    ans.append(v[i]-c[i])
ans.sort()
print(max(0,sum(ans)-ans[0]))

Failing test case input:
1
101
4

Expected output:
97


Actual output:
0


Fixed submission (verdict: Accepted):

import sys
input = sys.stdin.readline

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = [0]
for i in range(n):
    if v[i]-c[i] >0:
        ans.append(v[i]-c[i])
print(sum(ans))

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

a = list(zip(v, c))
t = 0
for i, m in a:
  p = m - i
  if p > 0:
    t += p

print(t)
    

Failing test case input:
1
15
0

Expected output:
15


Actual output:
0


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

a = list(zip(v, c))
t = 0
for i, m in a:
  p = i - m 
  if p > 0:
    t += p

print(t)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
V = list(map(int,input().split()))
C = list(map(int,input().split()))
sum = 0
for v,c in zip(V,C):
  if v-c<0:
    sum+=v-c
print(sum)

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

Expected output:
90


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
sum = 0
for v,c in zip(V,C):
  if (v-c)>0:
    sum+=v-c
print(sum)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
print(V)
print(C)
ans =0
for i in range(N):
  z = V[i]-C[i]
  if z>0:
    ans+=z
    
print(ans)

Failing test case input:
4
6 2 11 13
-1 1 10 4

Expected output:
18


Actual output:
[6, 2, 11, 13]
[-1, 1, 10, 4]
18


Fixed submission (verdict: Accepted):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans =0
for i in range(N):
  z = V[i]-C[i]
  if z>0:
    ans+=z
    
print(ans)
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
s=sorted([a-b for a,b in zip(v,c)])[::-1]
d=[sum(s[:i])for i in range(len(s))]
print(max(max(d),0))


Failing test case input:
1
111
0

Expected output:
111


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
s=sorted([a-b for a,b in zip(v,c)])[::-1]
d=[sum(s[:i])for i in range(len(s)+1)]
print(max(max(d),0))

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

V = list(map(int,input().split()))
C = list(map(int,input().split()))

cost = [v-c for v,c in zip(V,C)]

max_cost = cost[0]

for i in range(n-1):
    for j in range(i+1,n):
        nc = cost[i] + cost[j]
        if max_cost < nc:
            max_cost = nc

print(max_cost)


Failing test case input:
4
6 2 11 13
-1 1 10 10

Expected output:
12


Actual output:
10


Fixed submission (verdict: Accepted):
import itertools

n = int(input())

V = list(map(int,input().split()))
C = list(map(int,input().split()))

cost = [v-c for v,c in zip(V,C)]

max_cost = 0

for i in range(1,n+1):
    for v in itertools.combinations(cost,i):
        m_cost = 0
        for c in v:
            m_cost = m_cost + c
        if max_cost < m_cost:
            max_cost = m_cost


print(max_cost)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = []
for v in range(N):
  dictionary.append([values[v],costs[v]])
x,y=0,0
sort_dict = sorted(dictionary,reverse=True)
result = []
for i in range(N):
  if i+1<N and sort_dict[i][0] > sort_dict[i][1] and sort_dict[i][0] - sort_dict[i][1]>0:
    result.append(sort_dict[i][0]-sort_dict[i][1])
print(sum(result))

Failing test case input:
1
100
-2

Expected output:
102


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = []
for v in range(N):
  dictionary.append([values[v],costs[v]])
x,y=0,0
result = []
for i in range(N):
  if dictionary[i][0] - dictionary[i][1]>0:
    result.append(dictionary[i][0]-dictionary[i][1])
print(sum(result))

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

v.sort(reverse=True)
c.sort(reverse=True)

maximum = 0
profit = []
for i in range(len(v)):
    tmp = v[i] - c[i]
    if tmp > 0:
        maximum += tmp
    tmp = 0

print(maximum)


Failing test case input:
4
18 1 -11 2
2 2 -3 -1

Expected output:
19


Actual output:
18


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


maximum = 0
profit = []
for i in range(len(v)):
    tmp = v[i] - c[i]
    if tmp > 0:
        maximum += tmp
    tmp = 0

print(maximum)
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

v_list = [ int(v) for v in input().split() ]
c_list = [ int(v) for v in input().split() ]

ans = sum([ max( 0, (v_list[i]-c_list[i]) ) for i in range(n) ])

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

Expected output:
9


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
	
v_list = [ int(v) for v in input().split() ]
c_list = [ int(v) for v in input().split() ]
	
ans = sum([ max( 0, (v_list[i]-c_list[i]) ) for i in range(n) ])

print(ans)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i]):
    s = sum(l[0:i])
print(s)

Failing test case input:
4
6 2 11 13
-1 1 10 4

Expected output:
18


Actual output:
17


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i+1]):
    s = sum(l[0:i+1])
print(s)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input("宝石の数")
V = list(map(int,input().split())) 
Y = list(map(int,input().split())) 
goukei = 0
for v, y in zip(V,Y): 
    if(y-v >= 0):
        goukei +=0
    else:
        goukei += v-y
print(goukei)        
    

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

Expected output:
186


Actual output:
宝石の数186


Fixed submission (verdict: Accepted):
N = input()
V = list(map(int,input().split())) 
Y = list(map(int,input().split())) 
goukei = 0
for v, y in zip(V,Y): 
    if(y-v >= 0):
        goukei +=0
    else:
        goukei += v-y
print(goukei)

Problem: p03060
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import itertools
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
xy = []
for i in range(n):
    for h in itertools.combinations(range(0,n),i):
        x = 0
        y = 0
        for j in h:
            x += v[j]
            y += c[j]
        xy.append(x-y)
print(max(xy))

Failing test case input:
4
6 2 19 13
-1 1 3 4

Expected output:
33


Actual output:
32


Fixed submission (verdict: Accepted):
import itertools
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
xy = 0
for i in range(1,n+1):
    for h in itertools.combinations(range(0,n),i):
        x = 0
        y = 0
        for j in h:
            x += v[j]
            y += c[j]
        if xy < x-y:
            xy = x-y
print(xy)
Problem: p03060
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):


n = int(input())

v = [0] * n
c = [0] * n

v = [int(s) for s in input().split()]
c = [int(s) for s in input().split()]

ans = []

for i in range(n):
    a = v[i] - c[i]
    ans.append(a)
    
print(max(ans))

    

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

Expected output:
113


Actual output:
112


Fixed submission (verdict: Accepted):


n = int(input())

v = [0] * n
c = [0] * n

v = [int(s) for s in input().split()]
c = [int(s) for s in input().split()]

ans = []

for i in range(n):
    a = v[i] - c[i]
    if a > 0 :
      ans.append(a)
    
print(sum(ans))

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = input()
V = input().split(' ')
C = input().split(' ')

max = -1000
for value, cost in zip(V, C):
    value_int = int(value)
    cost_int = int(cost)
    if(max < value_int - cost_int):
        max = value_int - cost_int

print(max)

Failing test case input:
4
0 -2 1 84
0 2 0 0

Expected output:
85


Actual output:
84


Fixed submission (verdict: Accepted):
N = input()
V = input().split(' ')
C = input().split(' ')

max = 0
for value, cost in zip(V, C):
    value_int = int(value)
    cost_int = int(cost)
    if(value_int - cost_int > 0):
        max += value_int - cost_int

print(max)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=0
 
for i in range(a):
  if (b[i]-c[i]) > 0:
    print(b[i]-c[i])
    d=d+b[i]-c[i]
 
print(d)

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

Expected output:
8


Actual output:
5
3
8


Fixed submission (verdict: Accepted):
a=int(input())
b=list(map(int,input().split()))
c=list(map(int,input().split()))
d=0
 
for i in range(a):
  if (b[i]-c[i]) > 0:
    d=d+b[i]-c[i]
 
print(d)

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

cal = []
for i in range(0,n):
    cal.append(v[i]-c[i])
cal.sort(reverse=True)
print(cal)
ans = 0
for j in range(0,n):
    if cal[j] < 0:
        break
    ans += cal[j]
print(ans)

Failing test case input:
1
6
-10

Expected output:
16


Actual output:
[16]
16


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

cal = []
for i in range(0,n):
    cal.append(v[i]-c[i])
cal.sort(reverse=True)
ans = 0
for j in range(0,n):
    if cal[j] < 0:
        break
    ans += cal[j]
print(ans)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
H = list(map(int, input().split()))
count = 0
M = 0
for i in range(N):
  if H[i]>=M:
    count += 1
    M = H[i]
print(count)

Failing test case input:
4
1 1 0 39
0 2 6 0

Expected output:
40


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
X = list(map(int, input().split()))
Y = list(map(int, input().split()))
ans = 0
for i in range(N):
  if X[i]-Y[i]>0:
    ans += X[i]-Y[i]
print(ans)
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

V = list(map(int,input().split()))
C = list(map(int,input().split()))

cost = [v-c for v,c in zip(V,C)]

max_cost = -100

for i in range(n-1):
    for j in range(i+1,n):
        nc = cost[i] + cost[j]
        if max_cost < nc:
            max_cost = nc

print(max_cost)


Failing test case input:
3
10 2 5
12 5 4

Expected output:
1


Actual output:
-1


Fixed submission (verdict: Accepted):
import itertools

n = int(input())

V = list(map(int,input().split()))
C = list(map(int,input().split()))

cost = [v-c for v,c in zip(V,C)]

max_cost = 0

for i in range(1,n+1):
    for v in itertools.combinations(cost,i):
        m_cost = 0
        for c in v:
            m_cost = m_cost + c
        if max_cost < m_cost:
            max_cost = m_cost


print(max_cost)

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

print(List)
sum=0
i=0
while i < a:
  if List[i] - List2[i] > 0:
    sum += List[i] - List2[i]
  i +=1
print(sum)

Failing test case input:
4
0 -1 0 133
-2 2 1 1

Expected output:
134


Actual output:
[0, -1, 0, 133]
134


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

sum=0
i=0
while i < a:
  if List[i] - List2[i] > 0:
    sum += List[i] - List2[i]
  i +=1
print(sum)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = input().split()
c = input().split()
v = list(map(int, v))
c = list(map(int, c))
diff = list()
for i in range(n):
    diff.append(v[i] - c[i])

diff.sort()
diff.reverse()
if len(diff) >= 2:
    print(diff[0] + diff[1])

elif diff[0] <= 0:
    print(0)

else:
    print(diff[0])

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

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
v = input().split()
c = input().split()
v = list(map(int, v))
c = list(map(int, c))
diff = list()
for i in range(n):
    if v[i] - c[i] > 0:
        diff.append(v[i] - c[i])

diff.sort()
diff.reverse()
if len(diff) >= 2:
    print(sum(diff))

elif len(diff) == 1:
    print(diff[0])

elif len(diff) == 0:
    print(0)

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

diff = [v-c if (v-c > 0) else 0 for v, c in zip(V, C)]
print(max(diff))

Failing test case input:
4
-2 90 1 1
2 2 -2 -1

Expected output:
93


Actual output:
88


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

diff = [v-c if (v-c > 0) else 0 for v, c in zip(V, C)]
print(sum(diff))
Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i,j in zip(v,c):
  cospa = i - j
  if cospa > ans:
    ans = cospa
print(ans)
    

Failing test case input:
4
6 2 11 13
-1 1 10 4

Expected output:
18


Actual output:
9


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = 0
for i,j in zip(v,c):
  cospa = i - j
  if cospa > 0:
    ans += cospa
print(ans)

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


n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

profits = []
z = 0

for i in range(n):
    profits.append(v[i] - c[i])
profits.sort()



for i in profits:
    p = profits.pop()
    if p < 0:
        print(z)
        exit()
    else:
        z += p
print(z)

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

Expected output:
89


Actual output:
88


Fixed submission (verdict: Accepted):


n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

profits = []
z = 0

for i in range(n):
    profits.append(v[i] - c[i])
profits.sort()


for i in range(n):
    p = profits.pop()
    
    if p <= 0:
        print(z)
        exit()
    else:
        z += p
print(z)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
X = [V - C for (V, C) in zip(V, C)]
i = 0
for i in X:
    if i < 0:
        X.remove(i)

print(X)

Failing test case input:
1
101
0

Expected output:
101


Actual output:
[101]


Fixed submission (verdict: Accepted):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
X = [V - C for (V, C) in zip(V, C)]
i = 0
a = 0
for i in X:
    if i > 0:
        a += i
print(a)

Problem: p03060
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i-1]):
    s = sum(l[0:i-1])
print(s)

Failing test case input:
4
6 2 19 13
-1 1 3 4

Expected output:
33


Actual output:
32


Fixed submission (verdict: Accepted):
n = int(input())
v = list(map(int, input().strip().split(' ')))
c = list(map(int, input().strip().split(' ')))
l = [0] * n
for i in range(n):
  l[i]=v[i]-c[i]
l.sort(reverse=True)
s = 0
for i in range(n):
  if s < sum(l[0:i+1]):
    s = sum(l[0:i+1])
print(s)