Problem No: lightoj1107
Category: Easy
import java.util.*;
public class lightoj1107 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int test=in.nextInt();
int c=0;
while(test-->0){
int x1=in.nextInt(),y1=in.nextInt(),x2=in.nextInt(),y2=in.nextInt();
int num=in.nextInt();
System.out.println("Case "+(++c)+":");
for(int i=0;i<num;i++){
int x=in.nextInt(),y=in.nextInt();
if(x>=x1 && x<=x2 && y>=y1 && y<=y2){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
}
}
}
Category: Easy
import java.util.*;
public class lightoj1107 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int test=in.nextInt();
int c=0;
while(test-->0){
int x1=in.nextInt(),y1=in.nextInt(),x2=in.nextInt(),y2=in.nextInt();
int num=in.nextInt();
System.out.println("Case "+(++c)+":");
for(int i=0;i<num;i++){
int x=in.nextInt(),y=in.nextInt();
if(x>=x1 && x<=x2 && y>=y1 && y<=y2){
System.out.println("Yes");
}else{
System.out.println("No");
}
}
}
}
}
No comments:
Post a Comment