Only 1 test case is passing

https://www.codechef.com/ide …
This is the code, kindly tell the improvement

@igarg145 can’t see your code there!
save it here ide.codingblocks.com

Okay saved it! Kindly check

Rectify these:

  1. Don’t use pow() function as overflow can occur (think if mid = 10^6 and k=100)
    instead multiply using loop and check if overflow can occur!
  2. don’t have to use double (long long is good), still floor(ans) is to be used (say ans is 4.3 then print 4 and not 5!)

How do you the access the saved code on this ide? I can not see my previously saved code?

I solved the question though, with the loop instead of pow(). Thanks!

I saw your submissions for the problem