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-----
3
10 2 5
6 3 4

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

Solutions:
n = int(input())
vlst = list(map(int, input().split()))
clst = list(map(int, input().split()))
ans = 0
for v, c in zip(vlst, clst):
    ans += max(0, v - c)
print(ans)

n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
a = []
for i in range(n):
    b = v[i] - c[i]
    a.append(b)
d = 0
for j in range(n):
    if a[j] > 0:
        d += a[j]
print(d)

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

l = []

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


ans = 0
for i in l:
    if i>0:
        ans+=i
print(ans)


def main():
    g = 0
    n = int(input())
    v = list(map(int,input().split()))
    c = list(map(int,input().split()))
    for i in range(n):
        gain = v[i] -c[i]
        if gain > 0 :
            g += gain
    print(g)


def __starting_point():
    main()
__starting_point()

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)


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

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

LI = lambda: list(map(int, input().split()))

N = int(input())
V = LI()
C = LI()


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


def __starting_point():
    main()

__starting_point()

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)

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


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

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

from typing import List


def answer(n: int, c: List[int], v: List[int]) -> int:
    return sum(list(j for j in (c[i] - v[i] for i in range(n)) if 0 < j))


def main():
    n = int(input())
    c = list(map(int, input().split()))
    v = list(map(int, input().split()))
    print(answer(n, c, v))


def __starting_point():
    main()
__starting_point()

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

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

import itertools
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
diff_VC = list(i-j for i,j in zip(V,C))
c=[]
for i in range(N):
  c += [sum(comb) for comb in itertools.combinations(diff_VC,i+1)]
print(max(max(c),0))

import copy
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)


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)

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




import sys
lines = [s.rstrip("\n") for s in sys.stdin.readlines()]
n = int(lines.pop(0))
v_list = [int(num) for num in lines.pop(0).split(" ")]
c_list = [int(num) for num in lines.pop(0).split(" ")]
ans = 0
for v, c in zip(v_list, c_list):
    if v > c:
        ans += (v - c)
print(ans)


import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N = I()
    V = LI()
    C = LI()
    
    ans = sum([V[i] - C[i] for i in range(N) if V[i] - C[i] > 0])
    print(ans)

def __starting_point():
    resolve()

__starting_point()

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

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

print(ans)

n = int(input())

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

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

n=int(input())
ans=0
v=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]
for i in range(n):
    if v[i]>c[i]:
        ans+=v[i]-c[i]

print(ans)

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] > 0:
    ans += a[i] - b[i]
print(ans)

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

def solve():
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    res = 0
    for i in range(n):
        x = v[i] - c[i]
        if x > 0:
            res += x
    print(res)

solve()

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

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)

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)

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)

N = int(input())
V = list(map(lambda v: int(v), input().split(" ")))
C = list(map(lambda c: int(c), input().split(" ")))
s = 0
for i in range(N):
  d = V[i] - C[i]
  s += max([d,0])

print(s)

N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
li=[]

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

for j in range(N):
    if li[j]>0:
        ans+=li[j]
print(ans)


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


n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
x = 0
y = 0
# 価値とコストが0以上である宝石を選ぶ。
for i in range(n):
    if v[i] - c[i] > 0:
        x += v[i]
        y += c[i]
# 選択した宝石の価値とコストの総和差の計算。
print((x-y))


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)

input()
print(sum((v-c for v,c in zip(map(int,input().split()),map(int,input().split())) if v-c>0)))

n = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
l = [0]*n

for i in range(n):
    l[i] = v[i]-c[i]
    if(l[i] < 0):
        l[i]=0
    
print(sum(l))

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]
    else:
        pass
print(ans)

n = int(input())
v = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
res = 0
for i in range(n):
    if v[i] > c[i]:
        res += v[i] - c[i]
print(res)


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

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
D = [0] * N
for i in range(N):
	t = V[i] - C[i] 
	if t > 0:
		D[i] = t 
print((sum(D)))


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

m = 0

for i in range(len(v)):
  if v[i] > c[i]:
    m += v[i] - c[i]

print(m)

N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
diff=[V[i]-C[i] for i in range(N)]
diff.sort(reverse=True)
x=0
for i in range(N):
    if diff[i]<0:
        break
    x+=diff[i]
print(x)


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

ans = 0

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


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)


#a, b, k = map(int, input().split( ))
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)

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

print(ans)


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

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

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

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

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

print(ans)

n = int(input())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))

sum = 0
for i in range(n):
    if values[i] - costs[i] < 0:
        continue
    else:
        sum += values[i] - costs[i]

print(sum)

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

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

print(vc)

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

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)



import numpy as np

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

P=V-C

ans = 0
for i in P:
	if i>=0:
		ans += i

print(ans)

n=int(input())
v_list=[int(i) for i in input().split()]
c_list=[int(i) for i in input().split()]
total_list=[]

for i in range(n):
    total_list.append(v_list[i]-c_list[i])
    
total_list.sort(reverse=True)
#print(total_list)

sum=0
for i in total_list:
    if i>0:
        sum+=i
    else:
        break
    
print(sum)

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)

import numpy


N = int(input().strip())

V_array = []
C_array = []

V_array =[int(x) for x in input().split()]
C_array =[int(x) for x in input().split()]

ans = 0
for j in range(N):
    ans += V_array[j] - C_array[j] if V_array[j] > C_array[j] else 0


print(ans)

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
li = []
su = 0
for i in range(n):
    li.append(v[i]-c[i])

for i in li:
    if i > 0:
        su += i

print(su)

N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
D=[]
a=0
for i in range(len(C)):
    D.append(V[i]-C[i])
for i in range(len(D)):
    if D[i]>=1:
        a+=D[i]
print(a)

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

print(ans)

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

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

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())
    V = list(map(int, readline().split()))
    C = list(map(int, readline().split()))

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

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

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)

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

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

n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
vc = [0]*n
for i in range(n):
    vc[i] = v[i] - c[i]
vc2 = sorted(vc)
import bisect
print(sum(vc2[bisect.bisect_left(vc2,0):]))

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)

def main():
    n = int(input())
    V = [int(x) for x in input().split()]
    C = [int(x) for x in input().split()]
    ans = 0
    
    for v, c in zip(V, C):
        if v - c > 0:
            ans += v - c
        else:
            ans += 0
    print(ans)

def __starting_point():
    main()

__starting_point()

# coding: utf-8

num = int(input())
str1 = input().split()
str2 = input().split()
str3 = []
for i in range(num):
    str3.append(int(str1[i]) - int(str2[i]))

total = 0
count = 0
for i in range(num):
    if str3[i] > 0:
        total += str3[i]
        count += 1
if count == 0:
    print((0))
else:
    print(total)


import numpy as np

n = int(input())
v = np.array(list(map(int,input().split())))
c = np.array(list(map(int,input().split())))
a = v-c
print((a[a>=0].sum()))


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)


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)


# coding: UTF-8
import sys
import numpy as np


n = int(input())
vList = list(map(int, input().split()))
cList = list(map(int, input().split()))
ans = 0
for v, c in zip(vList, cList):
	ans += max(v - c, 0)
print(ans)


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

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

n = int(input())
list_v = [int(i) for i in input().split()]
list_c = [int(j) for j in input().split()]
ans = 0
for i in range(0, n):
    if list_v[i] - list_c[i] > 0:
        ans += (list_v[i] - list_c[i])
print(ans)

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):

    tmp = V[i] - C[i]
    if tmp > 0:
        ans += tmp

print(ans)


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)

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

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)

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

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

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)

n = int(input())
a, b = [list(map(int, input().split())) for i in range(2)]
s = 0
for v, c in zip(a, b):
  if v - c > 0:
    s += v - c
print(s)

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)

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)

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)

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)

n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
r=0
xy=[0]*n
for ii in range(n):
  xy[ii]=v[ii]-c[ii]
  if xy[ii]<0:
    xy[ii]=0
print(sum(xy))  

N = int(input())

values = list(map(int,input().split()))
costs  = list(map(int,input().split()))

ans = 0

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

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

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

print(ans)

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

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


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)

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 += (v > c)*(v - c)

print(ans)

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)

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


def __starting_point():
    main()
__starting_point()

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)

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

vc = []
for i, j in zip(v, c):
    vc.append(i-j)
vc = sorted(vc, reverse=True)
ans = 0
for i in vc:
    if i <= 0:
        break
    ans += i
print(ans)