Back to the Problem
Standard repeated division by K, collecting remainders; map 10–15 to A–F.
Complexity: O(logK N)