NZEC error in java

Can anyone find the error in following code

import java.util.;
import java.io.
;
class petrol{
public static void main(String arg[])
{
Scanner sc = new Scanner(System.in);
int n;
int[] i = new int[100];
int x,y,j=1;
float t,s;
n=sc.nextInt();
n = n*3;
while(j<=n)
{
i[j] = sc.nextInt();
j++;
}
j=1;
while(j<=n)
{
x=i[j];
y=i[j+1];
s=i[j+2];
if(x==0 && y==0)
{
System.out.println(0);
}
else
{
t=s/(x+y);
System.out.println(t);
}

        j=j+3;
    }
	}

}

Most probably you getting this because you have declared the size of array i 100 . I would recommend you to keep an sufficient size for example 10000+ 1 (1 for index safety) . I Hope this solves your nzec

You can’t ask this question now since the contest is still going on. link to the problem is- https://www.codechef.com/ISCC2017/problems/PATROL . Please ask this question after the contest ends.

Hey, the contest is still going on

@admin please see when users ask questions related to ongoing contests.