I’m getting WA on SPOJ.
Here’s the problem: http://www.spoj.com/problems/BSEARCH1/
Here’s the code: http://ideone.com/0CSrEj
(it includes optimization)
I need a test case that will help to find a mistake. I’ve tried several cases and can’t find mistakes.