Help me in solving LB01B problem

My issue

The concept was unclear to me

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

@alii11
The logic is if both A and C are even or both are odd then the answer would be (A+C)/2;
else the answer would be -1;