QUESTION:-

SOLUTION:-

https://www.codechef.com/viewsolution/33546545

APPROACH:-

i took a arithmatic progression of first term = k-n and difference=1-n

then I found out the nth term which is greater than 0.

Then i took the sum of AP up to that term using sum=((first+last)*n)/2

PLZ HELP!!