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())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
s = 0
for v, c in zip(values, costs):
    if v - c > 0:
        s += v - c
print(s)

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

Solution (Python):
n = int(input())
varr = list(map(int,input().split()))
carr = list(map(int,input().split()))

ans = 0

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

print(ans)

Solution (Python):

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

temp = lambda x,y: x - y if x > y else 0
print(sum(list(map(temp,v,c))))

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

x = 0

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

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

Solution (Python):
n = int(input())
ans = 0
lst_v = list(map(int,input().split()))
lst_c = list(map(int,input().split()))
for i in range(n):
  if lst_v[i] > lst_c[i]:
    ans += (lst_v[i] - lst_c[i])
  else:
    continue

print(ans)

Solution (Python):

n = int(input())


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


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

k = [0] * n

for i in range(0,n):
    k[i] = v[i] - c[i]


k.sort(reverse=True)


for i in range(0,n):
    if k[i] < 0:
        k[i] = 0

print(sum(k))

Solution (Python):
times = int(input())
n = []
for i in range(2):
	n.append(list(map(int, input().split()))) 
    
answer = 0
for j in range(times):
  if (n[0][j] - n[1][j]) > 0:
    answer += (n[0][j] - n[1][j])

print(answer)

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

max_score=0

for valu,cost in zip(V,C):
  if(valu>cost):
    max_score+=(valu-cost)
print(max_score)

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

Vls = input().split(" ")

V = []

for i in range(0,len(Vls)):
    V.append(int(Vls[i]))

Cls = input().split(" ")

C = []

for i in range(0,len(Cls)):
    C.append(int(Cls[i]))


Max = 0

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

print(Max)

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

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());s=0
v=list(map(int,input().split()))
c=list(map(int,input().split()))
for i in range(n):
    if v[i]>c[i]:
        s+= v[i]-c[i]
print(s)

Solution (Python):
N = int(input())
v_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))

diff = map(lambda x, y: x - y, v_list, c_list)
print(sum(filter(lambda x: x > 0, diff)))

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

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

print(sum)

Solution (Python):
N = int(input())
V = [int(s) for s in input().split() if s.isdigit()]
C = [int(s) for s in input().split() if s.isdigit()]
VC = [int(i - j) for i, j in zip(V, C)]

dp = [0 for _ in range(N+1)]
for i in range(N):
    dp[i+1] = max(dp[i], dp[i] + VC[i])
print(dp[N])

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

Solution (Python):
def calculate_max(Ans, value):
    temp = Ans
    if (Ans + value) > Ans:
        temp += value
    if temp < 0 :
        temp = 0
    return temp

N = int(input())
Value = list(map(int, input().split()))
Cost = list(map(int, input().split()))

Profit = [Value[i] - Cost[i] for i in range(N)]
Answer = 0

for i in range(N):
    Answer = calculate_max(Answer, Profit[i])

print(Answer)

Solution (Python):
import numpy as np
N = int(input())
V_list = np.array(list(map(int, input().split())))
C_list = np.array(list(map(int, input().split())))

diff = V_list - C_list

print(diff[diff > 0].sum())

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




from numpy import *
Z = list(array(W)-array(C))

x = 0
idx = 0
while idx < len(Z):
    if Z[idx] >= 0:
        x += Z[idx]
        idx += 1
    else:
        idx += 1
print(x)

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

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

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

Solution (Python):
n = int(input())
va = input().split()
co = input().split()

val = [int(v) for v in va]
cos = [int(c) for c in co]

dif = [val[i]-cos[i] for i in range(n)]
ma = 0
for d in dif:
    ma += d if d >= 0 else 0
print(ma)

Solution (Python):
n = int(input())
vs = [int(v) for v in input().split()]
cs = [int(c) for c in input().split()]
sum = 0
for i in range(n):
  if vs[i] - cs[i] > 0:
    sum += vs[i] - cs[i]

print(sum)

Solution (Python):


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

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

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

sa = [0]*n

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

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

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):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
h=[v[i]-c[i] for i in range(n)]
s=0
for j in range(n):
      if h[j]>0:
            s=s+h[j]
print(s)

Solution (Python):

import numpy as np

N=int(input())
V=np.array([int(c) for c in input().split()])
C=np.array([int(c) for c in input().split()])
D=V-C
print(np.sum(D[D>0]))

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

cost = 0

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

Solution (Python):
N = int(input())
Vs = map(int, input().split())
Cs = map(int, input().split())

print(sum([ v - c for v, c in zip(Vs, Cs) if v >= c ]))

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

Solution (Python):
n = int(input())
list_v = list(map(int,input().split()))
list_c = list(map(int,input().split()))
 
ans = 0
for i in range(n):
  if list_v[i] - list_c[i] > 0:
    ans += list_v[i] - list_c[i]
print(int(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)]

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

Solution (Python):
N = int(input())
v_list = [int(x) for x in input().split()]
c_list = [int(x) for x in input().split()]
p_list = [x-y for x, y in zip(v_list, c_list)]

ans = 0
for i in p_list:
    if i > 0:
        ans += 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):
    sum += max(0, V[i]-C[i])
print(sum)

Solution (Python):
N = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = []
sum = 0

for i in range(len(a)):
  if a[i]-b[i] > 0:
    c.append(a[i]-b[i])
  else:
    continue
    

for i in range(len(c)):
  sum = sum + c[i]
  
print(sum)

Solution (Python):
N = int(input())
V = input().split()
C = input().split()
Z = 0

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

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

Solution (Python):
a=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))
cost=0
for i in range(a):
    if p[i] - q[i] > 0:
        cost += (p[i]-q[i])   
print(cost)

Solution (Python):
def solve(n, v, c):
    res = 0
    for i in range(n):
        res += max(0, v[i] - c[i])
    return res

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

Solution (Python):
N = input()
V_list = list(map(int,input().split()))
C_list = list(map(int,input().split()))
result = 0
counter = 0
for i in V_list:
  if i > C_list[counter]:
    result = i-C_list[counter]+result
  counter += 1
  
print(result)

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

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

print(cost)

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

Vs = [V.split()[i] for i in range(0, N)]
Cs = [C.split()[i] for i in range(0, N)]

sum = 0
for v_i, c_i in zip(Vs, Cs):
  sub = int(v_i) - int(c_i)
  if sub > 0:
    sum += sub

print(sum)

Solution (Python):
def solve():
    N = int(raw_input())
    V = [int(_) for _ in raw_input().split()]
    C = [int(_) for _ in raw_input().split()]
    get = [V[i] - C[i] for i in range(N)]
    sum = 0
    for i in range(N):
        if get[i] > 0:
            sum += get[i]
    print str(sum)

if __name__ == '__main__':
    solve()

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
print(sum(vi-ci for vi, ci in zip(V, C) if vi > ci))

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

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

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

max=0
for i in range(N):
    if Vs[i]-Cs[i]>0:
        max += Vs[i]-Cs[i]
print(max)

Solution (Python):
N = int(input())
Values = list(map(int, input().split()))
Costs = list(map(int, input().split()))
value = 0

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

print(value)

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()))  
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(N) for N in input().split()] 
C = [int(N) for N 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 = [int(v) for v in input().split(' ')]
C = [int(c) for c in input().split(' ')]

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

print(diff)

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

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

Solution (Python):
num = int(input())
ls_value = [ int(x) for x in input().split(' ') ]
ls_cost = [ int(y) for y in input().split(' ') ]
profit = 0
for x, y in zip(ls_value, ls_cost):
    if (x - y) > 0:
        profit += (x - y)

print(profit)

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

Solution (Python):
size=input()
size=int(size)
A=input().split()
B=input().split()
count=0
for i in range(0,size):
    if (int(A[i])-int(B[i])>0):
        count+=int(A[i])-int(B[i])

print(count)

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

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)

Solution (Python):
l = int(input())
vals = list(map(int, input().split(" ")))
costs = list(map(int, input().split(" ")))

diffs = []

for i in range(0, l):
    diffs.append(vals[i] - costs[i])

tmp = list(filter(lambda x: x > 0,   diffs))
print(sum(tmp))

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

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

print(s)

Solution (Python):

  

if __name__=='__main__':
  val_n = input()
  list_v = list(map(int,input().split()))
  list_c = list(map(int,input().split()))

  answer = 0
  for i in range(len(list_v)):
    if(list_v[i] - list_c[i] > 0):
      answer += list_v[i] - list_c[i]
  print(answer)

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

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

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

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

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

print(sum)

Solution (Python):

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

res = 0

for i in range(n):
    diff = values[i] - costs[i]
    if diff > 0:
        res += diff

print(res)

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

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

V = list(V)
C = list(C)

d = 0
p = 0

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

print(d)

Solution (Python):
n = int(input())
def input_def(n_num=2):
    input_val = []
    for i in range(n_num):
        input_val.append([i for i in map(int,input().split())])
    return input_val


para_val = input_def()
diff_val = 0
for i in range(n):
    a = para_val[0][i]-para_val[1][i]
    if a>= 0 :
        diff_val += a


print(diff_val)

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())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
total=0
for i in range(N):
    T=X[i]-Y[i]
    if T > 0:
        total+=T
print(total)

Solution (Python):
N = int(input())
vlist = list(map(int, input().split()))
clist = list(map(int, input().split()))

difflist = [v - c for v, c in zip(vlist, clist)]

otpt = 0
for diff in difflist:
  if diff > 0:
    otpt += diff
    
print(otpt)

Solution (Python):
a = int(input())
ar = list(map(int,input().split(" ")))
br = list(map(int,input().split(" ")))
cr = []
for i in range(a):
    if ar[i] - br[i] > 0:
        cr.append(ar[i]-br[i])
print(sum(cr))

Solution (Python):
a=input()
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
d=e=0
for i in range(len(b)):
    if b[i]>c[i]:
        d+=b[i]
        e+=c[i]
print(d-e)

Solution (Python):


N = int(input())
vs = [int(e) for e in input().strip().split()]
cs = [int(e) for e in input().strip().split()]

profit = 0
for i in range(N):
    if vs[i] > cs[i]:
        profit += (vs[i] - cs[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):
n = input()
v = list(map(int, input().split()))
c = list(map(int, input().split()))

diff = [v[i]-c[i] if (v[i]-c[i])>=0 else 0 for i in range(len(v))]
print(sum(diff))

Solution (Python):
import sys

str_input = input()
n = int(str_input)

str_input = input()
v = []
for value in str_input.split():
    v.append(int(value))

str_input = input()
c = []
for value in str_input.split():
    c.append(int(value))

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

    for i in range(N):
        plus = v[i] - c[i]
        if plus > 0:
            result.append(plus)

    print(sum(result))

if __name__ == "__main__":
    main()

Solution (Python):


def main():
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    result = []

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

    
    
    
    print(sum(list(filter(lambda x:x>0, sorted(result)))))

if __name__ == "__main__":
    main()

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

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

num_v = int(len(v))

p = [v[i]-c[i] for i in range(num_v)]

pp = [j for j in p if j>0]

print(sum(pp))

Solution (Python):

N = int(input())
Vs = map(int, input().split())
Cs = map(int, input().split())

profit = 0
for V, C in zip(Vs, Cs):
    profit += max(V - C, 0)

print(profit)

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

summ = 0
for i in range(n):
    if listv[i]-listc[i]>0:
        summ += listv[i]-listc[i]
        
print(summ)

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

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

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

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

S = 0
for i in range(N):
  if D[i] > 0:
    S += D[i]

print(S)

Solution (Python):
N = int(input())
Vs = [int(x) for x in input().split()]
Cs = [int(x) for x in input().split()]

ans = 0
for V, C in zip(Vs, Cs):
    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())
Value=[int(i) for i in input().split()]
Cost=[int(j) for j in input().split()]
money=0
Money=[]
for k in range(N):
    M=Value[k]-Cost[k]
    if M>=0:
        money=money+M


print(money)

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):
nn = int(input())
vv = list(map(int, input().split()))
cc = list(map(int, input().split()))

yy = 0
for ii in range(nn):
    if vv[ii]-cc[ii]>0:
        yy += vv[ii]-cc[ii]
print(yy)

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 larger(x, y):
	if x > y: return x
	else: return y

N = int(raw_input())
V = map(int, raw_input().split())
C = map(int, raw_input().split())

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

print max

Solution (Python):


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

x = 0

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

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

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

print(score)

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

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

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 = sum([max(vv-cc, 0) for vv, cc in zip(v, c)])
print(ans)

Solution (Python):
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]>0):
        ans+=v_list[i]-c_list[i]
    else:
        continue
print(ans)

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

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())
ListV=[int(_) for _ in input().split()]
ListC=[int(_) for _ in input().split()]
NewList=[x - y for (x, y) in zip(ListV, ListC)]
AnswerList=[]
for i in range(N):
  if NewList[i] >= 0:
    AnswerList.append(NewList[i])
print(sum(AnswerList))

Solution (Python):
N = int(input())
value_list = list(map(int, input().split(" ")))
cost_list = list(map(int, input().split(" ")))

ans = 0

kosupa_list = []
for i in range(N):
    kosupa_list.append(value_list[i] - cost_list[i])
new_list = sorted(kosupa_list, reverse = True)

for j in range(N):
    if new_list[j] <= 0:
        break
    else:
        ans += new_list[j]
print(ans)

Solution (Python):
def main():
    N = input()

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

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

    print(V_sum-C_sum)


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(2**N):
    X = 0
    Y = 0
    for j in range(N):
        if ((i >> j) & 1):
            X += V[j]
            Y += C[j]
    ans = max(ans, X-Y)

print(ans)

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

for i in range(len(V)):
    if V[i] > C[i]:
        count += V[i] - C[i]
print(count)

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 = map(int, input().split())
c = map(int, input().split())
max_val = 0
for _v, _c in zip(v, c):
  if _v - _c > 0:
    max_val += _v - _c
print(max_val)

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

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

print(sum(_v - _c for _v, _c in zip(v,c) if _v > _c))

Solution (Python):
N = int(input())
V = [int(v) for v in input().split()]
C = [int(c) for c in input().split()]
VC = zip(V,C)
Y=0
for v,c in VC:
  if v-c > 0:
    Y += v-c
print(Y)

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

values = [int(x) for x in input().split()]
costs = [int(x) for x in input().split()]

gain = sum([v-c for v, c in zip(values, costs) if v-c > 0])

print(gain)

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

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

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

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

diff = []

for i, x in enumerate(v):
  if x - c[i] > 0:
    diff.append(x- c[i])

    
ans = 0

for x in diff:
  ans += x
  
print(ans)

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

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

Solution (Python):
n = int(input())
v_i = list(map(int, input().split()))	
c_i = list(map(int, input().split()))

sum = 0
for i in range(n):
	if v_i[i] > c_i[i]:
		sum += v_i[i] - c_i[i]
	
print(sum)

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

ans = 0
for v, c in zip(vn, cn):
    if v - c > 0:
        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()]
count = 0
for x in range(n):
 if v[x] > c[x]:
  count = count + v[x] - c[x]
print(count)

Solution (Python):
N=int(input())
V=[]
C=[]
tmp=0
sumx=0
val=[0]
V = list(map(int, input().split()))
C = list(map(int, input().split())) 

for i in range(N):
    tmp=V[i]-C[i]
    if(tmp>0):
        sumx=sumx+tmp
        
val.append(sumx)
print(max(val))

Solution (Python):
N=int(input())
a=list(input().split())
b=list(input().split())
sum=0
for i in range(N):
    value=int(a[i])
    cost=int(b[i])
    price=value-cost
    if price>0:
        sum+=price
print(sum)

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

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

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

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

Solution (Python):
from array import array

n = int(input())
v = array('i', [int(i) for i in input().split()])
c = array('i', [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 = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]

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

print(ans)