There's a king who wants to appoint a new minister. To check the intelligence of the interested men, he gives the following problem:
There are 10 bags and there are 100 coins. You have to fill all the 100 coins into the 10 bags. You may fill any number of coins into any bag. You may keep a bag empty, but you must fill all the coins into the bags. Then you must seal the bags. Then I'll ask you to give me any number of coins and you must be able to give me that exact amount without opening any of the bags. In other words, you must hand me over several bag/s which will contain coins equal to what I have asked for.
Only one person could do it, and he was appointed minister.
How would you do it?