Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test.Tester;
- import java.util.Scanner;
- public class Wes {
- public static void main(String[] args){
- Scanner scan = new Scanner(System.in);
- int a = scan.nextInt();
- int d = scan.nextInt();
- int b = 0;
- int[][] c = new int[d][d];
- int x1,x2,y1,y2;
- int min=0;
- for(int i=0;i<a;i++){
- for(int j=0;j<d;j++){
- for(int k=0;k<d;k++){
- c[j][k]=scan.nextInt();
- }
- }
- b = scan.nextInt();
- for(int l=0;l<b;l++){
- x1=scan.nextInt()-1;
- y1=scan.nextInt()-1;
- x2=scan.nextInt()-1;
- y2=scan.nextInt()-1;
- min=c[x1][y1];
- for(int s=x1;s<=x2;s++){
- for(int p=y1;p<=y2;p++){
- min=(min>c[s][p])?c[s][p]:min;
- }
- }
- System.out.print(min);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment