ACM Problem A: Binary Search Efficiency