
ZOJ Problem Set  2273
Given number n, write number from 1 to n on the blackboard, then you get a number, let's call it n1. For example, given 11, we get n1=1234567891011. Then erase in n1 the numbers in the even positions, we get a new number n2(=1357901 in the former example). Next step, erase in n2 the numbers in the odd positions, we get n3(=370 in the former example). Then do the two steps above again and again, until there is only one number on the blackboard, print it.
The input contains multiple test cases, each testcase contains only one number, n(1<=n<=99999). The input is ended by EOF.
For each test case, print one number, the number left on the blackboard when the action descripted above done.
1
1
Author: DAI, Wenbin Source: ZOJ Monthly, December 2004 