Please check below code:
import java.util.Scanner;
public class MysteryTemple {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
int T=input.nextInt();
int N=0;
Integer[] items;
int sum=0;
int item=0;
if(1 <= T && T <= 10 ){
for(int i=1;i<=T;i++){
N=input.nextInt();
if(1 <= N && N<= 100){
items=new Integer[N];
sum=0;
for(int j=1;j<=N;j++){
item=input.nextInt();
items[j-1]=item;
sum=sum+item;
}
System.out.println("Case #"+i+": "+(findMinRec(items,items.length,0,sum)==0?"Yes":"No"));
}else{
System.out.println("Invalid Input");
}
}
}else{
System.out.println("Invalid Input");
}
}
public static int findMinRec(Integer arr[], int i, int sumCalculated, int sumTotal)
{
// If we have reached last element. Sum of one
// subset is sumCalculated, sum of other subset is
// sumTotal-sumCalculated. Return absolute difference
// of two sums.
if (i==0)
return Math.abs((sumTotal-sumCalculated) - sumCalculated);
// For every item arr[i], we have two choices
// (1) We do not include it first set
// (2) We include it in first set
// We return minimum of two choices
return Math.min(findMinRec(arr, i-1, sumCalculated+arr[i-1], sumTotal),
findMinRec(arr, i-1, sumCalculated, sumTotal));
}
// Returns minimum possible difference between sums
// of two subsets
int findMin(Integer arr[], int n)
{
// Compute total sum of elements
int sumTotal = 0;
for (int i=0; i<n; i++)
sumTotal += arr[i];
// Compute result using recursive function
return findMinRec(arr, n, 0, sumTotal);
}
}
Note:
------------------------
while providing input paste all inputs together and put one blank line at last like below
3
5
4 3 5 5 3
4
1 2 3 4
2
1 2
.........(Blank line)

3