#C5933. Matrix Diagonal Sum

    ID: 49637 Type: Default 1000ms 256MiB

Matrix Diagonal Sum

Matrix Diagonal Sum

You are given a square matrix \(A\) of size \(n\times n\). Your task is to calculate the sum of the main diagonal and the sum of the secondary diagonal. The main diagonal consists of elements \(A_{i,i}\) for \(1 \leq i \leq n\), and the secondary diagonal consists of elements \(A_{i, n+1-i}\) for \(1 \leq i \leq n\).

Input Format: The first line contains an integer \(n\) representing the size of the matrix. The next \(n\) lines contain \(n\) space-separated integers each, representing the rows of the matrix.

Output Format: Output two integers separated by a space: the sum of the main diagonal and the sum of the secondary diagonal.

Example:

Input:
3
1 2 3
4 5 6
7 8 9

Output: 15 15

</p>

The sums are computed as follows: \(1+5+9 = 15\) for the main diagonal and \(3+5+7 = 15\) for the secondary diagonal.

inputFormat

The first line contains an integer \(n\) denoting the dimension of the matrix. This is followed by \(n\) lines, each containing \(n\) space-separated integers representing the matrix.

outputFormat

Output two integers separated by a space: the sum of the main diagonal and the sum of the secondary diagonal of the matrix.

## sample
3
1 2 3
4 5 6
7 8 9
15 15

</p>