Problem:
 Score : 200 points    Problem Statement There are N gems. The value of the i -th gem is V_i .  You will choose some of these gems, possibly all or none, and get them.  However, you need to pay a cost of C_i to get the i -th gem.  Let X be the sum of the values of the gems obtained, and Y be the sum of the costs paid.  Find the maximum possible value of X-Y .      Constraints  All values in input are integers.  1 \leq N \leq 20  1 \leq C_i, V_i \leq 50         Input Input is given from Standard Input in the following format:  N  V_1  V_2  ...  V_N  C_1  C_2  ...  C_N       Output Print the maximum possible value of X-Y .        Sample Input 1 3
10 2 5
6 3 4      Sample Output 1 5  If we choose the first and third gems, X = 10 + 5 = 15 and Y = 6 + 4 = 10 .
We have X-Y = 5 here, which is the maximum possible value.       Sample Input 2 4
13 21 6 19
11 30 6 15      Sample Output 2 6       Sample Input 3 1
1
50      Sample Output 3 0

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
V = lr()
C = lr()
total = 0
for i in range(N):
    result = V[i] - C[i]
    if result > 0:
        total += result

print(total)

Solution (Python):

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
V = np.array(lr())
C = np.array(lr())
V -= C
V = V[V>0]
answer = V.sum()
print(answer)

Solution (Python):
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]:
        ans += V[i] - C[i]

print(ans)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for v, s in zip(V, C):
    ans += max(0, v-s)
print(ans)

Solution (Python):
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)

Solution (Python):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
print(sum([a-b if a-b>0 else 0 for a,b in zip(V,C)]))

Solution (Python):
N=int(input())
V=[int(i) for i in input().split()]
C=[int(t) for t in input().split()]
count=0
for s in range(N):
    if V[s]>C[s]:
        count+=V[s]-C[s]
print(count)

Solution (Python):
import math
import collections
import sys

input = sys.stdin.readline
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

n=I()
V=LI()
C=LI()
ans=0
for i in range(n):
    if V[i]-C[i]>=0:
        ans+=V[i]-C[i]
print(ans)

Solution (Python):
n = int(input())
vli = list(map(int,input().split()))
cli = list(map(int,input().split()))
total = 0
for i in range(n):
    if vli[i] >= cli[i]:
        total += vli[i] - cli[i]
print(total)

Solution (Python):
N = int(input())
V = [int(x) for x in input().split()]
C = [int(y) for y in input().split()]
ans = 0
for i in range(N):
    t = V[i] - C[i]
    if t > 0:
        ans += t
print(ans)

Solution (Python):
num = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

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

Solution (Python):
import numpy as np
N=int(input())
X=list(map(int, input().split()))
Y=list(map(int, input().split()))
Z=np.zeros(N)
for i in range(N):
  Z[i]=X[i]-Y[i]
print('{:.0f}'.format(sum(Z[np.where(Z>0)])))

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

Solution (Python):
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)

Solution (Python):
N,*A,=map(int,open(0).read().split());print(sum((x-y)*(x>y)for x,y in zip(A[:N],A[N:])))

Solution (Python):

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]:
        ans += v[i] - c[i]
print(ans)

Solution (Python):

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]:
        x += v[i]
        y += c[i]
print(x - y)

Solution (Python):
n=int(input())
V=[int(_) for _ in input().split()]
C=[int(_) for _ in input().split()]
X_Y=[x-y for x,y in zip(V,C) if x-y>0]
print(sum(X_Y))

Solution (Python):
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)

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

import numpy as np
V = np.array(V)
C = np.array(C)

a = V - C

ans = a[a>0].sum()

print(ans)

Solution (Python):
n=int(input())
v=[0]*n
c=[0]*n
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]):
    x+=v[i]
    y+=c[i]
    
print(x-y)

Solution (Python):
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)

Solution (Python):
n = int(input())
v = map(int,input().split())
c = map(int,input().split())
print(sum(i-j for i,j in zip(v,c) if i-j>0))

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
a=[0]*n
count=0
for i in range(n):
  a[i]=v[i]-c[i]
  
for i in range(n):
  if a[i]>=0:
    count+=a[i]
print(count)

Solution (Python):
n =int(input())
v =list(map(int ,input().split()))
c =list(map(int ,input().split()))
ans =0
for i,j in zip(v,c):
    ans += max(0 ,i-j)
print(ans)

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0
for i,j in zip(v,c):
  ans += max(0, i-j)
print(ans)

Solution (Python):
n=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))
d=0
for i in range(n):
  tmp=v[i]-c[i]
  if tmp>0:
    d+=tmp
print(d)

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

ans = 0
for i, j in zip(V, C):
    if i >= j:
        ans += i - j

print(ans)

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

Solution (Python):
a = int(input())
value_list =input().split()
cost_list = input().split()
ans = 0
for i in range(a):
    if int(value_list[i]) - int(cost_list[i]) > 0:
        ans += int(value_list[i]) - int(cost_list[i])
        
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
n = int(input()) 

V = [int(i) for i in input().split()] 
C = [int(i) for i in input().split()]

ans = 0
for i in range(n):
    if V[i] - C[i] > 0:
        ans += V[i] - C[i]
print(ans)

Solution (Python):
N= int(input())

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

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

print(sum)

Solution (Python):
N = int(input())
V = [int(num) for num in input().split()]
C = [int(num) for num in input().split()]
value = 0
for i in range(N):
  if V[i] > C[i]:
    value += V[i] - C[i]
  else:
    continue
print(value)

Solution (Python):
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]:
    ans = ans + (V[i]-C[i])

print(ans)

Solution (Python):
n, *d = map(int, open(0).read().split())
print(sum([max(d[i] - d[i+n], 0) for i in range(n)]))

Solution (Python):

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):
    ans += max(0, V[i]-C[i])

print(ans)

Solution (Python):
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)

Solution (Python):

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]:
        ans+=v[i]-c[i]
print(ans)

Solution (Python):
n=int(input())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
print(sum([max(0,xx-yy) for xx,yy in zip(x,y)]))

Solution (Python):
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]:
        x += v[i]
        y += c[i]

print(x - y)

Solution (Python):
n=int(input())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
ans=0
for i,j in zip(x,y):
  ans+=i-j if i-j >0 else 0
print(ans)

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()
input_nums = lambda: list(map(int, input().split()))
import numpy as np
def main():
    N = int(input())
    V = np.array(input_nums())
    C = np.array(input_nums())
    D = V - C
    D = D[D>0]
    print(np.sum(D))



if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
a=0
for i in range(n):
    a+=max(v[i]-c[i],0)
print(a)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
XY = [v - c for v, c in zip(V, C) if v - c >= 0]

ans = sum(XY)
print(ans)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
XY = [v - c for v, c in zip(V, C)]

ans = 0
for xy in XY:
    if xy > 0:
        ans += xy

print(ans)

Solution (Python):
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)

Solution (Python):










"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""
 
def main():
  n=int(input())
  v=list(map(int,input().split()))
  c=list(map(int,input().split()))
  x=[0]*n
  for i in range(n):
    x[i]=max(0,v[i]-c[i])
  print(sum(x))
if __name__ == '__main__':
  main()

Solution (Python):
N = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
 
a = 0
for i in range(N):
  if y[i] < x[i]:
    a = a+(x[i]-y[i])
    
print(a)

Solution (Python):
import sys


sys.setrecursionlimit(2**30)


def solve(i, x, y):
    global max_sub
    if i == N:
        max_sub = max(max_sub, x-y)
    else:
        solve(i+1, x+V[i], y+C[i])
        solve(i+1, x, y)


N = int(input())
V = [int(v) for v in input().split()]
C = [int(c) for c in input().split()]
max_sub = 0
solve(0, 0, 0)
print(max_sub)

Solution (Python):
N = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

a = 0
for i in range(N):
  if y[i] < x[i]:
    a = a+(x[i]-y[i])
    
print(a)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
x=[0]*n
for i in range(n):
  x[i]=max(0,v[i]-c[i])
print(sum(x))

Solution (Python):
n = int(input())
v_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    a = v_list[i] - c_list[i]
    if a>0:
        ans += a
print(ans)

Solution (Python):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque
from decimal import *


def lcm(x, y):
    return (x * y) // math.gcd(x, y)


if __name__ == '__main__':
    n =int(input())
    a = [int(i) for i in input().split()]
    b = [int(i) for i in input().split()]
    sum = 0
    for i in range(n):
        c = a[i]-b[i]
        if c > 0:
            sum+=c


    print(sum)

Solution (Python):
n = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
res = 0
for v, c in zip(V, C):
  res += (v - c) * (v - c > 0)
print(res)

Solution (Python):
import numpy as np
n = int(input())
v = np.array([int(x) for x in input().split()])
c = np.array([int(x) for x in input().split()])
ans = v - c
s = 0
for i in range(n):
	if ans[i] > 0:
		s += ans[i]
print(s)

Solution (Python):
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]:
    ans=ans+V[i]-C[i]
print(ans)

Solution (Python):
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]):
        ans += V[i]-C[i]
print(ans)

Solution (Python):
N = int(input())

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

v_c = []

for i in range(N):
	v_c.append(V[i]-C[i])

ans = 0
for i in range(N):
	if v_c[i] > 0:
		ans += v_c[i]

print(ans)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
c = list(map(int, input().split()))
dp = [0 for i in range(n+1)] 
for i in range(n):
    dp[i+1] = max(dp[i], dp[i]+a[i]-c[i])
print(dp[n])

Solution (Python):
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]:
        ans = ans + v[i] - c[i]

print(ans)

Solution (Python):
import sys
input = lambda: sys.stdin.readline().rstrip()

N = int(input())

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

V_minus_C = []

for i in range(N):
    V_minus_C.append(V[i]-C[i])

V_minus_C.sort(reverse=True)

ans = 0
for i in range(len(V_minus_C)):
    if V_minus_C[i] > 0:
        ans += V_minus_C[i]

print(ans)

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    v=LIST()
    c=LIST()
    ct=0
    for i in range(n):
        if v[i]-c[i]>=0:
            ct+=v[i]-c[i]
    print(ct)
if __name__ == '__main__':
    do()

Solution (Python):
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]:
    ans = ans + (V[i]-C[i])

print(ans)

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

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

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

Solution (Python):
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 = ans + diff

print(ans)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))
n = ii()
v = iil()
c = iil()
cal = zip(v,c)
ans = 0
for i in cal:
    ans += max(0,i[0]-i[1])
print(ans)

Solution (Python):

import math
import itertools
import statistics



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

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

total = 0
for i in range(n):
    if dif[i] > 0:
        total += dif[i]

print(total)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
sa = 0

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

print(sa)

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

tmp = []
for i in range(N):
    tmp.append(V[i] - C[i])

res = 0
for i in range(N):
    if(tmp[i] > 0):
        res += tmp[i]
print(res)

Solution (Python):
N=int(input())
V=list(int(i) for i in input().split())
C=list(int(i) for i in input().split())

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

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
A = [V[i] - C[i] for i in range(N) if V[i] > C[i]]
print(sum(A))

Solution (Python):
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)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
res = [i-j for i,j in zip(v,c)]
cnt = 0
for i in res:
  if i > 0:
    cnt += i
print(0 if cnt <= 0 else cnt)

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

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

Solution (Python):
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]:
    ans += V[i] - C[i]

print(ans)

Solution (Python):
def main():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

    ans = 0
    for v, c in zip(V, C):
        ans += max(0, v-c)
    print(ans)
    return 0


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
V_C = [V[i]-C[i] for i in range(N)]
ans = 0
for i in range(N):
    if V_C[i]>0:
        ans += V_C[i]
print(ans)

Solution (Python):
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)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
sa=0

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

Solution (Python):
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)

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

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

vc = sorted(vc, reverse=True)
ans = 0
for i in range(n):
    if vc[i]>0:
        ans += vc[i]

print(ans)

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

ans = 0
for v,c in zip(V,C):
    if v >= c:
        ans += v-c
print(ans)

Solution (Python):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
print(sum(i - j for i, j in zip(V, C) if i > j))

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
maxvalue = 0
VmC = [V[a]-C[a] for a in range(N)]

for i in range(N):
    if VmC[i] < 0 :
        VmC[i] = 0
    
    maxvalue += VmC[i]
    
print(maxvalue)

Solution (Python):








import numpy as np



n = int(input())

arrV = np.array(input().split(),dtype=np.int64)
arrC = np.array(input().split(),dtype=np.int64)

arrA = arrV - arrC

filter = arrA > 0
ans = sum(arrA[filter])

print(ans)

Solution (Python):
n = int(input())
vv = list(map(int, input().split()))
cc = list(map(int, input().split()))

z = 0
for i in range(n):
    if vv[i] > cc[i]:
        z += vv[i] - cc[i]
print(z)

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

cost = []

for i in range(N):
    if V[i]-C[i]>=0:
        cost.append(V[i]-C[i])

print(sum(cost))

Solution (Python):
n = int(input())
v_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))
print(sum([max(v - c, 0) for v, c in zip(v_list, c_list)]))

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
ans = 0

for vv,cc in zip(v,c):
  if vv >= cc:
    ans += vv - cc
print(ans)

Solution (Python):
N=int(input())
ans=0
V=list(map(int,input().split()))
C=list(map(int,input().split()))
for i in range(N):
    if V[i]>C[i]:
        ans+=V[i]-C[i]
print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
V = LIST()
C = LIST()

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

print(ma)

Solution (Python):
n = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
print(sum([v-c for v, c in zip(V, C) if v-c>0]))

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
benefit=0
for v, c in zip(V, C):
    if v>c:
        benefit += (v-c)
print(benefit)

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

Solution (Python):


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10000000)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate
    
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for v,c in zip(V,C):
    if v-c>0:
        ans=ans+v-c
print(ans)

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

ans = 0
for vv, cc in zip(v,c):
    if vv - cc > 0:
        ans += vv-cc
print(ans)

Solution (Python):
n = int(input())
v = map(int, input().split())
c = map(int, input().split())
ans = 0
for i, j in zip(v, c):
  if i - j > 0:
    ans += i - j
print(ans)

Solution (Python):
def main():
    n = int(input())
    v = [int(i) for i in input().split()]
    c = [int(j) for j in input().split()]
    
    x = 0
    y = 0
    for idx in range(n):
        if v[idx] > c[idx]:
            x += v[idx]
            y += c[idx]
    
    print(x-y)

main()

Solution (Python):
n=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
for i in range(n):
    a=V[i]-C[i]
    if a>0:
        ans+=a
print(ans)

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
benefit =0
for i in range(n):
  if v[i]-c[i]>0:
    benefit += v[i]-c[i]
print(benefit)

Solution (Python):
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]:
        ans += v[i] - c[i]
print(ans)

Solution (Python):
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]:
        ans += v[i] - c[i]
print(ans)

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

ans = 0
for i in range(N):
  ans += max(V[i]-C[i], 0)

print(ans)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
li = []

for i in range(n):
    num = v[i]-c[i]
    if num>0:
        li.append(num)

print(sum(li))

Solution (Python):
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]:
        ans+=v[i]-c[i]
print(ans)

Solution (Python):
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]):
    ans += V[i] - C[i]
print(ans)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
l =[]
for i in range(N):
    if V[i] - C[i] > 0:
        l.append(V[i] - C[i])
print(sum(l))

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
a = 0
b = 0
for i in range(N):
    if V[i] > C[i]:
        a = a+V[i]
        b = b+C[i]
print(a-b)

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

def dfs(i, sum):
    if i == n:
        return sum
    else:
        return max(dfs(i + 1, sum), dfs(i + 1, sum + v[i] - c[i]))

ans = dfs(0, 0)

print(ans)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
XY = [0] * N
ans = 0
for i in range(N):
    XY[i] = V[i]-C[i]
    if XY[i] >= 0:
        ans += XY[i]
print(ans)

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

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

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

X = [0]*N
for i in range(N):
    X[i] = V[i] - C[i]

ans = 0
for i in range(N):
    if X[i] > 0:
        ans += X[i]

print(ans)

Solution (Python):
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]:
        x += v[i]
        y += c[i]

print(x-y)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
S = 0
for i in range(N):
    D = V[i] - C[i]
    if D >0:
        S = S + D
    
print(S)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
S = 0
for i in range(N):
  D = V[i] - C[i]
  if D >0:
    S = S + D
    
print(S)

Solution (Python):
N = int(input())
V = [int(i) for i in input().split(" ")]
C = [int(i) for i in input().split(" ")]

val = 0

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

Solution (Python):
import numpy as np
N = int(input())
V = np.array([int(i) for i in input().split(" ")])
C = np.array([int(i) for i in input().split(" ")])

vc = V-C

val = 0

for i in range(N):
    if vc[i]>0:
        val+=vc[i]
print(val)

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

Solution (Python):
N = int(input())
value = [int(i) for i in input().split()]
cost = [int(i) for i in input().split()]
net_value = [value[i] - cost[i] for i in range(N)]
gain = 0
for item in net_value:
  if item >= 0:
    gain += item
print(gain)

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

Solution (Python):
i=int(input())
x=list(map(int, input().split()))
y=list(map(int, input().split()))
ans=0
for j in range(i):
	if x[j]>=y[j]:
		ans=ans+x[j]-y[j]
print(ans)

Solution (Python):
n = int(input())
vl = list(map(int, input().split()))
cl = list(map(int, input().split()))
ans = [v - c for v, c in zip(vl, cl) if v > c]
print(sum(ans))

Solution (Python):
n = int(input())
list_v = list(map(int, input().split()))
list_c = list(map(int, input().split()))
list_k = []

for i in range(n):
    l = list_v[i]-list_c[i]
    if l > 0:
        list_k.append(l)

print(sum(list_k))

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

sum = 0

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

print(sum)

Solution (Python):
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] > 0:
    x += v[i]
    y += c[i]
print(x-y)

Solution (Python):
N = int(input())
V = [int(i) for i in input().split()]

for i,x in enumerate(input().split()):
    V[i] -= int(x)

V.sort()

ans = 0
for v in V:
    if v > 0:
        ans += v

print(ans)

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

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

Solution (Python):

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]:
        ans += v[i] - c[i]

print(ans)

Solution (Python):
n = int(input())
l1 = list(map(int,input().split()))
l2 = list(map(int,input().split()))
l3 = [0]*n
for i in range(n):
  if l1[i] - l2[i] > 0:
    l3[i] = l1[i] - l2[i]
print(sum(l3))

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

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

print(ans)

Solution (Python):
import numpy as np

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

vc = v-c
ans = sum(vc[vc > 0])
print(ans)

Solution (Python):
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]:
        ans += V[i] - C[i]
print(ans)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
print(sum(max(0,i-j)for i,j in zip(v,c)))

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

res = 0
for i, j in zip(v, c):
    res += max(i - j, 0)
print(res)

Solution (Python):
import numpy as np

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)

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

answer=0

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

print(answer)

Solution (Python):
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]:
        ans += v[i] - c[i]
print(ans)