#C12716. Triangular Matrix Sums
Triangular Matrix Sums
Triangular Matrix Sums
Given an \( n \times n \) matrix, compute the sum of its upper and lower triangular parts. The upper triangular part is defined as the sum of all elements \(a_{ij}\) where \(i \leq j\) (including the diagonal), and the lower triangular part is the sum of all elements where \(i \geq j\) (also including the diagonal). Your task is to compute both sums and output them.
Note: The matrix is square, and the input is given through standard input.
inputFormat
The first line contains a single integer \( n \), the size of the square matrix. The next \( n \) lines each contain \( n \) space-separated integers representing the elements of the matrix.
outputFormat
Print two integers separated by a space: the sum of the upper triangular part and the sum of the lower triangular part of the matrix.
## sample3
1 2 3
4 5 6
7 8 9
26 34