


The first line contains three integers 'N', 'M', and 'X', separated by a single space. Where 'N' represents the total number of stones, 'M' represents the total number of colour stones, and 'X' represents the total weight of the knapsack.
The second line contains 'N' integers, W[1], W[2], W[3] ..W[i]… W[N], separated by a single space.
The third line contains 'N' integers C[1], C[2], C[3] ..C[i]… C[N], separated by single space.
The output prints the minimum unused capacity of the Knapsack(a single integer). If there is no way to fill the Knapsack, print -1.
1 <= M <= N <= 100
1 <= X <= 10000
1 <= W[i] <= 100
1 <= C[i] <= M
Time Limit: 1 sec
current weight + weight of this stone <= Xand call the recursive function with the next color (as we can use only one stone of color), and new weight as current weight + weight of this stone.
4. Initialize answer with a minimum value of integer and update the answer with maximum from the recursive calls.
5. In the main function, return -1 if the helper function answer is less than 0, otherwise return (x - helperAnswer).
current weight + weight of this stone <= Xand call the recursive function with the next color (as we can use only one stone of color), and new weight as current weight + weight of this stone.
5. Initialize answer with a minimum value of integer and update the answer with maximum from the recursive calls.
6. In the main function, return -1 if the helper function answer is less than 0, otherwise return (x - helperAnswer).