Receiving exceptions in this please help, the ans is correct and even the logic is correct
import java.util.Scanner; public class solver{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int t= sc.nextInt(); //t*=t; while(t>0){ int length= sc.nextInt(); int num= sc.nextInt(); int distanceCovered=0; while(num>0){ int d =sc.nextInt(); distanceCovered+= d; String direction= sc.next(); num--; /** if(direction =="c"){ continue; }else{ break; } */ } int machineLaps= distanceCovered / length ; System.out.println(t +":"+ machineLaps ); //System.out.println(distanceCovered); //System.out.println(machineLaps ); } } } https://code.sololearn.com/cCV60H9OEtJq/?ref=app