Help me in solving SQMA06 problem

My issue

I dont know how to spend the formula s=n\2*(2a+(n-1))

My code

# cook your dish here

Problem Link: AP Practice Coding Problem - CodeChef