Please help me in UNICOURS

Hey!
Thanks for such an initiative Vijju123!
I’m facing a problem in [UNICOURS][1].
I’m encountering a RE(NZEC) which I’m unable to figure out.
Here is my


[2]. 
Any help will be appreciated!
Thanks!

  [1]: https://www.codechef.com/MAY17/problems/UNICOURS/
  [2]: http://ideone.com/9EA3XS

There is some problem with your input taking.

I tried to run it against sample case, and am continuously getting error of-

Exception in thread "main" java.lang.NumberFormatException: null
	at java.lang.Integer.parseInt(Integer.java:542)
	at java.lang.Integer.parseInt(Integer.java:615)
	at unicours.main(Main.java:52)

This begins when its taking input for second value of n. An incorrect input of n will affect array and elad to runtime error.

I replaced your code by this and it doesn’t give runtime error

              public static void main(String[] args)throws Exception{
		// TODO Auto-generated method stub
		  BufferedReader z=new BufferedReader(new InputStreamReader(System.in));
		    int t=Integer.parseInt(z.readLine());
		    int n,a[];
		    int c;
		    StringTokenizer cut;
		    while(t--!=0){
		    	
		    c=0;
		    n=Integer.parseInt(z.readLine());
		    cut=new StringTokenizer(z.readLine());
		    a=new int[n];
		    int i;
		    for(i=0;i<n;i++)
		    	a[i]=Integer.parseInt(cut.nextToken());