Problem link : https://www.codechef.com/problems/GUMP

https://pastebin.com/qqhsMu6H

here is my code. I’m getting WA.But i cann’t understand why?

My logic:

the maximum ans will be x^n where

x=(s/n)

but if x%n!=0

then I increase Y x by one

where

y=s%n

now the maximum ans will be X(n−y)∗(X+1)y

Can anyone tell me why I am getting WA?Is my logic is wrong?If wrong,then why?

Can you provide a test case for which my code will give WA?

Thanks in advance