Problem A Solve equationAccept: 111 Submit: 229Time Limit: 1000 mSec Memory Limit : 32768 KBProblem DescriptionYou are given two positive integers A and B in Base C
For the equation:A=k*B+dWe know there always existing many non-negative pairs (k, d) that satisfy the equation above
Now in this problem, we want to maximize k
For example, A="123" and B="100", C=10
So both A and B are in Base 10
Then we have:(1) A=0*B+123(2) A=1*B+23As we want to maximize k, we finally get one solution: (1, 23)The range of C is between 2 and 16, and we use 'a', 'b', 'c', 'd', 'e', 'f' to represent 10, 11, 12, 13, 14, 15, respectively
InputThe first line of the input contains an integer T (T≤10), indicating the number of test cases
Then T cases, fo