How could you arrange 'N' coin in 'X' bags?

There are 'X' bags. and 'N' coins of one rupee. These 'N' coins should be arranged in into these 'X' bags in any denomination, in such a way that when you are asked to give a certain no: of coins, u should be able to give by picking few bags and tell , here it is, say for eg: if asked 60 u should be able to give 60 by picking 4 or bags, like that if asked 1 coin also u should be able to give in similar manner. How it can be arranged?

2^(x-1) <= N

x is as max as possible.

Example: 2^6 <=100

x-1=6

x=7.

Author: OmprakashShyamalan
Login to Answer
Sort By:
Oldest
|
Newest
|
Vote
|
My Answer