I want to work out the max value of items that can be placed in a bag under a weight constraint C. I have the values and weights of the items stored in two arrays and i want to make another array which will hold 0 or 1 corresponding to whether the item is included or not (call it A[n]). How can I get A[n] to increase like a binary counter so that it checks every possible combination of items??