Help with this math problem

<p>Can someone come up with an algebraic approach to solve the following problem?</p>

<p>10 cars passed a certain checkpoint. If there were 32 people in total , a no car had more than 4 people inside, what is the most number of cars that could have 2 people inside?</p>

<p>Tank you in advance.</p>

<p>Four cars.<br>
4 times 2=8, leaving 24 people and six cars. Fits perfectly</p>

<p>And as for algebraic...no need. Trial and error, you know it cant be a big number, so start mid range and go either way. Four was the second number i tried in my head.</p>

<p>Since you want the most number of cars with 2 people, you want the number of people in non-2 person cars to be as great as possible so there are more people available to be in the 2 person cars (idk if that makes sense to you...). Therefore, let x be the number of cars with 4 people, and y be the number of cars with 2 people.
Thus, you have:
4x+2y=32
x+y=10
Solve the system for y; you get y=4.</p>