How to use fast input and out put in my code

here is my code for Biladerim Icin
and my code still show TLE for two case please help :https://www.codechef.com/viewsolution/26695047
please help me to use fast input and output in it please help with TLE::sweat_smile::sweat_smile::sweat_smile::sweat_smile:

Simply uncomment it :laughing:

But i think to remove TLE you would need more than Fast IO

Try to optimize it, remove unnecessary operations of mod etc