For this Question: Given a N x M integer matrix A and Q queries of form X1 Y1 X2 Y2. Print the sum of A[i][j], for X1 <= i <= X2 and Y1 <= j <= Y2.The first line contains two integer N and M, denoting the size of the matrix.
Next N line contains M integers denoting elements of the matrix.
Next line contains a single integer Q, denoting the number of queries.
Next Q lines lines four integers X1 Y1 X2 Y2, denoting the query as mentioned in problem statement

1 <= N, M <= 100
1 <= A[i][j] <= 100
1 <= Q <= 100000
1 <= X1 <= X2 <= N
1 <= Y1 <= Y2 <= MPrint Q lines containing the answer to each query.Sample Input:
2 2
1 5 
2 3 
3
1 1 1 1
1 1 1 2
1 1 2 2

Sample Output:
1
6
11

Explanation:
Q1: 1
Q2: 1 + 5 = 6
Q3: 1 + 5 + 2 + 3 = 11, I have written this Solution Code: import java.io.*;   // for handling input/output
import java.util.*; // contains Collections framework

// don't change the name of this class
// you can add inner classes if needed
class Main {
   public
    static void main(String[] args) {
        
        

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        int[][] a = new int[n + 1][m + 1];

        for (int i = 0; i <= n; i++) {
            for (int j = 0; j <= m; j++) {
                a[i][j] = 0;
            }
        }

        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= m; j++) {
                a[i][j] = sc.nextInt();
                a[i][j] += a[i - 1][j] + a[i][j - 1] - a[i - 1][j - 1];
            }
        }

        int q = sc.nextInt();

        while (q-- > 0) {
            int x1 = sc.nextInt();
            int y1 = sc.nextInt();
            int x2 = sc.nextInt();
            int y2 = sc.nextInt();
            int sum = 0;

            sum = a[x2][y2] - a[x1 - 1][y2] - a[x2][y1 - 1] + a[x1 - 1][y1 - 1];

            System.out.println(sum);
        }
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?