Given the integers through in a grid, we can rearrange those integers so that every row and column has a sum of
Suppose that, instead, starting with that same initial arrangement of through in a grid, we replace any number of the integers with to try to make every row and column have the same sum.
This problem has no solution other than the trivial solution of replacing every integer with To see why — and why for a problem like today’s challenge — keep reading. Otherwise, jump ahead to the challenge.
As arranged, the sum in the top row of the grid is To make all the rows and columns have the same sum by replacing integers with s, each row and column would need to have a sum of or less, to match that top row. Looking at the bottom row, the only way to make it have a sum of or less is by making it have a sum of Then every integer in the grid would have to be replaced with
In today’s challenge, the starting grid is filled with integers, but they aren’t through in order and some of the integers repeat. Here we’ll work through a similar example with a grid:
Given this grid, the goal is to replace any of the integers with so that the sum of every row and column is
The most challenging part can be deciding where to begin. Try to find the most restricted part of the grid where a row or column can only sum to in one or two ways. Consider the second row: the only way to make a sum of with and is So the and the need to be replaced with s:
Now we know that the and in the second row cannot be replaced with s. To make the third column with that in it sum to we must replace the and with s:
In the second column, we need each one of and to sum to So none of those get replaced with s. In particular, the bottom row must use that in its sum. Then we must also use the and in the bottom row, while the must be replaced with a Meanwhile, in the top row, one of the s must be replaced with a The in the left column we need, the in the right column we don’t need.
By replacing six of the numbers with s, we now have every row and column sum to Can you do the same with a slightly larger square and target sum?