Binary search practices from top coder website.