UVa 11714 - Blind Sorting

Use Base 2 logarithm (n-1)+(int)log2(n-1);

-by Tanvir Hassan (thassanauny)