Guest User

Untitled

a guest
Feb 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. package test.Tester;
  2. import java.util.Scanner;
  3. public class Wes {
  4. public static void main(String[] args){
  5. Scanner scan = new Scanner(System.in);
  6. int a = scan.nextInt();
  7. int d = scan.nextInt();
  8. int b = 0;
  9. int[][] c = new int[d][d];
  10. int x1,x2,y1,y2;
  11. int min=0;
  12. for(int i=0;i<a;i++){
  13. for(int j=0;j<d;j++){
  14. for(int k=0;k<d;k++){
  15. c[j][k]=scan.nextInt();
  16. }
  17. }
  18. b = scan.nextInt();
  19. for(int l=0;l<b;l++){
  20. x1=scan.nextInt()-1;
  21. y1=scan.nextInt()-1;
  22. x2=scan.nextInt()-1;
  23. y2=scan.nextInt()-1;
  24. min=c[x1][y1];
  25. for(int s=x1;s<=x2;s++){
  26. for(int p=y1;p<=y2;p++){
  27. min=(min>c[s][p])?c[s][p]:min;
  28. }
  29. }
  30. System.out.print(min);
  31. }
  32. }
  33.  
  34.  
  35. }
  36.  
  37.  
  38. }
Add Comment
Please, Sign In to add comment