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):
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()))
cnt = 0

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

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

P=V-C

ans = 0
for i in P:
	if i>=0:
		ans += 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 = [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_)

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

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()))
 
diff = [V[i] - C[i] for i in range(N)]
diff.sort(reverse=True)
 
i, ans = 0,0
for d in diff:
    if d <= 0:
        break
    ans += d
print(ans)

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

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

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

if __name__ == '__main__':
    main()

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

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

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

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

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

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

Solution (Python):
import math


def main():
    n = int(input())
    
    
    
    

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

    sub = [v[i]-c[i] for i in range(n)]

    ans = 0
    for num in sub:
        if num >0:
            ans +=num

    print(ans)






if __name__ == '__main__':
    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):
    if V[i] > C[i]:
        ANS = ANS + (V[i] - C[i])
        
print(ANS)

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

Solution (Python):
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mat = lambda x, y, v: [[v]*y for _ in range(x)]
ten = lambda x, y, z, v: [mat(y, z, v) for _ in range(x)]
mod = 1000000007
sys.setrecursionlimit(1000000)

N = ri()
V = rl()
C = rl()

def get_score(b):
	X = 0
	Y = 0
	for i, v in enumerate(b):
		if v:
			X += V[i]
			Y += C[i]
	return X-Y
ans = -float('inf')
for b in product([0, 1], repeat=N):
	s = get_score(b)
	ans = max(ans, s)
print(ans)

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

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

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

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

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

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

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

N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
temp = itertools.product([0, 1], repeat=N)
ans = 0
for T in temp:
    an = 0
    for i, e in enumerate(T):
        if e == 1:
            an += V[i] - C[i]
    ans = max(ans,an)
print(ans)

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


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

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

Solution (Python):
N=int(input())
V=list(map(int, input().split()))
C=list(map(int, input().split()))
ans=0
for i in range(2**N):
  X=0
  for j in range(N):
    if (i>>j)&1:
      X+=(V[j]-C[j])
  ans=max(ans,X)
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(2**n):
    value = 0
    cost = 0
    for j in range(n):
        if ((i >> j) & 1):
            value += v[j]
            cost += c[j]
        ans = max(ans, value - cost)

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

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

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

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, c in zip(V, C):
    if v >= c:
        ans += v-c

print(ans)

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

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

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

Solution (Python):
def main():
    n = int(input())
    v_list = list(map(int, input().split()))
    c_list = list(map(int, input().split()))
    ans = 0

    for i in range(n):
        if v_list[i] > c_list[i]:
            ans += v_list[i] - c_list[i]

    print(ans)


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    ans = 0

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

    print(ans)

if __name__ == '__main__':
    main()

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

for i in range(n):
  V[i]-=C[i]

ans=0
for i in range(n):
  if V[i]>0:
    ans+=V[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):
  if V[i] - C[i] >= 0:
    ans += (V[i] - C[i])

print(ans)

Solution (Python):


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)

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


if __name__ == '__main__':
    main()

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


if __name__ == '__main__':
    main()

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

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

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

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

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

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

res = -float("inf")
for i in range(2**N):
  X = 0
  Y = 0
  for j in range(N):
    if (i>>j)&1 == 1:
      X += V[j]
      Y += C[j]
  res = max(res, X-Y)
  
print(res)

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

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

Solution (Python):

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)

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

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

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


if __name__ == "__main__":
    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):
  if v[i]-c[i]>=0:
    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()))

x=0
for i in range(2**n):
    cost=0
    value=0
    for j in range(n):
        if i>>j&1:
            cost+=c[j]
            value+=v[j]
    else:
        if value-cost>x:
            x=value-cost
            


print(x)

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

print(ans)

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


if __name__ == '__main__':
    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):
    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] > 0:
        ans += v[i] - c[i]

print(ans)

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

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

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

profit_max = 0
for i in range(2 ** n):
    value = 0
    cost = 0
    for j in range(n):
        if (i >> j) & 1:
            value += v[j]
            cost += c[j]
    profit_max = max(profit_max, value - cost)
print(profit_max)

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

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

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

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


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()
ans = 0
for i in range(n):
    if v[i] > c[i]:
        ans += v[i] - c[i]
print(ans)

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

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

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

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

if __name__ == '__main__':
    resolve()

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

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

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

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

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

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()))
t=[]
ans=0
for i in range(n):
    t.append(v[i]-c[i])
    if t[i]>0:
        ans+=t[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):


import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

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

print(value)

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

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):
    sa = V[i] - C[i]
    if sa > 0:
        ans += sa

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

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

print(ans)

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

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

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

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

val = 0
ans = 0

for i in range(n):
    val = v[i] - c[i]
    if val > 0:
        ans += val
    else:
        pass
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())))
a = v-c
print(a[a>=0].sum())

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

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

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

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

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

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

Solution (Python):
import sys
import numpy as np

stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


n = ni()
V = np.array(nl())
C = np.array(nl())
T = V - C
ans = 0
for t in T:
    if t > 0:
        ans += t
print(ans)

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

t_v = []
t_c = []
for v, c in zip(l_v, l_c):
  if v > c:
    t_v.append(v)
    t_c.append(c)
    
print(sum(t_v) - sum(t_c))

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

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

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

print(ans)

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

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

print(res)

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

Solution (Python):

N = int(input())
X_List = list(map(int,input().split()))
Y_List = list(map(int,input().split()))
XY_List = [X_List[i]-Y_List[i] for i in range(N)]
print(sum(list(map(lambda x:x if x>= 0 else 0,XY_List))))

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

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

print(sum(x))

Solution (Python):
N = int(input())
MM = input().split()
LL = input().split()
total = 0
for i,j in zip(MM,LL):
  if int(i) > int(j):
    total += int(i) -int(j)
print(total)

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

value = 0
for i in range(len(V)):
    if V[i]-C[i]>0:
        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()))
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()))

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

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

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(0, v[i]-c[i])
print(ans)