Help me in solving ODDSUM problem

My issue

i dont where i get error

My code

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

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc=new Scanner(System.in);
		int t=sc.nextInt();
		while(t-->0){
		    int n=sc.nextInt();
		    int x=(n - 1) * (n - 2) + 1;
		    System.out.println(x);
		}
	}
}

Learning course: 1600 to 1800 difficulty problems
Problem Link: Odd Sum Practice Problem in 1600 to 1800 difficulty problems - CodeChef

As n can reach up to 10^9, the value (n-1) \cdot (n-2) can exceed the limit of an int. Consider using a larger data-type (such as long) for n.