Explanation:
When you divide by 5, the possible remainders are one of these numbers {0,1,2,3,4}. So it's the set of whole numbers from 0 to one less than 5.
This means the largest value of A is A = 4.
Similarly, the largest value of B is B = 8 because the possible remainders when dividing by 9 are {0,1,2,3,4,5,6,7,8}.
Therefore, the largest possible value of A+B is 4+8 = 12.