Fill in the grid with the numbers $1$ to $6$ so that each number appears exactly once in each row and column. A horizontal gray line marks any cell when it is the middle cell of the three consecutive cells with the largest sum in that row. Similarly, a vertical gray line marks any cell when it is the middle of the three consecutive cells with the largest sum in that column. If there is a tie, multiple lines are drawn in the row or column. A cell can have both lines drawn, with the appearance of a plus sign.
For example, if a filled row had $1 5 4 2 3 6$, horizontal lines would be drawn in the two cells with $4$ and $3$, since out of $1 + 5 + 4, 5 + 4 + 2, 4 + 2 + 3,$ and $2 + 3 + 6,$ the largest sums are $5 + 4 + 2$ and $2 + 3 + 6$.
This contest puzzle is from: https://files.usamts.org/Problems_35_3.pdf
This contest’s submission deadline has passed.