first of all I am sorry if the level of this question is nowhere near the usual level of questions on this site because my math knowledge is still very basic. I hope you won't mind.
I found this problem on some site:
"A basket of oranges costs 20 dollars, a basket of pears costs 30 dollars and a basket of kiwi fruits costs 40 dollars. Eight baskets of these fruits were bought for 230 dollars. What is the largest possible number of baskets of kiwi fruits that were bought?"
The answer on the site is explained by just putting values in and see if they work. However I would like to know if there is a mathematical method of solving this.
So let me make a system of equations:
$20o+30p+40k=230$
$o+p+k=8$
extra restrictions:
$o, p, k$ are natural numbers
$k$ has to be as large as possible.
Is something like this solvable mathematically without putting in values and see if they work? If yes, how?