Help me in solving AOJ08 problem

My issue

how i can sort the array in even and odd array

My code

import java.util.*;

class Codechef
	public static void main (String[] args)
		Scanner read = new Scanner(;
		int t = read.nextInt();
		int ele;
		for(int i=0; i<t; i++)
    		int n = 10;
    		ArrayList<Integer> a = new ArrayList<Integer>();
    		for(int j=0; j<n; j++){
    		    ele = read.nextInt();


Learning course: Beginner DSA in Java
Problem Link: CodeChef: Practical coding for everyone

just iterate through the array and if the index is odd then add score to the player one or else add score to the player two.
Then compare their score and then print the result.