Chess coins (2)

Consider a square chess board with nn rows and nn columns, where every square contains a number of coins. Write a program such that, given a chess board, computes the total number of coins on the diagonals. The first square in the board (top left) is always white.

Input

The input is a natural number n>0n>0, followed by nn rows, each with nn non-negative integers, separated by whitespaces.

Output

The ouput is the total number of coins in the board diagonals.

Problem information

Author: Lluís Padró

Generation: 2026-01-25T17:05:11.658Z

© Jutge.org, 2006–2026.
https://jutge.org