For this Question: You are given a chessboard of size N x N, where the top left square is black. Each square contains a value. Find the sum of the values of all black squares and all white squares. Remember that in a chessboard, black and white squares are alternate.The first line of the input contains a single integer N, the size of a row of the square matrix.
The next N lines contain N space-separated integers.

<b>Constraints</b>
1 &le; N &le; 1000
1 &le; matrix[i][j] &le; 10<sup>4</sup>Print two lines, the first line containing the sum of black squares and the second line containing the sum of white squares.<b>Sample Input</b>
3
1 2 3
4 5 6
7 8 9
<b>Sample Output</b>
25
20
<b>Explanation</b>
Black squares contain 1, 3, 5, 7, 9 i.e. sum = 25
White squares contain 2, 4, 6, 8 i.e. sum = 20, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
void alternateMatrixSum(vector<vector<int>>& mat, int n) {
    int blackSum = 0;
    int whiteSum = 0;
    for(int i=0;i<n;i++){
            for(int j=0;j<n;j++){
                    if((i+j)%2 == 0){
                            blackSum += mat[i][j];
                    }
                    else{
                            whiteSum += mat[i][j];
                    }
            }
    }
   cout<<blackSum<<endl;
   cout<<whiteSum<<endl;
}

int main() {
    int n;
    cin>>n;
    vector<vector<int>> mat(n, vector<int>(n));
    for(int i=0;i<n;++i){
        for(int j=0;j<n;++j){
            cin>>mat[i][j];
        }
    }
    alternateMatrixSum(mat,n);
    cout << endl;
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?