First, solve the problem. Then, write the code. ” - John Johnson

It's not at all important to get it right the first time. It's vitally important to get it right the last time. ” - Andrew Hunt and David Thomas

Tuesday, March 17, 2015

LightOj

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");
}
}
}
}
}

No comments:

Post a Comment