from collections import defaultdict, Counter, deque from itertools import groupby, accumulate, combinations, permutations, product, combinations_with_replacement from bisect import bisect_left, bisect_right from operator import itemgetter import math from heapq import heapify, heappush, heappop LMI=lambda:list(map(int, input().split())) LMS=lambda:list(map(str, input().split())) MI=lambda:map(int, input().split()) MS=lambda:map(str, input().split()) II=lambda:int(input()) IS=lambda:input().split() LI=lambda:list(input()) INF=10**18 N,D,K=MI() A=LMI() C=LMI() dp=[[-INF]*(K+1) for i in range(D+1)] dp[0][0]=0 for n in range(N): for d in range(D-1, -1, -1): for k in range(K, -1, -1): if dp[d][k]!=-INF: next_cost=min(K, k+C[n]) dp[d+1][next_cost]=max(dp[d+1][next_cost], dp[d][k]+A[n]) ans=dp[-1][-1] if ans==-INF: print('No') else: print(ans)