You have N marbles and K slots. You have to follow the below mentioned
rules :

   1. You can put in a marble or take out a marble from slot numbered
1 at any time.
   2. You can put in a marble or take out a marble from slot numbered
i only if there exists a marble at the slot i - 1.
   3. The game stops when a marble reaches the slot numbered K for the
first time.

Your task is to finish the game in minimum number of valid moves.

for further clarification one can visit:

http://www.spoj.pl/problems/MOVMRBL/

I am not able to calculate manually the steps for some (N,K) pair
(except the cases where K is less than or equal to N*(N-1)/2).
e.g how to proceed with just 3 marbles and 10 slots...

any idea in this direction will be appreciated...

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to