4th test case giving tle

hello @goelsparsh277

image

here k can be upto 10^9 .
so add one more condition ie n>0