I am getting TLE in one test case pls help

Hi
U r using loop of k and k can be 10^9
So u will get a tle therefore try using loop of n
As n is upto 100000
So don’t have to need 10^9 swap
So think in terms of this