Sorting code throwing tle

import java.util.;
import java.lang.

/* 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
BufferedReader reader = new BufferedReader(new InputStreamReader(;
int t = Integer.parseInt(reader.readLine()); // t for #testcases
while (t-- > 0){
int n = Integer.parseInt(reader.readLine()); // n for length of array
int[] arr =" ")).mapToInt(Integer::parseInt).toArray();
// above line reading whole line as string, then converting into integer array using api
Arrays.sort(arr); // To sort the array
String st = Integer.toString(arr[0]); // st to print output as String
for (int i = 1; i < n; i++) st += " " + arr[i]; // to display space seperated output integer from the array
System.out.println(st); // printing the output

This simple sorting code throwing tle for given below problem

Any java coder please help in rectifying this problem