Time limit 1000/4000/4000/4000 ms. Memory limit 32000/65000/65000/65000 Kb.
Problem description
Calculate sum of diagonal and by-diagonal (sideline) elements in square matrix.
Input
Line 1: A single integer N (1 < N ≤ 10);
Line 2..N+1: N positive integers on each line not bigger than 100 elements of matrix.
Output
Write sum of diagonal and by-diagonal elements.
Example
| stdin |
stdout |
3
1 2 3
2 2 2
3 2 1
|
10 |
Для отправки решений необходимо выполнить вход.
|