Problem with following sample test case


#1

Following Case the answer is 5203 but the test case has 5057.
A : [ 359, 963, 465, 706, 146, 282, 828, 962, 492 ]
B : [ 96, 43, 28, 37, 92, 5, 3, 54, 93 ]
C : 383


#2

You must have missed check for B[i]+Weight <= C before adding A[i] to profit.