Little Bob is given with n marbles. He arranges them in a sequence arbitrarily. And numbers them sequentially(1, 2, 3, .. .. ..,n or n, n - 1, n - 2, .. .. .. , 1). Once he sets such numbering, he can break the sequence into more sequences where the relative ordering should be kept intact within a sequence. Well, now comes the real assignment for him. He has to separate the odd numbered marbles from even numbered ones. To make things worse, he has been put into more constraints. He has to maitain the number of sequences less than 4. At any instance, he is allowed to move only one of the marbles from the right of a sequence to the right of another sequence(which can be empty). Can he make his way ? Surely he can :D. Then he has to do it in minimum number of moves.
Little Bob is too little to do this :( Being the world finalist of 2004, can you please help him ?