What about case where A=0? In that case, X can be larger than B. This corner case is not covered in solution.
A is positive number. Its given in the problem statement