Factrial problem : Maths

My code is giving TLE again and again. Pls check the error.
IDE : https://ide.codingblocks.com/s/217246

@aman_ishan Actually what we need to do is-;
prime factorise k and check for all its prime factors whose minimmum power that can divide n!.

But what is the problem with this code ? I have tried a similar approach only.

Why are you multiplying p by 1 every time? Maybe you wanted to do something else.

@aman_ishan Have a look at this and try implementing it yourself.
https://ide.codingblocks.com/s/96318?_ga=2.258825161.237064009.1587287127-1725084864.1584207395&_gac=1.187546842.1584476316.Cj0KCQjw6sHzBRCbARIsAF8FMpXxQiJWZW2eGhrSp7XVpw5vpk1XCuNVFofYOc9-0cX8jXEu9rP8WrkaAoa7EALw_wcB

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.