Chess coins (2)

Consider a square chess board with n rows and n 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 > 0, followed by n rows, each with n
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
