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

X_Y = []
for i in range(N):
    X_Y.append(V[i] - C[i])
X_Y_pos = [x for x in X_Y if x > 0]
print(sum(X_Y_pos))

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

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

sys.setrecursionlimit(1000000)

def main(): 

    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)
        



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

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

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

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

vlist = list(map(int, input().split())) 
clist = list(map(int, input().split())) 

money=0

for i in range(n):
    if vlist[i]>=clist[i]:
        money+=vlist[i]-clist[i]

print(money)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
greedy = sorted([V[i] - C[i] for i in range(N)], reverse = True)
res = 0
for i in range(N):
  if greedy[i] <= 0:
    break
  res += greedy[i]
print(res)

Solution (Python):
N=int(input())
A=[list(map(int, input().split())) for i in range(2)]
s=0
for i in range(N):
    if A[0][i]>A[1][i]:
        s+=A[0][i]-A[1][i]
print(s)

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

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

if __name__ == '__main__':
    main()

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

Solution (Python):


def main():
    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])
    return ans

if __name__ == '__main__':
    print(main())

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

Solution (Python):
def main():
    N = int(input())
    V = [int(v) for v in input().split()]
    C = [int(c) for c in input().split()]

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


if __name__ == '__main__':
    print(main())

Solution (Python):
import numpy as np
N=input()
V=list(map(int,input().split()))
C=list(map(int,input().split()))
G=np.array(V)-np.array(C)

A=0
for i in range(len(G)):
    if G[i]>0:
        A+=G[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()))
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()))
M=[]
X=0
for i in range(N):
    M.append(V[i]-C[i])
for i in range(N):
    if M[i]>0:
        X+=M[i]
print(X)

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())))
XY = V - C

ans = 0

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

print(ans)

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

for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)

Solution (Python):
N = int(input())
V = [int(_) for _ in input().rstrip().split()]
C = [int(_) for _ in input().rstrip().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_seq = list(map(int, input().split()))
c_seq = list(map(int, input().split()))

r_seq = [v_seq[i] - c_seq[i] for i in range(n)]
r_seq.sort(reverse = True)

ans = 0
for r in r_seq:
    if r <= 0:
        break
    ans += r

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

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

ans = sum([v[i] - c[i] for i in range(n) if v[i] - c[i] > 0])
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=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]

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

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

Solution (Python):

import sys
import math
from collections import defaultdict


sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]


mod = 10**9 + 7


def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))



N = I()
V = III()
C = III()
ans = 0

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

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


if __name__ == "__main__":
    print(solve())

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

Solution (Python):
n = int(input())
*V, = map(int, input().split())
*C, = map(int, input().split())
a = 0
for v, c in zip(V, C):
    a += max(0, v-c)
print(a)

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

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

print(ans)

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

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

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

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

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

Solution (Python):
N = list(map(int,open(0).read().split()))
v = 0
for i in range(N[0]):
  d = N[1+i]-N[1+i+N[0]]
  if d > 0:
    v +=d
print(v)

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

max_eff = 0
for i in range(2**n):
    val_sum = 0
    cos_sum = 0
    for j in range(n):
        if ( i >> j ) & 1:
            val_sum += v[j]
            cos_sum += c[j]
    if max_eff < val_sum - cos_sum:
        max_eff = val_sum - cos_sum

print(max_eff)

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):
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))

total_v = 0

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

print(total_v)

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

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

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

total=0
for i in range(n):
  total+=max(v[i]-c[i],0)
print(total)

Solution (Python):
n = int(input())
s1 = list(map(int,input().split()))
s2 = list(map(int,input().split()))
MAX = 0
cost = 0
for i in range(n):
    cost = s1[i] - s2[i]
    if cost > 0:
        MAX = MAX + cost
print(MAX)

Solution (Python):
import math
import copy

inputa = input().split()
inputb = input().split()
inputc = input().split()

a = int(inputa[0])














b = [int(n) for n in inputb]
c = [int(n) for n in inputc]

sum = 0
for i in range(len(b)):
    if b[i] > c[i]:
       sum += b[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] > 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()))
a = 0
for i in range(N):
    if V[i] > C[i]:
        a += V[i]-C[i]
    else:
        None
print(a)

Solution (Python):
n=int(input())
v1=input().split()
c1=input().split()
k=0
for i in range(n):
    l=int(v1[i])-int(c1[i])
    if l > 0:
        k+=l

print(k)

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

sa_VC = [0]*N
ans = 0

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

print(ans)

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


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

print(getsum)

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

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

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

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

print(sum(ans))

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

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

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

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

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

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

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

cnt = 0
for i in range(n):
    if t[i] > 0:
        cnt += t[i]

print(cnt)

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

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

print(answer)

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

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

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()))
mouke=0
for i in range(N):
    adv=V[i]-C[i]
    if adv>0:
        mouke+=adv
print(mouke)

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):
    diff=v-c
    if 0<diff:
        ans+=diff
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())))
p = v-c
ans = 0
for i in p:
    if i>0:
        ans+=i

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())))
p = v-c
ans = sum([i for i in p if i>0])
print(ans)

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

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

p.sort(reverse=True)
ans = 0
for i in range(n):
    if p[i] > 0:
        ans += p[i]
    else:
        break
print(ans)

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

vlist=list(map(int,input().rstrip().split()))
clist=list(map(int,input().rstrip().split()))

xsum=0

for i in range(n):
	if vlist[i] > clist[i]:
		xsum += vlist[i]-clist[i]


print(xsum)

Solution (Python):
input()
print(sum(max(int(x)- int(y), 0) for x, y in zip(input().split(), input().split())))

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

sum = 0
for v, c in zip(v_list, c_list):
  diff = v - c
  if diff >= 0:
    sum += diff
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):
	ans = max(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()))

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

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

max_z = 0
for i in range(2**n):
  
  x = 0
  y = 0
  for j in range(n):
    if i&(1<<j)!=0:
      
      x+=v[j]
      y+=c[j]
  z=x-y
  
  max_z = max(max_z,z)
print(max_z)

Solution (Python):

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

Y = 0
for v, c in zip(Vs, Cs):
    if v > c:
        Y += (v-c)

print(Y)

Solution (Python):

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

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

print(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 c[i] >= v[i]:
        continue
    else:
        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 = []
for i in range(N):
    if V[i] - C[i] >0:
        a = V[i] - C[i]
        A.append(a)
print(sum(A))

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

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
X = 0
Y = 0
for v,c in zip(V,C):
    if v / c > 1:
        X += v
        Y += c
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):
    diff = V[i] - C[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()))
cnt = 0
for i in range(n):
    cnt += v[i] - c[i] if v[i] - c[i] >= 0 else 0
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(N):
    t = V[i] - C[i]
    ans += t if t > 0 else 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()))

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

print(S[S>=0].sum())

Solution (Python):

def main():
    n = int(input())
    V, C = tuple(tuple(map(int, input().rstrip().split())) for _ in range(2))
    ans = sum(i - j for i, j in zip(V, C) if i - j > 0)
    print(ans)


if __name__ == "__main__":
    main()

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

print(sum([max(x[0] - x[1], 0) for x in zip(v, c)]))

Solution (Python):
from operator import sub

def main():
    ans = 0

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

    sub_list = list(map(sub, v, c))

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

    print(ans)


if __name__ == '__main__' :
    main()

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

D.sort(reverse=True)

_sum=0

for d in D:
    if d <= 0:
        break
    _sum += d

print(_sum)

Solution (Python):
_ = input(), print(sum(filter(lambda x: x >= 0, sorted(map(lambda x: x[0] - x[1], zip(map(int, input().split()), map(int, input().split()))), reverse=True))))

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
print(sum(filter(lambda x: x >= 0, sorted(map(lambda x: x[0] - x[1], zip(V, C)), reverse=True))))

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

result = 0

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

print(result)

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

Solution (Python):
import numpy as np

N = int(input())
V_arr = np.array(list(map(int,input().split())))
C_arr = np.array(list(map(int,input().split())))
dev_arr = V_arr-C_arr

print(sum(dev_arr[dev_arr>0]))

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

sub_ls = [i - j if i - j > 0 else 0 for i, j in zip(v_ls, c_ls)]
print(sum(sub_ls))

Solution (Python):


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

diff = []

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

print(sum(diff))

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

Solution (Python):


n = int(input())
values = [int(x) for x in input().split()]
costs = [int(x) for x in input().split()]
selected_jewelry = [v-costs[i] for i,v in enumerate(values) if v > costs[i]]
print(sum(selected_jewelry))

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

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

res=0

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

print(res)

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

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

print(s)

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

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

print(ans)

Solution (Python):
import itertools

def check():
    max_profit = 0
    N = int(input())
    value = list(map(int, input().split(" ")))
    cost = list(map(int, input().split(" ")))
    num = [i for i in range(N)]
    
    for i in range(1,N+1):
        for numList in itertools.combinations(num,i):
            total = 0
            for k in numList:
                total += value[k] - cost[k]
            if max_profit < total:
                max_profit = total
    print(max_profit)

check()

Solution (Python):
sum = 0

N = int(input())

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

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

print(sum)

Solution (Python):
n = int(input().split()[0])
v_list = list(map(int, input().split()))
c_list = list(map(int, input().split()))

score_list = []

for v, c in zip(v_list, c_list):
    if v - c > 0:
        score_list.append(v-c)

ans = sum(score_list)
print(ans)

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

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

print(an)

Solution (Python):
from collections import deque
n=int(input())
v=deque(list(map(int,input().split())))
c=deque(list(map(int,input().split())))
ans=deque([])
value=0
for i in range(n):
    ans.append(v[i]-c[i])
for j in range(n):
    if ans[j]>=0:
        value+=ans[j]
print(value)

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

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

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_list = v_list-c_list
get_list = filter(lambda x:x>0,diff_list)
print(sum(get_list))

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


import sys

n=int(input())

v=[]
c=[]
tmp = input().split()
tmp2 = input().split()
hoge = list(map(lambda a: int(a), tmp))
fuga = list(map(lambda a: int(a), tmp2))

sum=0
for i in range(0,n):
	v.append(hoge[i])
	c.append(fuga[i])
	if(v[i]>c[i]):
		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):
  ans += max(0, v[i]-c[i])
print(ans)

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

Solution (Python):
def greedy(n, value, cost):
    m = int(n)
    total_value = 0
    total_cost = 0
    for i in range(m):
        v = int(value[i])
        c = int(cost[i])
        if v > c:
            total_value += v
            total_cost += c
        else:
            pass
    else:
        print("%d" %(total_value - total_cost))

if __name__ == '__main__':
    n = raw_input()
    value = raw_input().split()
    cost = raw_input().split()






    greedy(n,value,cost)

Solution (Python):
n = int(input())
value_list = [int(i) for i in input().split(" ")]
cost_list = [int(i) for i in input().split(" ")]

profit = 0

for value, cost in zip(value_list,cost_list):
    if value > cost:
        profit += value -cost
print(profit)

Solution (Python):

n = int(input())
V = [int(el) for el in input().split(' ')]
C = [int(el) for el in input().split(' ')]

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

print(total)

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

Solution (Python):
N = int(input())
Vs = list(map(int, input().split()))
Cs = list(map(int, input().split()))
Is = filter(lambda i: Vs[i]>=Cs[i], range(N))
r = sum(map(lambda i: Vs[i]-Cs[i], Is))
print(r)

Solution (Python):

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

res = 0
for i in range(len(values)):
    res += max(values[i] - costs[i], 0)
print(res)

Solution (Python):



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

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

print(ret)

Solution (Python):

import sys


def get_num():
    return int(input())


def get_nums(n):
    res = [0 for _ in range(n)]
    for i in range(n):
        res[i] = int(input())
    return res


def get_numbers():
    return map(int, input().split())

n = get_num()
v = list(get_numbers())
c = list(get_numbers())

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

print(ans)

Solution (Python):
import sys
import numpy as np
input = sys.stdin.readline

def main():
    N = int(input())
    v = np.array(list(map(int, input().split())))
    c = np.array(list(map(int, input().split())))

    tmp = sorted(v - c, reverse=True)
    ans = 0
    for i in range(N):
        if tmp[i] > 0:
            ans += tmp[i]
        else:
            break
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
N, = (int(x) for x in input().split())
V_arr = [int(x) for x in input().split()]
C_arr = [int(x) for x in input().split()]

ans = 0
for v,c in zip(V_arr, C_arr):
    ans += max(0, v-c)

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

R=V-C

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

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

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

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

Solution (Python):
def main26():
    num = int(input())
    vd = input().split()
    cd = input().split()
    v = []
    c = []
    for i in range(num):
        v.append(int(vd[i]))
        c.append(int(cd[i]))
    result = 0
    for i in range(num):
        if v[i] > c[i]:
            result = result + v[i] - c[i]
    print(result)

if __name__ == "__main__":
    main26()

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

val = []
for i in range(N):
	val.append(V[i] - C[i])
val.sort()
val.reverse()
cnt = 0
valsum = 0
while cnt < N and val[cnt] >= 0:
	valsum += val[cnt]
	cnt += 1

print(valsum)

Solution (Python):
import sys

sys.setrecursionlimit(1000000000)

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


def rec(i, ans):
    if i == N:
        return ans
    else:
        return max(rec(i + 1, ans + V[i] - C[i]), rec(i + 1, ans))


ans = rec(0, 0)
print(ans)