Help me in solving LBJ201A problem

My issue

could not understand the logic

My code

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

// Click on 'Next' once you are ready to proceed.
import java.util.Scanner;
class CodeChef{
    public static void main(String[] args){
    Scanner read = new Scanner(;
   int  t = sc.nextInt();
    for(int i=0;i<3;i++)
    int a=sc.nextInt();
    int c=sc.nextInt();
    int b;
    if((a+c)/2 )
    b = (a+c);


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

I think the logic here is wrong… U basically need to check if both A and C are odd or even. Like A and C should be even or A and C both should be odd they cant be one odd and one even. So if they are one odd and one even u cant get the average in the form of an integer.
So for the logic u have to check if both of them are odd or if both of them are even. If the condition is satisfied then an integer B will exist as the average of A and C orelse print ‘-1’ as the output to the console.