Help! I do not know what's wrong with this program?

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

please, read question properly.

ex. D = 3 , N = 3 then your output is 1+2+3+…+9 which is incorrect answer,
correct output is 1+2+3+…+21
sum( sum ( sum ( 3 ) ) )
sum ( sum ( 6 ) )
sum ( 21 )

1 Like