There are two types of apples. One's 120 gr and the other one is 200gr. I need to buy 1000 gr of apples. How many apples I can buy at most?
I need the algebra on this one, I tried
$120x + 200y = 1000$ but don't know what to do from that point.
Could you please help me out?
Buy 5 of the first type and 2 of the second type for a total of 7. This is optimal since we can't buy any more than 5 of the first type and still end up with exactly a kilogram, and if we buy any fewer than 5 of the first type we will end up with fewer than 7 apples. I'm sorry but I don't know a general way to solve this type of problem without enumerating all of the partitions. The linear equation is correct but it needs to be solved in such a way that $x+y$ is maximized and also constrained to integers.