UVa 11714 - Blind Sorting

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