chef and operations

https://www.codechef.com/viewplaintext/20976133
can i know what is wrong with my logic i think it is correct but iam getting wrong answer.
help me!!! check my solution in the link.

//