Help me in solving LBJ21 problem

My issue

My code

// Update the code below to solve this problem
import java.util.Scanner;

class Codechef
{
     public static int problemsSolved(int totalScore) {
        if (totalScore < 0 || totalScore % 100 != 0) {
            return -1; // Invalid score
        }

        return totalScore / 100; // Number of problems solved
    }
public static void main (String[] args)
	{
		Scanner read = new Scanner(System.in);
		
		int t = read.nextInt(); 
		 int[] testCases = new int[t];
		for(int i=0; i<t; i++)
		{
    		int p = read.nextInt();
            testCases[i] = read.nextInt();
		}
		for ( int j = 0; j < t; j++) {
            int numProblemsSolved = problemsSolved(testCases[j]);
            System.out.println( numProblemsSolved);
        }
	}
}

Learning course: Solve Programming problems using Java
Problem Link: CodeChef: Practical coding for everyone

Can anyone fix this problem and help me out …

@sahil_2701
The logic is if (P/100 + P%100) <=10
if its true then answer would be (P/100 + P%100);
else print -1;

Can u give me the code of it because I can’t identify that what you actually give me answer…

@sahil_2701
Here is the code

// Update the code below to solve this problem
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 p = read.nextInt();
    		int sc=p/100  +  p%100;
    		if(sc<=10)
    	    System.out.println(sc);
    	    else
    	    System.out.println(-1);

		}
	}
}