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



Sample input:
3
10 2 5
6 3 4


Sample output:
5

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num = int(input())
value = [int(s) for s in input().split()]
cost = list(map(int, input().split()))

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

Submission status: Runtime Error

Solution code:
n = int(input())
v_li = list(map(int,input().split()))
c_li = list(map(int,input().split()))
ben = []
for i in range(n):
  b = v_li[i]-c_li[i]
  ben.append(b)
ben.sort()
ben.reverse()
ans = 0
j = 0
while ben[j]>=0:
  ans+= ben[j]
  j +=1
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
v_li = list(map(int,input().split()))
c_li = list(map(int,input().split()))
ben = []
for i in range(n):
  b = v_li[i]-c_li[i]
  ben.append(b)
ben.sort()
ben.reverse()
ans = 0
j = 0
while ben[j]>0:
  ans+= ben[j]
  j +=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import heapq
N = int(input()) 
V=list(map(int,input().split())) 
C= list(map(int,input().split())) 
a=[] 
for i in range(0,N): 
  if V[i]>=C[i]: 
    heapq.heappush(a,(V[i]-C[i])) 
 　else: 
    continue 
print(sum(a))

Submission status: Runtime Error

Solution code:
N = int(input())
v = [int(x) for x in input().split()]
c = [int(x) for x in input().spplit()]
ans = [l-p for l,p in zip(v,c)]
ans1 = 0
for i in ans :
  ans1 += i if i>0 else 0
print(ans1)

Submission status: Runtime Error

Solution code:
N = int(input())
v_l = [int(input()) for i in range(N)]
c_l = [int(input()) for i in range(N)]
net = [v_l[i] - c_l[i] for i in range(N)]
max = 0
for i in range(N):
  if net[i] > 0:
    max = max + net[i]
  else:
    max = max
print(max)

Submission status: Runtime Error

Solution code:
import itertools
lv = []
lc = []
diff = []
for i in range(1,n+1):
    for p in itertools.combinations(v,i):
        lv.append(sum(p))
    for p in itertools.combinations(c,i):
        lc.append(sum(p))
for i in range(len(lv)):
    diff.append(lv[i]-lc[i])
print(0 if max(diff)<0 else max(diff))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

print(VC)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())

ans = 0

for i in range(N):
    t = 0
    p = i + 1
    while K > p:
        t += 1
        p *= 2
    ans += (0.5 ** t) / N
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
v = [int(input()) for _ in range(n)]
c = [int(input()) for _ in range(n)]
result = 0
for i in range(n):
  if v[i] > c[i]:
    result += v[i] - c[i]
print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split))
b = list(map(int,input().split))
c = 0

for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
b = []
c = 0
for _ in range(n):
  a.append(int(input()))
for _ in range(n):
  b.append(int(input()))
for i in range(0,n):
  if a[i] > b[i]:
    c = c + a[i] - b[i]
  else:
    continue
    
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

total_v = 0

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

Submission status: Runtime Error

Solution code:
n = int(input())
v = list(map(int,input()))
c = list(map(int,input()))

total_v = 0

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

Submission status: Runtime Error

Solution code:
import math
import copy

inputa = input().split()
inputb = input().split()
inputb = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# a = inputa[0]
# inputList = list(a)

# x = int(inputb[0])
# y = int(inputb[1])

# inputList=[]
# for i in range(a):
#     inputNum = input()
#     inputList.append(inputNum)

b = [int(n) for n in inputb[0]]
c = [int(n) for n in inputc[0]]

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

print(sum)

Submission status: Runtime Error

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


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

print(getsum)

Submission status: Runtime Error

Solution code:
n=int(input())
a=[int(input()) for _ range(n)]
b=[int(input()) for _ range(n)]

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

n = int(input())
v = np.array(list(map(int, input().split())))
c = np.array(list(map(int, input().split())))
p = v-c
for i in p:
    if i>0:
        ans+=i

print(ans)

Submission status: Runtime Error

Solution code:
n=input()
v=list(map(int, input().split()))
c=list(map(int, input().split()))
t=[i-j,if i-j>0 else 0 for i,j in zip(v,c)]
print(sum(t))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import nmpy as np
n=input()
v=np.array(map(int, input().split()))
c=np.array(map(int, input().split()))
t=v-c
a=0
for i in range(n)
if t[i]>0 :
a+=t[i]
print(a)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
G = [0] * N
for i in range(N):
    dif = V[i] - C[i]
    if(dif > 0):
        G[i] = dif
print(sum(G[i]))

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
v = np.array(list(map(int,input().split())))
c = np.array(list(map(int,input().split())))

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

max_profit = np.sum(profit[profit>0])
print(max_profit)

Submission status: Runtime Error

Solution code:
ef resolve():
    n = int(input())
    v = map(int,input().split())
    c = map(int,input().split())
    s = [x-y for x,y in zip(v,c) if (x-y)>0]
    ans = 0
    if s:
        ans = sum(s)
    print(ans)

if __name__ == "__main__":
    resolve()

Submission status: Runtime Error

Solution code:
n = int,input()

integer = int(0)
v = input().split()

c = input().split()

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

Submission status: Runtime Error

Solution code:
n = int,input()

integer = int(0)
v = input().split()

c = input().split()

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

Submission status: Runtime Error

Solution code:
n = int,input()
3
integer = int(0)
v = input().split()

c = input().split()
for i in range(n):
    if int(v[i])>int(c[i]):
            integer += int(v[i])-int(c[i])
            continue
    print(integer)

Submission status: Runtime Error

Solution code:
import itertools
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

M = [[V[i], C[i]]for i in range(N)]
# print(M)

com_M = list(itertools.combinations(M, 2))
m_M = []
for i in range(N):
    X = com_M[i][0][0] + com_M[i][1][0]
    Y = com_M[i][0][1] + com_M[i][1][1]
    # print(X)
    # print(Y)
    m_M.append(X - Y)

print(max(m_M))

Submission status: Runtime Error

Solution code:
import itertools
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

M = [[V[i], C[i]]for i in range(N)]
print(M)

com_M = list(itertools.combinations(M, 2))
m_M = []
for i in range(N):
    X = com_M[i][0][0] + com_M[i][1][0]
    Y = com_M[i][0][1] + com_M[i][1][1]
    #print(X)
    #print(Y)
    m_M.append(X - Y)

print(max(m_M))

Submission status: Runtime Error

Solution code:
N = int(input())
values = list(map(int,input().split()))
costs = list(map(int,input().split()))
dictionary = {}
for v in range(N):
  dictionary.setdefault(values[v], []).append(costs[v])
revarse_keys = sorted(dictionary, reverse=True, key=int)
x,y = 0,0
for i in range(N):
  if revarse_keys[i] > int(dictionary[revarse_keys[i]][0]) and (i+1)<=N:
    x = revarse_keys[i]+revarse_keys[i+1]
    y = dictionary[revarse_keys[i]][0]+dictionary[revarse_keys[i+1]][0]
    break
print(x-y)

Submission status: Runtime Error

Solution code:
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
V_sort_max = sorted(V)[-1]
C_sort_max  = sorted(C)[-1]
V_sort_second = sorted(V)[-2]
C_sort_second = sorted(C)[-2]
V_anser = V_sort_max + V_sort_second
C_anser = C_sort_max + C_sort_second
VC_anser = V_anser - C_anser
if VC_anser <= 0:
    print("0")
else:
    print(VC_anser)

Submission status: Runtime Error

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

print(sum(map(lambda p: max(0, p[0] - p[1]), zip(V, C))))

Submission status: Runtime Error

Solution code:
N = int(input())

sum = 0

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

for V_i, C_i in V, C:
  diff = V_i - C_i
  if diff >= 0:
    sum += diff

print(sum)

Submission status: Runtime Error

Solution code:
def yakusu(n):
    a = []
    while(n > 1):
        i = 2
        while(True):
            if n %  i == 0:
                n /= i
                a.append(i)
                
                break
            i += 1
            if i > 3:
                i += 1
    return a
    
def yakusu1(n, a1):
    a2 = []
    nex = 0
    for index, i in enumerate(a1[:]):
        if n % i == 0:
            a2.append(i)
            del a1[index-nex]
            nex += 1
            n /= i  

    return a1, a2
    
def yakusu2(n, a1_miss, a):
    enter = []
    nex = 0
    n1 = n
    for index, i in enumerate(a[:]):
        if n % i != 0:
            del a[index-nex]
            nex += 1
            enter.append(i)
        else:
            n /= i
    nex = 0
    for index, i in enumerate(a1_miss[:]):
        if n1 % i != 0:
            del a1_miss[index-nex]
            nex += 1
        else:
            n1 /= i
    for i in enter:
        a1_miss.append(i)
    return a1_miss, a
            
    
    

N = int(input())
A = list(map(int, input().split(' ')))
A.sort()
if A[0] == 1 and A[1] == 1:
    print(1)

elif A[0] == 1:
    del A[0]
    for index, x in enumerate(A):

        if index  == 0:
            a = yakusu(A[0])
        elif index == 1:
            a1_miss, a = yakusu1(A[1], a)
        else:
            a1_miss, a = yakusu2(A[index], a1_miss, a)
    if len(a) != 0:
        for i in a:
            value *= i
    

else:
    for index, x in enumerate(A):
        if index  == 0:
            a = yakusu(A[0])
        elif index == 1:
            a1_miss, a = yakusu1(A[1], a)
        else:
            a1_miss, a = yakusu2(A[index], a1_miss, a)
    value = 1
    if len(a) != 0:
        for i in a:
            value *= i
    if len(a1_miss) != 0:
        for i in a1_miss:
            value *= i
    print(value)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
vl = [int(input()) for _ in range(n)]
cl = [int(input()) for _ in range(n)]
ans = 0
for i in range(n):
    if vl[i] > cl[i]:
        ans += v[i]-c[i]
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
lst = []

for i in range(len(N)):
  lst.append(V[i] - C[i])
  
high_score = 0
  
for i in range(2 ** len(N)):
  a = str(bin(i)).split[2 :]
  b = map(int, a)
  score = 0
  for j in range(len(b)):
    score += lst[i] * b[j]
  if high_score < score:
    high_score = score
    
print(high_score)

Submission status: Runtime Error

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

cost = []

for i in range(N):
  X = V[i] - C[i]
  cost.append(X)
  
new_cost = sorted(cost , reverse = True)
print(new_cost[0] + new_cost[1])

Submission status: Runtime Error

Solution code:
N = int(input())
  2 V=list(map(int,input().split()))
  3 C=list(map(int,input().split()))
  4 output = 0
  5 for i in range(N):
  6     if V[i]-C[i] >= 0:
  7         output +=V[i]-C[i]
  8
  9 print(output)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys

N=int(input())
if N<1 or N>20 :
    print("error")
    sys.exit()

V=list(map(int,input().strip().split()))
C=list(map(int,input().strip().split()))
# print(V[0],V[1],V[2])                                                                              

for i in range(N):
    if C[i]<1 or C[i]>20 or V[i]<1 or v[i]>20:
        print("error")
        sys.exit()

    # try:                                                                                           
    #     inp=dic[input('[Y]es/[N]o? >> ').lower()]                                                  
    #     break                                                                                      
    # except:                                                                                        
    #     pass                                                                                       

diff=0
max_profit=0



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

print(max_profit)

Submission status: Runtime Error

Solution code:
A,B,T = map(int,input().split())

C = int((T + 1/2)//A)
ans = B*C

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
X = list(map(int, input().split())
Y = list(map(int, input().split())
ans = 0
         
for i in range(N):
         ans += max(X[i] - Y[i]), 0)

print(ans)

Submission status: Runtime Error

Solution code:
C = list(map(int, input().split()))

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

Submission status: Runtime Error

Solution code:
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[c]

print(s)

Submission status: Runtime Error

Solution code:
N = int(input()
V = [int(x) for x in input().split()]
C = [int(x) for x in input().split()]
        
print(
  sum(
    max(v - c, 0) for v, c in zip(V,C)
  )
)

Submission status: Runtime Error

Solution code:
jewel = [i for i in input().split('\n')]
value = [int(i) for i in jewel[1].split()]
cost = [int(i) for i in jewel[2].split()]
diff = [i-j for i,j in zip(value, cost)]
price = 0
for i in sorted(diff):
    if i>0:
        price += i

print(price)

Submission status: Runtime Error

Solution code:
n = int(input())
val = []
for i in map(int, input().split()):
    i.append(val)
cost = []
for i in map(int, input().split()):
    i.append(cost)

x = 0
y = 0
m1 = 0
for i in range(n):
    x += val[i]
    y += cost[i]
    m2 = x-y
    if m1 < m2:
        m1 = m2

print(m2)

Submission status: Runtime Error

Solution code:
N = int(input().split())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
P = []
for i in range(N):
    p = V[i]-C[i]
    if p >0:
    	P.append(p)

print(sum(P))

Submission status: Runtime Error

Solution code:
n=input()
def ina():
  return map(int,raw_input().split())
a=ina()
b=ina()
c=0
for i in range(n):
  if a[i]>b[i]
  	c+=a[i]-b[i]
print c

Submission status: Runtime Error

Solution code:
n = int(input())
values = [int(i) for i in input().split()]
costs = [int(i) for i in input().split()]
result = 0

for i in range(n):
    if values[i] > costs[i]:
	result += values[i] - costs[i]

print(result)

Submission status: Runtime Error

Solution code:
def sub():
    N, Vs, Cs = [e for e in input().split(" ")]
    N = int(N)
    Vs = [int(e) for e in Vs.split(" ")]
    Cs = [int(e) for e in Cs.split(" ")]
    ds = [v - c for v, c in zip(Vs, Cs)]
    ds = [d for d in ds if d > 0]
    print(sum(ds))


sub()

Submission status: Runtime Error

Solution code:
N=int(input())
Vs=str(input())
Cs=str(input())
ListV=Vs.split()
ListC=Cs.split()
for i in range(0,len(ListV),1):
  a=ListV.pop(0)
  ListV.insert(0,int(a))

for i in range(0,len(ListC),1):
  b=ListC.pop(0)
  ListC.insert(0,int(b))

ListI=[]
for i in range(0,len(ListV),1):
  c=ListV[i]-ListC[i]
  ListI.append(c)

Ans=0
for i in range(0,len(ListI),1):
  if ListI[i]>0:
    Ans+=ListI[i]

print(Ans)

Submission status: Runtime Error

Solution code:
N=int(input())
Vs=str(input())
Cs=str(input())
ListV=Vs.split()
ListC=Cs.split()
for i in range(0,len(ListV),1):
  a=ListV.pop(0)
  ListV.insert(0,int(a))

for i in range(0,len(ListC),1):
  b=ListC.pop(0)
  ListC.insert(0,int(b))

ListI=[]
for i in range(0,len(ListV),1):
  c=ListV[i]-ListC[i]
  ListI.append(0)

Ans=0
for i in range(0,len(ListI),1):
  if ListI[i]>0:
    Ans+=ListI[i]

print(Ans)

Submission status: Runtime Error

Solution code:
from typing import List

def problem():
    N = int(input())
    V = list(map(int, input().split()))
    C = list(map(int, input().split()))
 
    print(algorithm(N, V, C))
 
 
def algorithm(N: int, V: List[int], C: List[int]):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))
 
    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum
 
problem()

Submission status: Runtime Error

Solution code:

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

    print(algorithm(N, V, C))


def algorithm(N: int, V: List[int], C: List[int]):
    indices = list(filter(lambda i: V[i] - C[i] > 0, list(range(0, N))))

    sum = 0
    for i in indices:
        sum += V[i] - C[i]
    return sum
 
problem()

Submission status: Runtime Error

Solution code:
V = []
C = []
N = 0
 
i = 0
ans = 0

str = input()
N = int(str)
 
str = input().split()
while i < N:
  V[i] = int(str[i])
  i = i+1
  
i=0
str = 0
str = input().split()
while i < N:
  C[i] = int(str[i])
 
while i<N:
  if V[i] > C[i]:
    ans = ans + V[i] - C[i]
    
    
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
values = [ int(x) for x in range(n) ]
cost = [ int(x) for x in range(n) ]
profit_list = [ value[i] - cost[i] for i in range(n) if value[i] > cost[i] ]
print(sum(profit_list))

Submission status: Runtime Error

Solution code:
N = input()
N = (int)N
i=0
V = []
C = []
num = 0
while i<N:
  num = input()
  num = (int)num
  V.append(num)
 
num = 0
i=0
while i<N:
  num = input()
  num = (int)num
  C.append(num)
max = 0
while i<N:
  max = max + V[i] - C[i]
  
print(max)

Submission status: Runtime Error

Solution code:
N = input()
N = (int)N
i=0
V = []
C = []
num = 0
while i<N:
  num = input()
  V.append((int)num)
 
num = 0
i=0
while i<N:
  num = input()
  C.append((int)num)
max = 0
while i<N:
  max += V[i] - C[i]
  
print(max)

Submission status: Runtime Error

Solution code:
N=int(input().split())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
def rescale(V,C):
  price=0
  for v,c in zip(V,C):
    if v>c:
      price=price+v-c
  return price 
print("{}".format(rescale(V,C)))

Submission status: Runtime Error

Solution code:
N = input()
N = (int)N
i=0
V = []
C = []
num = 0
while i<N:
  num = input()
  V.append((int)num)

num = 0
i=0
while i<N:
  num = input()
  C.append((int)num)
max = 0
while i<N:
  max += v[i] - C[i]
  
print(max)

Submission status: Runtime Error

Solution code:
N = input();
i=0
V = []
C = []
var = 0
while i<(int)N:
  var = (int)input()
  if var <=50 and var >= 0:
    V.append(var)
i = 0

while i<(int)N:
  var = (int)input()
  if var <= 50 and var >= 0:
    C.append(var)

i = 0
max = 0
while i < N:
  if V[i] - C[i] > 0:
    max = max + V[i] - C[i]

print(max)

Submission status: Runtime Error

Solution code:
list_v = []
list_c = []

N = int(input("宝石の個数:"))

for i in range(N):
    v = int(input("{}番目の宝石の数: ".format(i+1)))
    list_v.append(v)

for i in range(N):
    c= int(input("{}番目の宝石の数: ".format(i+1)))
    list_c.append(c)

result = 0

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

print(result)

Submission status: Runtime Error

Solution code:
n = input()
v = input()
v = v.split()
c = input()
c = c.split()

VSubC = []

for index in range(n):
  heapq.heappush(VSubC, -(v[index] - c[index]))

answer = 0
while(len(VSubC) > 0):
  item = heapq.heappop(VSubC)
  if (item < 0):
    answer -= item
  else:
    break

print(answer)

Submission status: Runtime Error

Solution code:
x = 0
y= 0
n = input()
v = list(map(int, input().split()))
c = list(map(int, input().split()))
for vv,cc in v,c:
    if cc < vv:
        x+=vv
        y+=cc
print(x-y)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a = int(input())
b = [map(int,input().split()) for i in range(a) ]
c = [map(int,input().split()) for j in range(a) ]
e = 0
for k in range(a):
    d = b[k] - c[k]
    if d > 0:
        e += d
print(e)

Submission status: Runtime Error

Solution code:
Number = int(input())
tresure_value = list(map(int , input().split()))
cost = list(map(int , input().split()))
cnt = 0
 
for i in range(len(tresure_value)):
  benefit = tresure_value[i] - cost[i]
  if benefit  > 0:
    count = count + benefit 
    
print(cnt)

Submission status: Runtime Error

Solution code:
Number = int(input())
tresure_value = list(map(int , input().split()))
cost = list(map(int , input().split()))
 
count = 0
 
for i in range(Number):
  benefit = tresure_value(i) - cost(i)
  if benefit  > 0:
    count = count + benefit 
    
print(count)

Submission status: Runtime Error

Solution code:
Number = input()
 
tresure_value = list(map(int , input().split()))
 
cost = list(map(int , input().split()))
 
count = 0
 
for i in range(Number):
  benefit = tresure_value(i) - cost(i)
  if benefit  > 0:
    count = count + benefit 
    
print(count)

Submission status: Runtime Error

Solution code:
Number = input()
 
tresure_value = list(map(int , input().split()))
 
cost = list(map(int , input().split()))
 
count = 0
 
for i in range(Number):
  benefit = int(tresure_value[i]) - int(cost[i])
  if benefit  > 0:
    count += benefit 
    
print(count)

Submission status: Runtime Error

Solution code:
Number = input()
 
tresure_value = list(map(int , input().split()))
 
cost = list(map(int , input().split()))
 
count = 0
 
for i in range(Number):
  benefit = int(tresure_value[i] - cost[i])
  if benefit  > 0:
    count += benefit 
    
print(count)

Submission status: Runtime Error

Solution code:
Number = input()

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

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

count = 0

for i in range(Number):
  if tresure_value[i] - cost[i] > 0:
    count += tresure_value[i] - cost[i]
    
print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

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

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

print(gain)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = input()
V = list(map(int,input(),split()))
C = list(map(int,input(),split()))
for i in range(N+1):
  val= []
  a = V[i] - C[i]
  val.append(a)
val_int = [b for b in val if b > 0]
print(sum(val_int))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))

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

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input()))
C = list(map(int, input()))

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

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
V_array = [int(input()) for _ in range(N)]
ans = [max(0, V_i - int(input())) for V_i in V_array]

Submission status: Runtime Error

Solution code:
N = int(input())
V = map(int,input().split(" "))
C = map(int,input().split(" "))
P = []

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

result = list(filter(lambda x:x>=1,P))
print(sum(result))

Submission status: Runtime Error

Solution code:
N = raw_input()
V = raw_input()
C = raw_input()

Va = V.split(" ")
Ca = C.split(" ")

Va = map(lambda x: int(x), Va)
Ca = map(lambda x: int(x), Ca)


X = 0
Y = 0
for v, c in zip(Va, Ca):
  if v > c:
    X += v
    Y += c

print(X - Y)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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]:
    x += v[i]
    y += c[i]
print(x-y)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
list_v = list(map(int, input.split()))
list_c = list(map(int, input.split()))

max_value = 0

for i in range(n):
    if list_v[i]>list_c[i]:
        max_value = max_value + (list_v[i]-list_c[i])
        
print(max_value)

Submission status: Runtime Error

Solution code:
n = int(input())

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

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

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())

k=0

for i in range(n):
  v,c=map(int, input().split())
  m=v-c
  if m>0:
    k+=m
    
print(k)

Submission status: Runtime Error

Solution code:
n=int(input())

k=0

for i in range(n):
  v,c=map(int, input().split())
  m=v-c
  if m>0:
    k=+m
    
print(k)