CENS20G Code Ensemble Question

/* 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
{
// your code goes here
Scanner scan=new Scanner(System.in);
int t=scan.nextInt();
scan.nextLine();
for(int i=0;i<t;i++){
String s=scan.nextLine();
int R=0;
int L=0;
int U=0;
int D=0;
for(int h=0;h<s.length();h++){
if(s.charAt(h)==‘R’){
R+=1;
}else if(s.charAt(h)==‘L’){
L+=1;
}else if(s.charAt(h)==‘U’){
U+=1;
}else if(s.charAt(h)==‘D’){
D+=1;
}
}
int x=scan.nextInt();
int y=scan.nextInt();
int n=scan.nextInt();
for(int j=0;j<n;j++){
int a=scan.nextInt();
int b=scan.nextInt();
int z=a-x;
int u=(b-y);
if((z<=R || z<=-L)&& (u<=U && u<=-D)){
System.out.println(“NO”);
}else{

		int p=Math.abs(z);
        int q=Math.abs(u);
        int w=p+q;
        System.out.println("YES"+" "+w);
    }
	    }
	    
	}
}

}
Why this code is shoeing run time exception?
Question belongs to Code Ensemble