The supermarket has N items, numbered from 1 to N. Item i has a weight of wi and a value of vi.
You decided to go to the supermarket with a knapsack that can hold up to a weight of S. Unlike other supermarkets, this is a special one. It allows all customers to split split their food in however way they want based on weight. So if someone splits an apple of weight 5 and value 3 to an apple of weight 2 and 3, the values of the split apples will be 3/5 * 2 and 3/5 * 3 respectively.
You do not care what type of item uou take, only the value. Calculate the maximum value of items you can take with your knapsack.
Input in given in the following way