Chess coins (1)

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 difference between the total number of coins
on white squares and the total number of coins on black squares. 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 output is the total number of coins in white squares, and the total
number of coins in white squares. Follow the format of the examples.

Problem information

Author: Lluís Padró

Generation: 2026-01-25T19:41:04.232Z

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