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






import sys
input = sys.stdin.readline

import math
import bisect
from collections import deque
from fractions import gcd
from functools import lru_cache






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






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


def lcm(a, b):
    return a * b // gcd (a, b)


def bit_count(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count





N = inputI()
V = inputIL()
C = inputIL()

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

d.sort()
p = bisect.bisect(d,0)

print(sum(d[p:]))

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

Solution (Python):
import sys
import math
import bisect


def main():
    n = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    for i in range(n):
        A[i] -= B[i]
    ans = 0
    for a in A:
        if a > 0:
            ans += a
    print(ans)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(input())
    v = list(map(int, readline().split()))
    c = list(map(int, readline().split()))
    x = [p - q for p, q in zip(v, c)]

    ans = 0
    for elem in x:
        if elem > 0:
            ans += elem

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from operator import itemgetter
import sys
sys.setrecursionlimit(1000000)
ans=0

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

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

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


x_y = 0
for i in range(2**n):

    tmp_x_y = 0
    tmp_cost=0
    tmp_value=0

    for j in range(n):
        if (i>>j) &1:
            tmp_cost+=c[j]
            tmp_value+=v[j]

    tmp_x_y = tmp_value - tmp_cost

    x_y = max(x_y,tmp_x_y)

print(x_y)

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

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

V = list(input().split())
V = [int(V[i]) for i in range(N)]

C = list(input().split())
C = [int(C[i]) for i in range(N)]

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()))
t = []

for i in range (N):
  if V[i] - C[i] > 0:
    t.append(V[i]-C[i])
    
print(sum(t))

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    _ = 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)


if __name__ == "__main__":
    main()

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = float('inf')


n = I()
V = LI()
C = LI()
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()))

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

print(out)

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


def main():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
    ans = 0
    for i in range(1 << N):
        value = 0
        cost = 0
        for j in range(N):
            if i & (1 << j):
                value += V[j]
                cost += C[j]
        ans = max(ans, value - cost)
    print(ans)




if __name__ == "__main__":
    main()

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

print(ans)

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

ans = 0
for score in scores:
    if score > 0:
        ans += score
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 diff >= 0:
        ans += diff
print(ans)

Solution (Python):
import itertools
import math
n = int(input())
v = list(map(int, input().split()))
c = list(map(int, input().split()))
x = 0
y = 0
for i in range(n):
    if v[i] > c[i]:
        x += v[i]
        y += c[i]

print(x - y)

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

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

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

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

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

ans = 0
for i in range(N):
    diff = vs[i]-cs[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()))

res=0

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

ret=0

for i in range(N):
    if Vlist[i]-Clist[i] > 0:
        ret += Vlist[i]-Clist[i]
print(ret)

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

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

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

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

Solution (Python):


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

Solution (Python):
def resale(n, vli, cli):

    ans = 0

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

    return ans

def main():
    n = int(input())
    vli = list(map(int, input().split()))
    cli = list(map(int, input().split()))
    print(resale(n, vli, cli))

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
vl=list(map(int,input().split()))
cl=list(map(int,input().split()))
a=0
for v,c in zip(vl,cl):
  if v>c:
    a+=v-c
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):
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
h = 0
while h < n:
  if v[h] >= c[h]:
    ans += v[h] - c[h]
  h += 1
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 c[i] < v[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()))
xy = [0]*n
ans = 0
for i in range(n):
    xy[i] = v[i] - c[i]
    if xy[i] > 0:
        ans += xy[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):
    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()))
ans=0
for i in range(n):
    if V[i]>=C[i]:
        ans+=V[i]-C[i]
print(ans)

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

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

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

toku = 0
total = 0

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

Solution (Python):
import sys
import math
from collections import Counter
import itertools



def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())

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

def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SR(): return sys.stdin.readline().rstrip()

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_uppercase2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'


p2D = lambda x: print(*x, sep="\n")
p2E = lambda x: print(''.join(x))
p2S = lambda x: print(*x, sep=" ")



N=II()
V=LI()
C=LI()

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 = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().split()]

arr = [x-y for x,y in zip(v,c)]

ans = 0
for i in arr:
  if i > 0:ans+=i
    
print(ans)

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

Solution (Python):
n=int(input())
listv=list(map(int,input().split()))
listc=list(map(int,input().split()))
list=[]
for t in range(n):
  if listv[t]-listc[t]>0:
    list.append(listv[t]-listc[t])
print(sum(list))

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

value = list(map(int,input().split()))

cost = list(map(int,input().split()))

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

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

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

print(ans)

Solution (Python):

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

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

print(ans)

Solution (Python):
max = 0
a = [0]
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))
while True:
  if N == 1:
    print("0")
    break
  for i in range(N):
    if V[i] > C[i]:
      a.append(V[i]-C[i])
  for i in a:
    max += i
  print(max)
  break

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

diff = [0]
for n in range(N):
  if V[n] - C[n] > 0:
    diff.append(V[n] - C[n])

print(sum(diff))

Solution (Python):
n = int(input())
xlist = list(map(int,input().split()))
ylist = list(map(int,input().split()))

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

Solution (Python):
_ = int(input())
v_list = [int(x) for x in input().split()]
c_list = [int(x) for x in input().split()]
p_list = [v - c for v, c in zip(v_list, c_list) if v - c > 0]
print(sum(p_list))

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

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

print(ans)

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

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


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

print(maximum)

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

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

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

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

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

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

Solution (Python):
N = int(input())
vlist = list(map(int, input().split()))
clist = list(map(int, input().split()))
indi = [v - c for v, c in zip(vlist, clist)]
ans = 0
for i in indi:
    if i > 0:
        ans += i
print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
V = LIST()
C = LIST()

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

sm = list()
for a, b in zip(V, C):
    sm.append(a-b)

ans = 0

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

print(ans)

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

print(ans)

Solution (Python):

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

profits = [x - y for x, y in zip(V, C)]
print(sum([k for k in profits if k >= 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()))
xy = [x-y for (x,y) in zip(v,c)]
sm = 0
for x in xy:
    sm = sm+x if x>0 else sm+0
print(sm)

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

Solution (Python):













mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    V = readInts()
    C = readInts()
    ans = -1
    for bit in range(1 << n):
        
        cost = 0
        value = 0
        for i in range(n):
            if bit & (1 << i):
                
                cost += C[i]
                value += V[i]
        ans = max(ans,value - cost)
    print(ans)
if __name__ == '__main__':
  main()

Solution (Python):
n = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
sum = 0
for v, c in zip(value, cost):
    if 0 < v - c:
        sum += v - c
print(sum)

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

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

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

Solution (Python):
import numpy as np
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7


def main():
  N = int(readline())
  V = np.array(readline().split(), np.int64)
  C = np.array(readline().split(), np.int64)
  D = V-C
  E = np.where(D<0,0,D)
  print(E.sum())
  
  
  
  
if __name__ == '__main__':
  main()

Solution (Python):
import sys


def solve(i, x, y):
    if i == N:
        global max_ans
        max_ans = max(max_ans, x-y)
        return
    solve(i+1, x, y)
    solve(i+1, x+V[i], y+C[i])


sys.setrecursionlimit(2**20)
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
max_ans = 0
solve(0, 0, 0)
print(max_ans)

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

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

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

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

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

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

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

Solution (Python):






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


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

Solution (Python):
def dfs(now,val,cost):
    if now == n:
        return val - cost
    else:
        return max(dfs(now+1,val+v[now],cost+c[now]),dfs(now+1,val,cost))

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

print(dfs(0,0,0))

Solution (Python):
a = int(input())
value = list(map(int, input().split()[:a]))
cost = list(map(int, input().split()[:a]))
l = []
for v, c in zip(value, cost):
    if v - c > 0:
        l.append(v -c)
res = 0
for item in l:
    if item > 0:
        res += item
print(res)

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

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

print(ans)

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

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

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

print(ans)

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

for i in range(n):
    if V[i] > C[i]:
        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()))
cost=0 

for i in range(N):
    if V[i]-C[i]>0:
        cost+=(V[i]-C[i])
print(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):
n = int(input())
m = list(map(int, input().split()))
k = list(map(int, input().split()))
    
counter = 0
    
for i in range(n):
    me = m[i] - k[i]
    if me > 0:
        counter += me
    
print(counter)

Solution (Python):


N = int(input())

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

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


print(sum(ans))

Solution (Python):
def main():
    n = int(input())
    gems = [int(x) for x in input().split()]
    cost = [int(x) for x in input().split()]
    res = []
    for i in range(n):
        res.append(gems[i] - cost[i])
    soma_n = sum([x if x > 0 else 0 for x in res])
    print(soma_n)
main()

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

if X > 1:
    line = input()
    v_inputs = [int(n) for n in line.split()]

    line = input()
    numbers = [int(n) for n in line.split()]
else:
    v_inputs = [int(input())]
    numbers = [int(input())]

cost_values = [
                gem_value - gem_cost
                for gem_value, gem_cost in zip(v_inputs, numbers)]
predicted_value = 0
for cost_value in cost_values:
    if cost_value > 0:
        predicted_value += cost_value

print(predicted_value)

Solution (Python):
N = int(input())
line1 = [int(n) for n in input().split()]
line2 = [int(n) for n in input().split()]
u = []
res = 0
for i in range(N):
    u.append(line1[i]-line2[i])
for i in range(N):
    if u[i]>0:
        res += u[i]
print(res)

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

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

vs = []
vs = [int(x) for x in input().split()]
cs = [int(x) for x in input().split()]


s = 0
for i in range(len(vs)):
    if vs[i] - cs[i] > 0:
        s += vs[i] - cs[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):
  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()))

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

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

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

print(sum(new))

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

V_C = [0]*N

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

print(sum(V_C))

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 += 0 if (v[i] - c[i]) < 0 else (v[i] - c[i])

print(s)

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

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

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