Solution for Codility demoCG2C3G-AZD

Fun problem.  Took me too long (90 minutes).

The binary search can fail on huge problems due to recursion overflowing the stack.
Will make it iterative.