There was once a troop of 5 elves. The 5 elves were very dedicated on finding the magical treasure of 1000 coins. However, being elves, they were super geniuses, very greedy and they did not hesitate in taking lives of other elves. The 5 elves were named Aye, Bee, Cee, Dee and Ee, ranked from high to low respectively, from Aye to Ee. One fine day, their efforts brought results and they found 1000 coins. Now they had to split it in between them as per their ranks. The lowest ranked elf has to make the proposal. If the proposal is accepted by majority, it is agreed, or the suggesting elf is killed.

What proposal should elf Ee make ?

The elf Ee should give 997 coins to himself, 2 coins to either Elf Aye or Bee, and 1 coin to Cee.
Here, we derive the solution working backwards.
If only elf Aye and Bee are left, Aye will reject all proposals from Bee, since elves are greed and killers, as Aye gets to keep all 1000 coins.
However, if Cee was alive, and would give 1000 coins all to himself, even then Bee would agree since If he does not, Cee dies, and as we have seen, if only Aye and Bee are left, Bee will be killed. So the vote is Aye: No, Bee and Cee, yes.
Now if Dee was alive, he would propose to give 1 coin to Aye, 1 to Bee, none to Cee and 998 to himself. Aye and Bee will agree to this, because if they dont, Dee will die and Cee will get to keep all 1000 coins. Since they are greedy, and would prefer 1 coin over none, they will agree to this proposal.
However, elf Ee should give 2 coins to Aye (so he will agree as he gets 1 extra coin over the previous proposal). He will give 0 coins to Bee. He shall give 1 coin to Cee (and Cee will agree since in the previous proposal, Cee was getting nothing). He will give Dee 0 coins so D will disagree. Obviously, Ee gives himself 997 coins. The vote is 3 yes, two nos. Thus Ee will propose this.