Can anyone please help me with this problem: MAY19F1 of contest FLPAST01

/* 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
{ int max=0;
// your code goes here
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
int a=sc.nextInt();
int q=sc.nextInt();
int ar[]=new int[a];
int qi[]=new int[q];
for(int i=0;i<a;i++)
ar[i]=sc.nextInt();
for(int j=0;j<q;j++)
qi[j]=sc.nextInt();

	for(int i=0;i<q;i++)
	{
	    int n=qi[i];
	    for(int j=0;j<n;j++)
	    { 
	        if(ar[j]>max)
	        max=ar[j];
	    }
	    System.out.println(max);
	}
	
}

}

Please either format your code or link to your submission - the forum software has mangled it and it won’t compile! :slight_smile:

yeah i will format it
link to the problem: https://www.codechef.com/FLPAST01/problems/MAY19F1/