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):
def solve():
    n = int(input())
    V = map(int, input().split())
    C = map(int, input().split())
    P = [v-c for v,c in zip(V,C) if v>c]
    return sum(P)
    
if __name__ == '__main__':
    print(solve())

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

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

Solution (Python):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
curr_max = 0
for i in range(len(V)):
    temp = curr_max + V[i] - C[i]
    curr_max = max(curr_max, temp)
print(curr_max)

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()))
Z = [x-y for x, y in zip(V, C) if x-y > 0]
print(sum(Z))

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

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

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]
  if t > 0:
      ans += t

print(ans)

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

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

Solution (Python):
num = int(input())
value = input().split()
cost = input().split()

value, cost = [int(i) for i in value], [int(i) for i in cost]

ans_arr = sorted([value[i]-cost[i] for i in range(num)])[::-1]
ans = 0
for i in ans_arr:
  if i>0:
    ans += i

print(ans)

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

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

ans = 0
for i in range(n):
    xy = vl[i] - cl[i]
    if xy >= 0:
        ans = ans + xy

print(ans)

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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()))
p=0
for i in range(n):
    if a[i]>b[i]:
        p+=a[i]-b[i]
print(p)

Solution (Python):
import heapq
N = int(input()) 
V=list(map(int,input().split())) 
C= list(map(int,input().split())) 
a=[] 
for i in range(0,N): 
  if V[i]>=C[i]:
    heapq.heappush(a,(V[i]-C[i])) 
  else:
    continue 
print(sum(a))

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

Solution (Python):
N=int(input())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
t=0
for n in range(N):
    if X[n]-Y[n]>0:
        t+=(X[n]-Y[n])
print(t)

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

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

res = 0
for v, c in zip(V,C):
    if v - c > 0:
        res += v - c
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):
    benefit = v[i] - c[i]
    if benefit > 0:
        count += benefit
print(count)

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

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

print(cnt)

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

profit = [x - y for (x, y) in zip(V, C)]

res = 0

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

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):
  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(len(v)):
    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]*N

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

print(sum(A))

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

sum_xy = 0

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

Solution (Python):
import math

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


sum_value = 0
sum_cost = 0

for i in range(N):

    if V[i] > C[i]:
        sum_value += V[i]
        sum_cost += C[i]

print(sum_value - sum_cost)

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

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

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

for i in range(1,n+1):
  diff = v[i-1] - c[i-1]
  if diff > 0:
    ans.append(diff)
print(sum(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 v, c in zip(V, C):
    if v > c:
        ans += v - c
print(ans)

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

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

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

Solution (Python):
N = int(input())
V_list = list(map(int,input().split()))
C_list = list(map(int,input().split()))

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

print(sum)

Solution (Python):
n = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
d=[]
for i in range(n):
    d.append(values[i]-costs[i])
d.sort(reverse=True)

ans =0 
for e in d:
    if e>0:
        ans += e
    else:break
print(ans)

Solution (Python):
N=int(input())
List_v=list(map(int,input().split()))
List_c=list(map(int,input().split()))
List_m=[]
for i in range (N):
    List_m.append(List_v[i]-List_c[i])
count=0
for j in range(N):
    if List_m[j]>=0:
      count+=List_m[j]
print(count)

Solution (Python):
n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))

ans = 0
for v, c in zip(value, cost):
    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 _v,_c in zip(v,c):
    if _v < _c:
        continue
    ans+=_v-_c

print(ans)

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

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

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]:
                j=v[i]-c[i]
                l.append(j)
print(sum(l))

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

a=list(input().split())
b=list(input().split())
total=0
for i in range(n):
  kati=int(a[i])-int(b[i])
  if kati>0:
    total=total+kati
print(total)

Solution (Python):
def main():
    n=int(input())
    x=list(map(int,input().split(' ')))
    y=list(map(int,input().split(' ')))
    ans = 0
    for i,j in zip(x,y):
        if i-j > 0:
            ans += i-j
    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):
  ans+=V[i]-C[i] if V[i]-C[i]>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] > 0:
        ans += v[i] - c[i]

print(ans)

Solution (Python):
import numpy as np
N = int(input())

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

V   = np.array(V)
C   = np.array(C)


C   = V-C

sum = 0

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

print(sum)

Solution (Python):

import sys
sys.setrecursionlimit(10 ** 7)


def solve(N: int, V: "List[int]", C: "List[int]"):
    ans = 0
    for i in range(len(V)):
        ans += max(V[i] - C[i], 0)
    print(ans)
    return




def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    V = [int(next(tokens)) for _ in range(N)]  
    C = [int(next(tokens)) for _ in range(N)]  
    solve(N, V, C)


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

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

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

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

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

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

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

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

print(ans)

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

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

Solution (Python):


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

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

print(g)

Solution (Python):
N = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
ans = [l-p for l,p in zip(v,c)]
ans1 = 0
for i in ans :
  ans1 += i if i>0 else 0
print(ans1)

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):
from collections import Counter,defaultdict
import sys,bisect,math,itertools,string,queue
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

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

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_lst = map(int, input().split())
c_lst = map(int, input().split())
i = 0
res = 0
for v, c in zip(v_lst, c_lst):
  value = v - c
  if value > 0:
    res += value
  i += 1
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):
    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()))
tot = 0
for i in range(N):
	if V[i] > C[i]:
		tot += V[i] - C[i]
print(tot)

Solution (Python):
N = int(input())
v_l = list(map(int, input().split()))
c_l = list(map(int, input().split()))
net = [v_l[i] - c_l[i] for i in range(N)]
max = 0
for i in range(N):
  if net[i] > 0:
    max = max + net[i]
  else:
    max = max
print(max)

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()))
sum = 0
for i,j in zip(v,c):
    if i > j:
        sum += i - j
print(sum)

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

print(ans)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
lis = [V[i] - C[i] for i in range(N)]
ans = 0
for i in range(N):
  if lis[i] > 0:
    ans += lis[i]
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)]
benefit.sort(reverse=True)
ans = 0
for b in benefit:
  if b > 0:
    ans += b
print(ans)

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

v2 = [i-j for i,j in zip(v,c) if i -j > 0]

print(sum(v2))

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

Solution (Python):



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

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


if __name__ == "__main__":
    main()

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

value = [v - c for v, c in zip(v, c)]
print(sum([i for i in value if i > 0]))

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

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

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    profit = 0
    for v, c in zip(V, C):
        if v-c > 0:
            profit += v-c
    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]>0:
    ans+=v[i]-c[i]
print(ans)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
sum=0
i=0
while i<n:
    if v[i]>c[i]:
        sum+=v[i]-c[i]
    i+=1
print(sum)

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

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

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

Solution (Python):
n = int(input())
v = list(map(int,input().split(" ")))
c = list(map(int,input().split(" ")))
ans = []
for i in range(n):
    tmp = v[i] -c[i]
    if tmp > 0:
        ans.append(tmp)
print(sum(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(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())
lv = list(map(int, input().split()))
lc = list(map(int, input().split()))

ans = 0
for i in range(n):
    ans += max(lv[i] - lc[i], 0)
print(ans)

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

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
V_array = list(map(int, input().split()))
C_array = list(map(int, input().split()))
ans = 0

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


print(ans)

Solution (Python):
n = int(input())
lv = list(map(int, input().split()))
lc = list(map(int, input().split()))

ans = 0

for i in range(n):
    ans += max(lv[i] - lc[i], 0)

print(ans)

Solution (Python):
N= input()
V = map(int,input().split())
C = map(int,input().split())
ans = 0
for x,y in zip(V,C):
  if (x - y) > 0:
    ans +=  x-y
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()))
import numpy as np
x = np.array(v)
y = np.array(c)
z = [i for i in x-y if i>=0]
print(sum(z))

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

R = []
for i in range(n):
    data = V[i]-C[i]
    if data >= 0:
        R.append(data)
        
print(sum(R))

Solution (Python):
num = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
sums=0
for t in range(num):
  values = v[t] - c[t]
  if values > 0:
    sums += values
print(sums)

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

sa = [v-c if v-c>0 else 0 for v,c in zip(V,C)]

print(sum(sa))

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

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

m=0
for i in range(n):
  if a[i]>b[i]:m+=a[i]-b[i]
print(m)

Solution (Python):
n = int(input())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
profits = [v - c for v, c in zip(values, costs)]
res = 0
for value, cost in zip(values, costs):
    x = value - cost
    if x > 0:
        res += x
print(res)

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

diff = v - c
diff = np.sort(diff)[::-1]

ans = 0
for i in range(n):
    if diff[i] <= 0:
        break
    ans += diff[i]

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
from functools import lru_cache

@lru_cache(maxsize=None)
def dfs(i,cost):
    if i == N:
        return 0

    res1 = dfs(i+1,cost)
    res2 = dfs(i+1,cost+C[i]) + V[i] - C[i]

    return max(res1,res2)

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

print(dfs(0,0))

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

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

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

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

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

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

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

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

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

max_values = 0
for value, cost in zip(values, costs):
  diff = value - cost
  if diff > 0:
    max_values += diff
print(max_values)

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

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

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

Solution (Python):
N = int(input())
lst1 = list(map(int, input().split()))
lst2 = list(map(int, input().split()))
cnt = 0
for (i, j) in zip(lst1, lst2):
    if i - j > 0:
        cnt += i-j
print(cnt)

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

Solution (Python):
import numpy as np
N=int(input())
vs=list(map(int, input().split()))
cs=list(map(int, input().split()))
s=[v-c for v,c in zip(vs,cs) if v-c>0]
print(sum(s))

Solution (Python):
import numpy as np
N=int(input())
v=list(map(int, input().split()))
c=list(map(int, input().split()))
v=np.array(v)
c=np.array(c)
s=(v-c)
s=s.tolist()
s=[x if x>0 else 0 for x in s]
print(sum(s))

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

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

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

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

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

cnt = 0
for n in range(N):
    g = V[n] - C[n]
    if (g > 0): cnt += g
print(cnt)

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

Solution (Python):
def MAP(): return map(int,input().split())

n = int(input())
*v, = MAP()
*c, = MAP()

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 = list(map(int, input().split()))
Cs = list(map(int, input().split()))

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

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

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

Solution (Python):
n = int(input())
vs = list(map(int, input().split()))
cs = list(map(int, input().split()))















x = 0
y = 0
for i in range(n):
    if vs[i] > cs[i]:
        x += vs[i]
        y += cs[i]
print(x - y)

Solution (Python):
import numpy as np

N = int(input())
V = np.array([int(v) for v in input().split()])
C = np.array([int(c) for c in input().split()])
R = V - C
print(R[R > 0].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):
    diff = V[i] - C[i]
    if diff > 0:
        ans += diff

print(ans)

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

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

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

print(Answer)

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

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

Solution (Python):
N=int(input())
A=map(int,input().split())
B=map(int,input().split())
ans=0
for a,b in zip(A,B):
	ans+=max(0,a-b)
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())))

V = V-C
ans = 0
for v in V:
    if v <= 0:
        continue
    ans += v

print(ans)

Solution (Python):

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

sum_v = []
ans = 0
for i in range(N):
    sum_v.append(V[i]-C[i])
sum_v.sort(reverse=True)

for j in range(N):
    if sum_v[j] > 0:
        ans += sum_v[j]
    else:
        break

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

Solution (Python):
N = int(input())
vs = list(map(int, input().split()))
cs = list(map(int, input().split()))

res = 0
for i in range(N):
    res += max(0, vs[i] - cs[i])

print(res)

Solution (Python):
N = int(input())
v = list(int(i) for i in input().split())
c = list(int(i) for i in input().split())

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

print(result)

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 = VC + V[i]-C[i]
    else:
        VC = VC

print(VC)

Solution (Python):
n = int (input())
liv = list(map(int,input().split()))
lic = list(map(int,input().split()))
ans = sum([liv[i]-lic[i] for i in range(n) if liv[i]-lic[i]>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):
    d = V[i] - C[i]
    if d > 0:
        ans += d

print(ans)

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

arr = np.array(sorted(V - C, reverse=True))

ans = sum(arr[arr > 0])

print(ans)