Help me in solving MXEVNSUB problem

My issue

My code

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner re=new Scanner(System.in);
		int t=re.nextInt();
		for(int i=0;i<t;i++)
		{
		    int u =re.nextInt();
		    int sum=(u*(u+1))/2;
		    
		    if(sum%2==0)
		    {
		        System.out.println(u);
		    }
		    else
		    {
		        if(u%2==0){
		        u=u-2;
		        System.out.println(u);}
		        else {
		            u=u-1;
		        System.out.println(u);}
		    }
		    
		}
		   
	}
}

Problem Link: CodeChef: Practical coding for everyone