Help me in solving LBCV201A problem

My issue

My code

//Step 1: Read and understand the problem statement and sample test cases

// Click on 'Next' once you are ready to proceed.

Learning course: C++ for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone

For finding mean of A and C you need to add both A and C and divide it by 2.
If the answer is an integer print the answer otherwise if it is an decimal print -1.