AC 2985, use bit to find k