\documentclass[11pt]{scrartcl}
\usepackage{evan}
\begin{document}
\title{Cono Sur 2020/6}
\subtitle{Evan Chen}
\author{Twitch Solves ISL}
\date{Episode 42}
\maketitle
\section*{Problem}
A $4 \times 4$ square board is called \emph{brasuca} if it follows all the conditions:
\begin{itemize}
\ii each box contains one of the numbers $0, 1, 2, 3, 4$ or $5$;
\ii the sum of the numbers in each row is $5$;
\ii the sum of the numbers in each column is $5$;
\ii the sum of the numbers on each diagonal of four squares is $5$;
\ii the number written in the upper left box of the board
is less than or equal to the other numbers the board;
\ii when dividing the board into four $2 \times 2$ squares,
in each of them the sum of the four numbers and $5$.
\end{itemize}
How many brasucas boards are there?
\section*{Video}
\href{https://www.youtube.com/watch?v=iQkSQ97KWCA&list=PLi6h8GM1FA6yHh4gDk_ZYezmncU1EJUmZ}{\texttt{https://youtu.be/iQkSQ97KWCA}}
\section*{External Link}
\url{https://aops.com/community/p19282185}
\newpage
\section*{Solution}
Let $S = 5$.
Let's first consider the case where the upper-left number is $0$.
Then there is a bijection between ordered $6$-tuples
of nonnegative integers $(a,b,c,d,x,y)$ with sum $S$,
and brasuca boards, given as follows:
\[
\begin{array}{cc|cc}
0 & a+b & c+x & d+y \\
c+d & x+y & {\color{red}a} & {\color{red}b} \\ \hline
a+y & {\color{red}c} & b+d & {\color{red}x} \\
b+x & {\color{red}d} & {\color{red}y} & a+c
\end{array}
\]
Indeed, the six numbers written can be checked to uniquely determine the board;
conversely, the board is obviously valid.
Hence, the number of boards with $0$ in the upper-left hand
corner is exactly $\binom{S+5}{5} = 252$ by sticks-and-stones.
For the case where the upper-left number is $1$ is the same,
one subtracts $1$ from every number on the board
to arrive at the same problem with $S = 1$ instead.
The answer then is $\binom{S+5}{5} = 6$.
Hence the final answer is $258$.
\begin{remark*}
In general, if $5$ is replaced by a target $T$,
the answer would simply be
\[ \binom{T+5}{5} + \binom{T+1}{5} + \binom{T-3}{5} + \dotsb. \]
\end{remark*}
\end{document}