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

a=0
for v,c in zip(value,cost):
    if v>c:
        a+=v-c
        
print(a)

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

INF = float("inf")


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(vi - ci for vi, ci in zip(v, c) if vi > ci))

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

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

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

Solution (Python):
from sys import stdin, setrecursionlimit
from bisect import bisect_right


def main():
    input = stdin.buffer.readline
    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()
    idx = bisect_right(d, 0)
    print(sum(d[idx:]))


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

Solution (Python):
import sys

input = lambda: sys.stdin.readline().rstrip()


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

import numpy as np
n = int(input())
vList = np.array(list(map(int, input().split())) )
cList = np.array(list(map(int, input().split())) )
dList = vList-cList
ret = np.nansum(dList[dList > 0])

print(ret)

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

r = []
for i, j in zip(v,c):
    if i>j:
        r.append(i-j)
print(sum(r))

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

A = [0 for i in range(N)]

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

A = sorted(A)[::-1]

ans = 0

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

print(ans)

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

ans = 0
for x,y in zip(X,Y):
  if x-y >0:
    ans += x-y
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):
  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 = []
for i in range(n):
    a.append(v[i]-c[i])

ans = 0
for val in a:
    if val > 0:
        ans += val

print(ans)

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

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

print(ans)

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

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

print(ans)

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

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

print(max_diff_v_c)

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

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

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

Solution (Python):
import sys

N = int(sys.stdin.readline())
V = list(map(int, sys.stdin.readline().strip().split()))
C = list(map(int, sys.stdin.readline().strip().split()))

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

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

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

Solution (Python):
def actual(n, V, C):
    
    sale_jewels = []

    for v, c in zip(V, C):
        if v - c > 0:
            sale_jewels.append(v - c)

    return sum(sale_jewels)

    


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

print(actual(n, V, C))

Solution (Python):
import itertools

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 math
def ip():return int(input())
def inp():return map(int,input().split())
def inpstr():return map(str,input().split())
def linp():return list(map(int,input().split()))
def linpstr():return list(map(str,input().split()))

n=ip()
v=linp()
c=linp()
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,j in zip(v,c):
    if i-j>0:
        ans+=(i-j)
print(ans)

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
Vl = LI()
Cl = LI()
ans = 0
for i in range(N):
    if Vl[i] - Cl[i] > 0:
        ans += Vl[i] - Cl[i]
print(ans)

Solution (Python):
import sys
from itertools import accumulate
n = int(sys.stdin.readline())
a = list(map(int,sys.stdin.readline().split()))
b = list(map(int,sys.stdin.readline().split()))
s = 0
for i in range(n):
    if a[i] >= b[i]:
        s += a[i]-b[i]
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):
    X = V[i] - C[i]
    if X > 0:
        ans += X
print(ans)

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

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


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
m = -10*100
for i in range(2**N):
    tmp = 0
    for j in range(N):
        if (i>>j)&1:
            tmp += V[j]-C[j]
    m = max(tmp, m)

print(m)

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

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

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

print(ans)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=[]
for i in range(2**n):
    x=0
    y=0
    for j in range(n):
        if (i>>j)&1:
            x+=v[j]
            y+=c[j]
    ans.append(x-y)
print(max(ans))

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

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

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

Solution (Python):
import itertools
import decimal
import math
import collections
import sys
input = sys.stdin.readline

N=int(input())

ListV=list(map(int,input().split()))
ListC=list(map(int,input().split()))

ans=0

for i in range(N):
    if(ListV[i]>ListC[i]):
        ans=ans+ListV[i]-ListC[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):
  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()))
vc = [] 
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()))
m=0
for i in range(N):
    if V[i]>C[i]:
        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):
    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:
        continue
    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 = map(int, input().split())
c = map(int, input().split())

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

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

for i,j in zip(v,c):
    if i-j >= 0:
        point += i-j

print(point)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

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

    print(res)


if __name__ == '__main__':
    resolve()

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

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n=int(input())
    v=list(map(int,input().split()))
    c=list(map(int,input().split()))
    ans=0
    for x,y in zip(v,c):
        if x-y>0:
         ans+=x-y
    print(ans)
resolve()

Solution (Python):
def examA():
    N = I()
    V = LI()
    C = LI()
    ans = 0
    for i in range(N):
        ans += max(0,V[i]-C[i])
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

from decimal import Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 10**(-12)
alphabet = [chr(ord('a') + i) for i in range(26)]

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

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

"""
def dec2bin(n):
    amari = [[] for j in range(2**n)]
    for i in range(2**n):
        while i != 0:
            amari[i].append(i%2)
            i = i // 2
        if len(amari[i]) != n:
            while len(amari[i]) < n:
                amari[i].append(0)
        amari[i].reverse()
    return amari
"""
def dec2bin(target):
    amari = []
    while target != 0:
        amari.append(target % 2)
        target = target //2
    if len(amari)!=n:
        while len(amari)<n:
            amari.append(0)
    amari.reverse()
    return amari

b = [[] for i in range(2**n)]
for j in range(2**n):
    b[j] = dec2bin(j)


vc = 0
for i in range(2**n):
    vsum = 0
    csum = 0
    for j in range(n):
        if b[i][j] == 1:
            vsum += v[j]
            csum += c[j]
    if vc <= vsum - csum:
        vc = vsum - csum
print(vc)

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

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

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

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

Solution (Python):

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


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

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

print(ans)

Solution (Python):

n = int(input())
valu = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans = 0
for i in range(n):
    if cost[i] < valu[i]:
        ans += valu[i] - cost[i]
    else:
        ans += 0
print(ans)

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

count=0
for i in range(n):
  if s[i]>c[i]:
    count=s[i]-c[i]+count
    
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())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
ab=[a[i]-b[i] if a[i]-b[i]>=0 else 0 for i in range(n)]
print(sum(ab))

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):
def resolve():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

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


resolve()

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

Solution (Python):

import sys


def solve(N: int, V: "List[int]", C: "List[int]"):
    return sum(filter(lambda x: x>0, [v-c for v, c in zip(V, C)]), 0)



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)]  
    print(solve(N, V, C))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):

N = int(input())

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

ans = 0
for i in range(N):
    difference = Vn[i] - Cn[i]
    if difference > 0:
        ans += difference

print(ans)

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

B = 0
for i in range(N):
    b = V[i]-C[i]
    if b>=0:
        B = B + b
    else:
        pass

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

Solution (Python):

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

ans = np.sum((v-c)*((v-c) >= 0))

print(ans)

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

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

print(gain)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans = int(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
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):
n=int(input())
vs=list(map(int,input().split()))
cs=list(map(int,input().split()))
a=0
for v,c in zip(vs,cs):
    m=v-c
    if m>0:
        a+=m
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):
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    val = 0
    for i in range(N):
        if V[i]-C[i] >= 0:
            val += V[i]-C[i]
    print(val)

if __name__ == '__main__':
    main()

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

cost = []
value = []
for i in range(n):
    if v[i] / c[i] > 1:
        cost.append(c[i])
        value.append(v[i])

print(sum(value) - sum(cost))

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
import sys
input = sys.stdin.readline
N = int(input())
V = np.array(list(map(int, input().split())))
C = np.array(list(map(int, input().split())))


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

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

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans=0
for x,y in zip(v,c):
    ans+=max(x-y, 0)
print(ans)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
ans=-10*18
for i in range(1<<n):
    mask=[(i>>j)&1 for j in range(n)]
    X=0
    Y=0
    for k, m in enumerate(mask):
        if m==1:
            X+=v[k]
            Y+=c[k]
    ans=max(ans, X-Y)
    
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]:
        ans += V[i] - C[i]
print(ans)

Solution (Python):
import numpy as np

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

res = v - c
res = res[np.where(res > 0)]

print(res.sum())

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

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

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
m=list(map(int,input().split()))
def f(x):
	return l[x]-m[x]
print(sum([f(i) for i in range(n) if f(i)>0]))

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

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

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

Solution (Python):
I=lambda:map(int,input().split())
N=int(input())
*V,=I()
*C,=I()
print(sum([x-y for x,y in zip(V,C) if x-y>0]))

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

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

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

Solution (Python):
n=int(input())
v=[int(x) for x in input().split()]
c=[int(x) for x in input().split()]
vc=[]
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()))
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()))
A=[V[i]-C[i] for i in range(N)]
ans=0
for i in range(N):
    if A[i]>0:
        ans+=A[i]
print(ans)

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

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

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

Solution (Python):
n = int(input())
v = input().split(" ")
c = input().split(" ")

for i in range(n):
    v[i] = int(v[i])
    c[i] = int(c[i])

sum = 0

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

print(sum)

Solution (Python):
n = int(input())
v = 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
input = sys.stdin.readline

N = int(input().rstrip())

V_list = list(map(int, input().rstrip().split()))
C_list = list(map(int, input().rstrip().split()))
ans_V = []
ans_C = []

for i in range(N):
  if V_list[i] > C_list[i]:
    ans_V.append(V_list[i])
    ans_C.append(C_list[i])

print(sum(ans_V) - sum(ans_C))

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

for i in range(2**n):
    list_v = []
    list_c = []
    for j in range(n):
        if (i >> j) &1 ==1:
            list_v.append(v[j])
            list_c.append(c[j])
    if sum(list_v) - sum(list_c) >= result:
        result = sum(list_v) - sum(list_c)

print(result)

Solution (Python):
from collections import Counter 
from collections import defaultdict
from collections import deque
import math
import itertools
import heapq
import numpy as np
import sys
sys.setrecursionlimit(10**6)




ceil=lambda x,y: (x+y-1)//y
input_list = lambda : list(map(int,input().split()))
import fractions

n=int(input())
a=input_list()
b=input_list()
c=[]
for i in range(n):
    c.append(a[i]-b[i])

c.sort(reverse=True)
ans=0
for i in c:
    if i<0:
        break
    ans+=i

print(ans)

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

print(sum([a-b if a-b>0 else 0 for a,b in zip(V,C)]))

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

Solution (Python):
n = int(input())
a = [i - j for i, j in zip([int(i) for i in input().split()], [int(i) for i in input().split()])]
print(sum(filter(lambda c: c > 0, a)))

Solution (Python):
import itertools
import math
import fractions
import functools
import copy
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

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

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

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    V = lmi()
    C = lmi()
    diff = [V[i] - C[i] for i in range(n)]
    print(sum(filter(lambda x: x>0, diff)))


if __name__ == "__main__":
    main()

Solution (Python):
def q2():
    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] > 0:
            ans += V[i] - C[i]
    return ans

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

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


if __name__ == "__main__":
    main()

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