I have an interesting problem want a computer programming to solve.
Problem. Once upon a time, there were 5 robbers(A, B, C, D, E). One day, they got 100 golds and decided to carve it up. The way was very weird.
The first robber(A) gave a scheme to carve up the golds, the rest of the robbers voted to decide if they acceptd the scheme. If and only if the vote through was over half number of the rest robbers, the scheme was adopted .(i.e. there must be more than (not equal to) 2 robbers accepted the scheme)
Otherwise, the robber who raised the scheme would be killed.
After robber A was killed, it was robber(B)'s turn to give a scheme, and the rest of the robbers to vote. Like the previous case, if and only if the vote through was over half number of the rest robbers, the scheme was adopted, because there were 3 robbers to vote, so at least 2 robbers accepted the scheme would lead to the acceptance of the scheme. Otherwise, robber(B) would be killed. And it was robber©'s turn to give a scheme ... the rest may be deduced by analogy.
Suppose all the robbers were so clever to make sure they wouldn't be killed and make the most gold(s). What's scheme? Who raised the scheme?
(I have no exact answer. I think the scheme was raised by A and the scheme was
Can anyone give a computer programming to solve the problem?