Жишээ тэстүүд

Оролт
3
1 2 3
4 5 6
7 8 9
Гаралт
45
Оролт
5
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
Гаралт
17

Тэмдэглэл

In the first sample all matrix elements will be good. Good elements in the second sample are shown on the figure.