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

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

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

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

print(ans)

Solution (Python):
import math
import re

n = int(raw_input())
v = raw_input().split()
c = raw_input().split()


cnt = 0
for i in v:
    v[cnt] = int(i)
    cnt += 1

cnt = 0
for i in c:
    c[cnt] = int(i)
    cnt += 1

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

print total

Solution (Python):
import numpy as np
n=int(input())
v=np.asarray(list(map(int, input().split())))
c=np.asarray(list(map(int, input().split())))
print(np.sum(np.where(v-c>=0,v-c,0)))

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

xmy = 0
dp=[0]*n
dp[0] = max(v[0]-c[0], 0)
for i in range(1, n):
    dp[i] = max(dp[i-1]+v[i]-c[i], dp[i-1])
print(dp[-1])

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
x = []
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())
res = 0
v = list(map(int,input().split()))
c = list(map(int,input().split()))

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

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

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

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

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

print(x)

Solution (Python):



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

    for vi, ci in zip(v, c):
        if vi >= ci:
            ans += vi - ci

    print(ans)


if __name__ == '__main__':
    main()

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

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

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

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

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

print(answer)

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):
import numpy as np
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]

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

diff = V - C
print(np.sum(diff[diff>=1]))

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

for x in range(N):
    if V[x] >= C[x]:
        count += V[x] - C[x]

print(count)

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

vc = []
i = 0
for v in V:
    vc.append(V[i] - C[i])
    i += 1

d_sum = 0
for d in vc:
    if 0 < d:
        d_sum += d

print(d_sum)

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

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

Solution (Python):
import numpy as np

if __name__ == "__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)

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

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

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

x_y = [v - c for v, c in zip(vs, cs)]

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

print(ans)

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)

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

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

Solution (Python):
from sys import stdin
N = int(stdin.readline().rstrip())
V = [int(x) for x in stdin.readline().rstrip().split()]
C = [int(x) for x in stdin.readline().rstrip().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 = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
s = 0
for i in range(n):
    if v[i]-c[i] > 0:
        s += v[i]-c[i]

print(s)

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

Solution (Python):
N = int(input())
V = [int(i) for i in input().split()]
C = [int(i) for i in 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_lst = list(map(int,input().split()))
c_lst = list(map(int,input().split()))
ans_lst = []


for i in range(n):
    ans_lst.append(v_lst[i]-c_lst[i])
ans_lst.sort(reverse=True)

ans = 0
for a in ans_lst:
    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):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

d = []
for i in range(N):
    d.append(V[i]-C[i])

d = sorted(d,reverse=True)

ans = 0
for i in range(N):
    if d[i] < 0:
        break
    ans += d[i]
print(ans)

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

S = 0

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

diff = v - c

total = 0
for d in diff:
	if d > 0:
		total += d
print(total)

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

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

s = 0

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

print(s)

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

Solution (Python):


n = int(input())
v = input().split()
c = input().split()

total = 0

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

print(total)

Solution (Python):

n = int(input())
v = input().split()
c = input().split()



result = 0

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


print(result)

Solution (Python):

N = input()
N = int(N)
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(str(ans))

Solution (Python):



def main():
    N = int(input())
    value = list(map(int, input().split()))
    cost = list(map(int, input().split()))
    ans = 0
    for i in range(len(value)):
        if value[i] > cost[i]:
            ans += (value[i]-cost[i])
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):


N = int(input())
Vlist = [int(c) for c in input().split()]
Clist = [int(c) for c in input().split()]
plus = []
for i in range(N):
    a = Vlist[i]-Clist[i]
    plus.append(a)

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

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):
    d = V[i] - C[i]
    if d > 0:
        ans += d

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

    vcSum = 0

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

    print(vcSum)


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

li = []
for i in range(N):
    if 0 < V[i] - C[i]:
        li.append(V[i] - C[i])

print(sum(li))

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

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

sum_ = 0
for v, c in zip(vs, cs):
    sub = v - c
    if sub > 0:
        sum_ += sub

print(sum_)

Solution (Python):
n = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]
vc = [[x/y, x-y] for x, y in zip(v, c)]
vc.sort(key=lambda x: x[0], reverse=True)
diff = 0
for a in vc:
    if a[0] > 1.0:
        diff += a[1]
print(diff)

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

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

print(b)

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

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

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

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

for i in range(n):
  if vs[i] > cs[i]:
    res += vs[i] - cs[i]

print(res)

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

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

print(total)

Solution (Python):
n = int(input())
list1 = list(map(int,input().split()))
list2 = list(map(int,input().split()))
list3 = []
for i in range(n):
  list3.append(list1[i]-list2[i])
sum = 0
for j in range(n):
  if list3[j] > 0:
    sum += list3[j]
print(sum)

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

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

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

    return ans

print(solve())

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

ret = 0

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

print(ret)

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

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

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

sum_ = 0
for d in Dlist:
    if d >= 0:
        sum_ += d

print(sum_)

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

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

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

Solution (Python):


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

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

    return ans

def main():
    print(answer())


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=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 x in a:
    if x>0:
        ans+=x
print(ans)

Solution (Python):
n = int(input())
Vi = map(int, input().split())
Ci = map(int, input().split())

print(sum([max(0, v-c) for (v, c) in zip(Vi, Ci)]))

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

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

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

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

points = [V[i]-C[i] for i in range(N)]
p_points = [point for point in points if point > 0]
print(sum(p_points))

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

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

print(sum(diff))

Solution (Python):

import sys
def solve(lines):
    N = int(lines.pop(0))
    V = list(map(int, lines.pop(0).split(' ')))
    C = list(map(int, lines.pop(0).split(' ')))
    res = 0
    for (v, c) in zip(V, C):
        if v > c:
            res += v - c
    print(res)

lines = [x.strip() for x in sys.stdin.readlines()]
solve(lines)

Solution (Python):
n=int(input())
lstV = list(map(int, input().split()))
lstC = list(map(int, input().split()))

anslst=[0]
for i in range(n):
    if lstV[i]>lstC[i]:
        anslst.append(lstV[i]-lstC[i])
print(sum(anslst))

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

listdayo = []

for index in range(n):

    if v[index] - c[index] > 0:
        listdayo.append(v[index] - c[index])

print(sum(listdayo))

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

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


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

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

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

Solution (Python):


if __name__ == '__main__':
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))

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

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

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

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

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

lis = [0]*n
for i in range(n):
  lis[i] = v[i] - c[i]
print(sum(filter(lambda x:x > 0,lis)))

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

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

Solution (Python):
N = int(input())
list_V = list(map(int,input().split()))
list_C = list(map(int,input().split()))
i = 0
ans = 0
while i < N:
    value = list_V[i] - list_C[i]
    if value > 0:
        ans += value
    i += 1
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] > 0:
        count = 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 =[]
for i in range(N):
  x = V[i]-C[i]
  if x>0:
    ans.append(x)
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):
    if (V[i] - C[i] > 0):
        ans += V[i] - C[i]

print(ans)

Solution (Python):
n = int(input())
value = [int(x) for x in input().split()]
cost = [int(x) for x in input().split()]
benefit = 0
for i in range(n):
  temp = value[i] - cost[i]
  if temp > 0:
    benefit += temp
print(benefit)

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

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

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

print(ans)

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

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

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

score = [v - c for v, c in zip(V, C) if v > c]
print(sum(score))

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

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

print (m)

Solution (Python):
"""
N 個の宝石があり、i 番目の宝石の価値は Viです。
あなたはこれらの宝石の中からいくつかを選んで手に入れます。
このとき、1つも選ばなくとも、全て選んでも構いません。
ただし、i番目の宝石を手に入れる場合コスト Ciを支払わなければいけません。
手に入れた宝石の価値の合計を X、支払ったコストの合計を Yとします。
X−Yの最大値を求めてください。

制約
入力は全て整数である。
1≤N≤20
1≤Ci,Vi≤50

X - Y = Σ(Vi - Ci)
Vi - Ci > 0のものを全て取得する
"""
N = int(input())
v_list = input().split(" ")
c_list = input().split(" ")
v_list = [int(i) for i in v_list]
c_list = [int(i) for i in c_list]

sumValue = 0
for i in range(N) : 
    substantialValue = v_list[i] - c_list[i]
    if substantialValue > 0 : sumValue += substantialValue
print(sumValue)

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

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

Solution (Python):
N = int(input())
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
xy = []
for v,c in zip(V,C):
    if v-c > 0:
        xy.append(v-c)

print(sum(xy))

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

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

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

total = 0

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

print(total)

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())
V = [int(i) for i in input().split()] 
C = [int(i) for i in input().split()] 

ans = []

for i in range(1<<N):
    X = 0
    Y = 0
    for j in range(N):
        if ((i >> j) & 1) == 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()))
t = []
for vi,ci in zip(v,c):
    t.append(vi-ci)

g = 0
for t1 in t:
    if t1 > 0:
        g += t1
print(g)

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

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

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

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

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

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

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

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

sum = 0
for i in range(n):
  merit = value[i]-cost[i]
  if merit > 0:
    sum += merit

print(sum)

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

ans = 0

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

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

print(ans)

Solution (Python):
import sys


N = int(sys.stdin.readline())


V = list(map(int, sys.stdin.readline().split()))
C = list(map(int, sys.stdin.readline().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(ans+V[i]-C[i],ans)
print(ans)

Solution (Python):

import re
import bisect
from datetime import datetime as dt

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

a = []

for i in range(N):
    a.append(V[i] - C[i])

a.sort()
a.reverse()

ans = 0

for i in a:
    if i >= 0:
        ans += 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()))

difer = [v - c for v, c in zip(V, C)]

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

print(ans)

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

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

difplus = []
for i in range(n):
  dif = value[i] - cost[i]
  if dif > 0:
    difplus.append(dif)
    
if difplus == []:
  print(0)
else:
  ans = 0
  for j in difplus:
    ans += j
  print(ans)

Solution (Python):


import sys
 
input = sys.stdin.readline
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))

a = 0
for i in range(len(v)):
    t = v[i] - c[i]
    if t > 0:
        a += t

print(a)

Solution (Python):
from sys import stdin

N = int(stdin.readline().rstrip())
V = [int(x) for x in stdin.readline().rstrip().split()]
C = [int(x) for x in stdin.readline().rstrip().split()]

res = 0

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

print(res)

Solution (Python):
import math
import os
import random
import re
import sys

def solve(n, v, c):
	x = 0
	if n < 1:
		return 0
	for i in range(n):
		if v[i] > c[i]: x += v[i] - c[i]

	return x

if __name__ == '__main__':
    
    
    
    
    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    print(solve(n,v,c))

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

out = 0

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


print(out)

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

diffs = [V - C for V, C in zip(Vs, Cs)]
diffs = sorted(diffs)

ans = 0
for diff in diffs[::-1]:
    if diff >= 0:
        ans += diff

print(ans)

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