My issue
My code
import java.util.Scanner;
class Codechef
{
public static void main (String[] args)
{
Scanner read = new Scanner(System.in);
int t = read.nextInt();
for(int i=0; i<t; i++){
int A = read.nextInt();
int C = read.nextInt();
// Use your sub-components below this line to solve the problem
int B= (A+C)/2;
if(B>0 && B%2==0){
System.out.println(B);
}
else{
System.out.println(" -1");
}
}
}
}
Learning course: Java for problem solving - 1
Problem Link: CodeChef: Practical coding for everyone