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

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

print(ans)

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

Solution (Python):
def main():
    N = int(input())
    v = 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)
main()

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()))
netV = [V[i] - C[i] for i in range(N)]

netV=sorted(netV,reverse=True)

SUM=0
for i in range(N):
  if netV[i]>0:
    SUM += netV[i]
  else:
    break

print(SUM)

Solution (Python):
























































global FLAG_LOG
FLAG_LOG = False


def log(value):
    
    
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    
    N = int(lines[0])
    
    values_v = list(map(int, lines[1].split()))
    values_c = list(map(int, lines[2].split()))
    
    
    
    
    
    

    result = 0

    for i in range(N):
        dif = values_v[i] - values_c[i]
        if dif > 0:
            result += dif

    return [result]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['3', '10 2 5', '6 3 4']
        lines_export = [5]
    if pattern == 2:
        lines_input = ['4', '13 21 6 19', '11 30 6 15']
        lines_export = [6]
    if pattern == 3:
        lines_input = ['1', '1', '50']
        lines_export = [0]
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(3)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

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


sum = 0
for xi in range(n):
    if w[xi]>c[xi]:
        sum += w[xi]-c[xi]
print(sum)

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

Vn = list(map(int, input().split()))
Cn = list(map(int, input().split()))


result = 0
temp = 0
for V, C in zip(Vn, Cn):
    temp = V - C
    if temp >= 0:
        result += temp

print(result)

Solution (Python):
import sys
import math


def input():
    return sys.stdin.readline().rstrip()


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()))
x=sum(filter(lambda x:x > 0, map(lambda x:x[0]-x[1], zip(V,C))))
print(x)

Solution (Python):
n = input()
v = input().split()
c = input().split()
sum = 0
for v1 , c1 in zip(v , c):
  if int(v1) - int(c1) > 0:
    sum += int(v1) - int(c1)
print(sum)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    V = LI()
    C = LI()
    ans = 0
    for i in range(N):
        ans += max(V[i] - C[i], 0)
    print(ans)



main()

Solution (Python):
N = int(input())
ListV = list(map(int, input().split()))
ListC = list(map(int, input().split()))
Sum = []
for i in range(N):
  Sum.append(ListV[i]-ListC[i])
res = 0
for i in range(N):
  if Sum[i] > 0:
    res += Sum[i]
print(res)

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):
input()
f=lambda:map(int,input().split())
print(sum(max(x-y,0) for x,y in zip(f(),f())))

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.append(v[i] - c[i])
  
print(sum(x))

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

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

Solution (Python):
n=int(input())
v=[*map(int,input().split())]
c=[*map(int,input().split())]
print(sum(max(x-y,0) for x,y in zip(v,c)))

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

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

print(profit)

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

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

v = list(map(int,input().split()))
c = list(map(int,input().split()))
l =[]
l_max = 0

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


for i in l:
    if l_max < l_max+i:
        l_max += i

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

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

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

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):
input()
print(sum([max(int(v)-int(c),0) for v,c in zip(input().split(),input().split())]))

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


resolve()

Solution (Python):


def solve(n,v,c):
  l = [v[i] -c[i] for i in range(n)]
  l = filter(lambda x: x >=0,l)
  return sum(l)



def main():
  N = int(input())
  V = list(map(int,input().split()))
  C = list(map(int,input().split()))
  print(solve(N,V,C))
  return

if __name__ == '__main__':
  main()

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

for i in range(len(v)):
    if v[i] > c[i]:
        x += int(v[i])
        y += int(c[i])
        list.append(x - y)
    else:
        continue

print(max(list))

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

v_sort = sorted(v,reverse = True)
c_sort = sorted(c,reverse = True)

for i in range(len(v)):
    if v[i] > c[i]:
        x += int(v[i])
        y += int(c[i])
        list.append(x - y)
    else:
        continue

print(max(list))

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

for (p,q) in zip(x,y):
  if p-q>0:
    ans+=p-q
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]:
        cnt += (v[i]-c[i])
print(cnt)

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

Solution (Python):
import sys
N = int(input())
array_value = list(map(int,input().split()))
array_cost = list(map(int,input().split()))

if not ( 1 <= N <= 20 ): sys.exit()
for I in array_value:
    if not ( 1 <= I <= 50 ): sys.exit()
for J in array_cost:
    if not ( 1 <= J <= 50 ): sys.exit()

value_check = 0
for K in range(len(array_value)):
    value = array_value[K] - array_cost[K]
    value_check += value if value >= 1 else 0

print(value_check)

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

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

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

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

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

ans = 0
for i in range(n):
    x = value[i]-cost[i]
    if x > 0:
        ans += x
print(ans)

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

Solution (Python):
from sys import stdin,stdout

if __name__=="__main__":
    n=int(stdin.readline())

    a=[int(x) for x in stdin.readline().split()]
    b=[int(x) for x in stdin.readline().split()]

    sm=0

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

    stdout.write(str(sm)+"\n")

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

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

ans = 0
for bit in range(2**n):
    vsum = 0
    csum = 0
    for i in range(n):
        if (bit & (1 << i)):
            vsum += v[i]
            csum += c[i]
    ans = max(vsum - csum, ans)

print(ans)

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

n=int(input())
v=np.array(list(map(int,input().split())))
c=np.array(list(map(int,input().split())))
s = (v-c)
ans =0
for ss in s:
    ans += ss*(ss>0)
print(ans)

Solution (Python):
import sys

def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  

N = I()
V = LI()
C = LI()

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

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

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7
_ = ri()
a = rl()
b = rl()
ans = 0
for i, j in zip(a, b):
  ans += max(0, i-j)
print(ans)

Solution (Python):
N = input()
V = [int(X) for X in input().split()]
C = [int(X) for X in input().split()]
print(sum(X-Y if X-Y>0 else 0 for X,Y in zip(V,C)))

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


if __name__ == '__main__':
    main()

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

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

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

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

print(w - d)

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

Solution (Python):
N=int(input())
value = list(map(int,input().split()))
cost = list(map(int,input().split()))
merit = []
for i in range(N):
    merit.append(value[i]-cost[i])
ans = 0
for i in merit:
    if i>0:
        ans += i
print(ans)

Solution (Python):
N=int(input())
value = list(map(int,input().split()))
cost = list(map(int,input().split()))
merit = []
for i in range(N):
    merit.append(value[i]-cost[i])
ans = 0
for i in merit:
    if i>0:
        ans += i
print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]





N = ii()
V = li()
C = li()

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

print(sum(sa))

Solution (Python):
n = int(input())
vn = [int(num) for num in input().split()]
cn = [int(num) for num in input().split()]

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

Solution (Python):
n,a=int(input()),0
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=[0 for _ in range(n)]

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

Solution (Python):
import itertools

n=int(input())
lis=[list(map(int,input().split())) for _ in range(2)]
ans=0

for li in itertools.product([0,1], repeat=n):
  v=0
  for id,l in enumerate(li):
    if l:
      v += lis[0][id] - lis[1][id]
      
  if v > ans:
    ans=v
    
print(ans)

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

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

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

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

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

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

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

print(ans)

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

ans=0

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

Solution (Python):
def main():
    n = int(input())
    vlis = list(map(int, input().split()))
    clis = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        value = vlis[i] - clis[i]
        if value > 0:
            ans += value
    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 += max(0, v[i]- c[i])

print(ans)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
l = []
for x, y in zip(v, c):
    l.append(x-y)
ans = 0
for num in l:
    if num > 0:
        ans += num
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):
    k= v[i]-c[i]
    if k>0:
        ans+=k
print(ans)

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()))
print(sum(v-c for v,c in zip(V,C) if c<v))

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

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

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

print(ans)

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

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

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    v = na()
    c = na()
    ans = 0
    for vi, ci in zip(v, c):
        ans += max(0, vi-ci)
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np
n = int(input())
v = list(map(int,input().split()))
c = list(map(int,input().split()))
a = np.array(v)
b = np.array(c)
c = a - b
c1 =c.tolist()
c2 = sorted(c1)
ans = 0
for i in c2:
    if(i >= 0):
        ans += i
print(ans)

Solution (Python):
import sys

from bisect import bisect
from collections import defaultdict, Counter
inp = sys.stdin.readline
read = lambda: list(map(int, inp().strip().split()))





def solve():
	n = int(inp()); a = read(); b = read()
	ans = 0
	for i in range(n):
		ans += max(0, a[i]-b[i])
	print(ans)

	





		

if __name__ == "__main__":
	solve()

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

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

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

Solution (Python):
from itertools import product as p

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

ans = -10**12
for i in p(range(2), repeat=N):
    X, Y = 0, 0
    for j, k in enumerate(i):
        if k==1:
            X += V[j]
            Y += C[j]
    ans = max(ans, X-Y)
print(ans)

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

P = [v-c for v, c in zip(V, C)]
P_plus = [p if p > 0 else 0 for p in P]
print(sum(P_plus))

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

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

print(sum([i for i in ans if i >= 0]))

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict



sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)


MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    V = il()
    C = il()
    ret = 0
    for v, c in zip(V, C):
        ret = max(ret, ret + v - c)
    print(ret)


if __name__ == '__main__':
    main()

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

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

W = [V[i]-C[i] for i in range(0,N,1)]

ans =0

for i in range(0,N,1):
    if W[i]>0:
        ans += W[i]
print(ans)

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

ans=0

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

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

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

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

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

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

print(cnt)

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

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

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

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

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

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

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

Solution (Python):
n = raw_input()
vis = map(int, raw_input().split(' '))
cis = map(int, raw_input().split(' '))
r= 0
for c,v in zip(cis, vis):
  r += max(0,v - c)
print r

Solution (Python):
def solve():
    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__':
    solve()

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()))
m=[v[i]-c[i] for i in range(n) if v[i]>c[i]]
print(sum(m))

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):
def main():
    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)]
    print(sum((x for x in d if x > 0)))
    
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):
    tmp=v[i]-c[i]
    if tmp<=0:
        continue
    else:
        ans+=tmp
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 = A + (V[i] - C[i])

print(A)

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

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

print(res)

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

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()))
a = sorted([v[i]-c[i] for i in range(n)],reverse=True)
ans = 0
for j in a:
    if j <= 0:
        break
    ans += j
print(ans)

Solution (Python):


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