Problem Says wrong answer

Problem:-> https://www.codechef.com/problems/DGTMAGIC

Solution:-> https://www.codechef.com/viewsolution/37148601

Logic-> I am newbie here so just trying now. Although my logic seems correct by floor(b*log n (a))+1. But seem to give wrong answer why?

One thing I would say is that shift FAST I/O lines to the start before taking any input.
Refer this

1 Like