Domanda di colloquio di Veeam Software

Given an integer maxVal and another integer a, return the biggest integer b such that a^b <= maxVal.