How to separate wine?
One person went out for a dozen drinks at night and met a friend on his way home. It happened that this friend was also going to have a drink.
However, there is no excess wine in the restaurant, and at this time, the sky is dark, and other wine companies have been beaten up, friends look
Very worried. So the man decided to give his wine half to him, but his friend had only one and three.
Neither of them has a name. How can we evenly split the wine?
Analysis:
From 10, 7, 3 to get two 5, how can we get it?
5 = 3 + 2
5 = 4 + 1
Because there is a 3-pound bottle.
Check whether 2nd bottles (7 kg) can contain 7 kg of wine, and the third bottle contains 1 kg of wine. 7 kg wine is very good, the third bottle of 1 kg wine can be achieved.
Because 7-2*3 can be equal to 1 or implemented.
Solution:
10 7 3 bottles
10 0 0
3 7 0
3 4 3
6 4 0
6 1 3
9 1 0
9 0 1
2 7 1
2 5 3
5 5 0