Lower bound to count the number of elements having k - th bit in the range ( 2 ^ k - x , 2 * 2 ^ ( k ) - x )
l = lower_bound ( C , C + N , ( 1 << k ) - x ) - C ; r = lower_bound ( C , C + N , ( 1 << k ) * 2 - x ) - C ;