~/algor $ cat problems/matritsa-diagonal-ustidagi-yigindi
Sum above the main diagonal
Easy
1000 ms
128 MB
28%
A square matrix of size $n \times n$ is given. Compute the sum of all elements above the main diagonal ($j \gt i$).
Input
The first line contains two equal positive integers $n$ and $n$. Each of the next $n$ lines contains $n$ integers.
Output
One integer — the sum of the elements above the diagonal.
Note
$1 \le n \le 200$
$-1000 \le a_{i,j} \le 1000$
Examples
Input #1
3 3 1 2 3 4 5 6 7 8 9
Output #1
11
Input #2
1 1 5
Output #2
0