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

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

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

print(result)

Solution (Python):
n = int(input())
vs = map(int, input().split(' '))
cs = map(int, input().split(' '))
diff = [v - c for v, c in zip(vs, cs)]
maximum_value = sum([max(0, d) for d in diff])
print(maximum_value)

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= input().split()
C= input().split()

maxval=0

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

print(maxval)

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

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

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
sum = 0

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

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
ans = 0
for i in range(N):
    if V[i] > C[i]:
        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):
[print(sum(filter(lambda x:x>0,map(lambda x:x[0]-x[1],zip(c,v)))))for _,c,v in[[input(),map(int,input().split()),map(int,input().split())]]]

Solution (Python):
n = int(input().strip())
values = list(map(int, input().split()))
costs = list(map(int, input().split()))
 
sales = [v - c for v, c in zip(values, costs) if v > c]
 
print(sum(sales))

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

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

print(sum(filter(lambda x: x > 0, map(lambda x: x[0] - x[1], zip(v, c)))))

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

max = 0
for value, cost in zip(V, C):
    value_int = int(value)
    cost_int = int(cost)
    if(value_int - cost_int > 0):
        max += value_int - cost_int

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

Solution (Python):
n = int(input())
li_v = list(map(int, input().split()))
li_c = list(map(int, input().split()))

li_a = list()

for i in range(n):
    li_a.append(li_v[i] - li_c[i])

print(sum(list(filter(lambda x: x >= 0, li_a))))

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

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

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

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

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

A = list(map(int, input().split()))
B = list(map(int, input().split()))

sum = 0

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

print(sum)

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

Solution (Python):
input()
V,C = [[int(x) for x in input().split(" ")] for _ in range(2)]
ans=0
for v,c in zip(V,C):
    ans += max(v-c,0)
print(ans)

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

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

Solution (Python):
import numpy as np 
n = int(input())
if n  < 2:
    print(0)
    exit()
e = [[int(i) for i in input().split()] for i in range(2)]
e3 = np.array(e)
a = np.sort((e3[0] - e3[1]))
print(a[a>0].sum())

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

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

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

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

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

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

print(count)

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

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

Solution (Python):

from sys import stdin




s_in = lambda: stdin.readline()[:-1]  
d_in = lambda: int(stdin.readline())  
ds_in = lambda: list(map(int, stdin.readline().split()))  


N = d_in()
V_list = ds_in()
C_list = ds_in()

ans = 0
for v, c in zip(V_list, C_list):
    diff = v - c
    if diff > 0:
        ans += diff
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()))

gap = [V[i] - C[i] for i in range(N)]
ans = sum(list(filter(lambda x:x>0, gap)))
print(ans)

Solution (Python):
N = int(input())
arr_V = input().split()
arr_C = input().split()

loss = [0] * N
ans = 0

for i in range(N):
    if int(arr_V[i]) - int(arr_C[i]) > 0:
        ans += int(arr_V[i]) - int(arr_C[i])
        
print(ans)

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

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

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

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

Solution (Python):


N = int(input())
V_n = list(map(int, input().split()))
C_n = list(map(int, input().split()))

ans = 0
dif = [0] * N

for i in range(N):
    dif[i] = V_n[i] - C_n[i]
    if dif[i] > 0:
        ans += dif[i]
print(ans)

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

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

v_list = list(map(int,input().split()))
c_list = list(map(int,input().split()))

e_list = [v-c if (v-c > 0) else 0 for v,c in zip(v_list, c_list)]

print(sum(e_list))

Solution (Python):
import numpy as np

n = int(input())

v_list = np.array(list(map(int,input().split())))
c_list = np.array(list(map(int,input().split())))
e_list = list(v_list - c_list)

ans = 0

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

total = 0

for i in range(n):

  if x[i] - y [i] > 0:
    total = total + x[i] - y [i]

print(total)

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

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

print(ret)

Solution (Python):



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

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

print(count)

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

Solution (Python):
N = input()
V = list(map(int,input().split())) 
Y = list(map(int,input().split())) 
goukei = 0
for v, y in zip(V,Y): 
    if(y-v >= 0):
        goukei +=0
    else:
        goukei += v-y
print(goukei)

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

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

print (count)

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

Solution (Python):
N=input()
X=list(map(int,input().split(" ")))
Y=list(map(int,input().split(" ")))
s=0
for i,it in enumerate(X):
  if it>Y[i]:
    s+=it-Y[i]
print(s)

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

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

Solution (Python):


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

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

Solution (Python):
N = int(input())
V = [int(v) for v in input().split(' ')]
C = [int(c) for c in 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()))
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 = input().split()
c = input().split()
outPut = 0

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

print(outPut)

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):
from sys import exit

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

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

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(2**N):
    val = 0
    for j in range(N):
        if (i >> j) & 1:
            val+=V[j]
            val-=C[j]
    ans = max(ans, val)
print(ans)

Solution (Python):
col = input().split()
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)

Solution (Python):
_ = input()

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

result = 0

for i, price in enumerate(v):
  income = price - c[i]
  
  if income > 0:
    result += income

print(result)

Solution (Python):
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ans = 0

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

print(ans)

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

Solution (Python):


n=int(input())
x=input().split(" ")
y=input().split(" ")
ans=0
for i in range(n):
    a=int(x[i])-int(y[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()))
s = [x - y for (x, y) in zip(v, c)]
ret = sum([x for x in s if x > 0])
print(ret)

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)]
print(sum([x for x in X if x > 0]))

Solution (Python):
import sys
import subprocess
import re
import datetime
import os

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):
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
d = [j - C[i] for i,j in enumerate(V) if j - C[i] > 0]
if d:
    print(sum(d))
else:print(0)

Solution (Python):
N = int(input())
lst1 = [int(x) for x in input().split()]
lst2 = [int(x) for x in input().split()]
ret = 0
for x, y in zip(lst1, lst2):
    if x > y:
        ret += (x - y)
print(ret)

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

Solution (Python):

import sys


def solve(N: int, V: "List[int]", C: "List[int]"):
    tmp = []
    for i in range(N):
        tmp.append(V[i] - C[i])
    tmp.sort(reverse=True)
    ret = 0
    for t in tmp:
        if t > 0:
            ret += t
    print(ret)
    return


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

if __name__ == '__main__':
    main()

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

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

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

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

worth = 0

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

print(worth)

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

res = 0

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

print(res)

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

Solution (Python):
from itertools import product
import operator
import unittest

def solution(n, v, c):

    value, cost, ans = [0, 0, 0]
    for x in product([0, 1], repeat=n):
        value = sum(map(operator.mul, v, x))
        cost = sum(map(operator.mul, c, x))
        ans = max(ans, value - cost)

    return ans

class Test(unittest.TestCase):
    def test1(self):
        self.assertEqual(solution(3, [10, 2, 5], [6, 3, 4]), 5)

if __name__ == '__main__':

    n = int(input())
    v = list(map(int, input().split()))
    c = list(map(int, input().split()))
    print(solution(n, v, c))
    
    unittest.main()

Solution (Python):
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=[A[i]-B[i] for i in range(len(A))]
ans=0
for i in C:
  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]
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):
from itertools import product
import operator

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

value, cost, ans = [0, 0, 0]
for x in product([0, 1], repeat=n):
    value = sum(map(operator.mul, v, x))
    cost = sum(map(operator.mul, c, x))
    ans = max(ans, value - cost)

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()))
profit = 0

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

Solution (Python):
_ = input()
V = map(int, input().strip().split(' '))
C = map(int, input().strip().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()))

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

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

Solution (Python):
n = int(input())
vs = (int(i) for i in input().split())
cs = (int(i) for i in input().split())

cps = [v - c for v, c in zip(vs, cs)]
max_ = sum(cp for cp in cps if cp > 0)
print(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]:
        ans += V[i] - C[i]
print(ans)

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

sum=0
for i in range(n):
    sum+=max(0, value[i]-cost[i])
print(sum)

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

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

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

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

Solution (Python):
import sys
import math 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()

N = ni()
V = na()
C = na()

def Solve(x,cnt,c,v,res):
    if(cnt>=0 and x):
        
        c+=C[cnt]
        v+=V[cnt]
    if(cnt==N-1):
        res = max(v-c,res)
        
    else:
        res = Solve(True,cnt+1,c,v,res)
        
        res = Solve(False,cnt+1,c,v,res)
    
    return res
ans = Solve(True,-1,0,0,0)
print(ans)

Solution (Python):
N=int(input())
Vn=list(map(int,input().split()))
Cn=list(map(int,input().split()))

best = 0
for i in range(2**N):
    t = 0
    for j in range(N):
        if (i >> j) & 1:
            t += (Vn[j] - Cn[j])
    if t > best:
        best = t
print(best)

Solution (Python):

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


profits = []
for x in range(N):
    if V[x] > C[x]:
        profits.append(V[x] - C[x])
totalProfits = sum(profits)


print(totalProfits)

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

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

a = list(zip(v, c))
t = 0
for i, m in a:
  p = i - m 
  if p > 0:
    t += p

print(t)

Solution (Python):
n = int(input())
vList = list(map(int, input().split()))
cList = list(map(int, input().split()))

ans = 0
for i in range(n):
    x = vList[i]
    y = cList[i]
    if (x - y) > 0:
        ans += (x - y)

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

Solution (Python):


import sys
import copy

sys.setrecursionlimit(1000000)





N = int(input())

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

ans = 0

for bit in range(1 << N):
    sum = 0
    for i in range(N):
        if bit & (1 << i):
            sum += V[i]
            sum -= C[i]
    ans = max(ans, sum)

print(ans)

Solution (Python):


import sys
import copy

sys.setrecursionlimit(1000000)





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

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

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

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

print(c)

Solution (Python):
from sys import stdin

N = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(2)]

profit = [0] * N
sum_profit = 0

for i in range(N):
    profit[i] = int(data[0][i]) - int(data[1][i])
    if profit[i] > 0:
        sum_profit += profit[i]

print(sum_profit)

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

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

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

Solution (Python):
N = int(input())
V = [int(s) for s in input().split(" ")]
C = [int(s) for s 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 = input().split()
C = input().split()
value = int(0)
i = int(0)
for i in range(N):
    if int(V[i]) > int(C[i]):
        add = int(V[i]) - int(C[i])
        value = value + add
    i = i + 1
print(value)

Solution (Python):
N = int(input())
Vlis = list(map(int, input().split()))
Clis = list(map(int, input().split()))

res = 0

for i in range(N):
  if Vlis[i] - Clis[i] > 0:
    res += Vlis[i] - Clis[i]
    
print(res)

Solution (Python):


import sys
import math



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

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

print(ans)

Solution (Python):
from numpy import*;_,a,b=[int64(i.split())for i in open(0)];c=a-b;print(sum(c[c>0]))

Solution (Python):
n=int(input())
vl = list(map(int, input().split()))
cl = list(map(int, input().split()))
dl = []
for i in range(n):
  dl.append(vl[i] - cl[i])
  
ct = 0
for j in range(len(dl)):
  if dl[j] > 0:
    ct += dl[j]
print(ct)

Solution (Python):
N=int(input())
X=list(map(int,input().split()))
Y=list(map(int,input().split()))
S=[0]
for i in range(N):
  A=X[i]-Y[i]
  if A>0 :
    S.append(A)
print(sum(S))

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

val = 0
for v, c in zip(v_list, c_list):
  if(v>=c):
    val = val + (v-c)
   
print(val)

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

Solution (Python):
import numpy as np

N = int(input())
V = np.array([int(i) for i in (input()).split(" ")])
C = np.array([int(i) for i in (input()).split(" ")])
 
YmX = V-C

MaxYmX = np.sum(YmX[np.where(YmX > 0)])

print(MaxYmX)

Solution (Python):
n= int(input())
v_list = [int(i) for i in input().split()]
c_list = [int(i) for i in input().split()]
ans =0
for v,c in zip(v_list, c_list):
  d=v-c
  if d>0:
    ans+= d
    
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(n):
  if v[i]-c[i] > 0:
    s += v[i]-c[i]
print(s)

Solution (Python):
a = int(input())
List=list(map(int,input().split()))
List2=list(map(int,input().split()))

sum=0
i=0
while i < a:
  if List[i] - List2[i] > 0:
    sum += List[i] - List2[i]
  i +=1
print(sum)

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

print(num)

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

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

    print(ans)

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

Solution (Python):


n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res

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

Solution (Python):
import sys
N = int(sys.stdin.readline().strip())
Vs = map(int, sys.stdin.readline().strip().split())
Cs = map(int, sys.stdin.readline().strip().split())
max_value = 0
for v, c in zip(Vs, Cs):
    if v-c > 0:
        max_value += v-c
print(max_value)

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

sub_list = []
for i in range(n):
    sub_list.append(values[i]-costs[i])

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

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

Solution (Python):
a = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
s = 0
for i,j in zip(x,y):
  if i > j:s+=i-j
print(s)

Solution (Python):
N = int(input())
vv = list(map(int, input().split()))
cc = list(map(int, input().split()))
ans = 0
for i in range(N):
  ans += max(vv[i]-cc[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]:
    ans += V[i] - C[i]
print(ans)

Solution (Python):
def get_result(V, C, N):
    return sum([V[i]-C[i] for i in range(N) if V[i] >= C[i] ])

N = int(input())
V = [int(s) for s in input().split(" ")]
C = [int(s) for s in input().split(" ")]
result = get_result(V, C, N)
print(result )

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

i = 0
list = []
list2 = [] 

while i < n:
    list.append(int(v[i]) - int(c[i]))
    if list[i] > 0:
        list2.append(list[i])
    i += 1
        
print(sum(list2))