Help me in solving LBJ201C problem

My issue

My code

import java.util.Scanner;
public class avg{
    public static void main(String args[]){
        int t = new Scanner(System.in);
        int A = t.nextInt();
        int C = t.nextInt();
        if(A%2 == 0 && B%2 == 0 || A%2 !=0 && B%2 == 0){
            int B = A+C/2;
            System.out.println(B);
        }else{
            System.out.println("-1");
        }
    }
}

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