9. Tessa the hyper-ant has a 2019-dimensional hypercube. For a real number $k$, she calls a placement of nonzero real numbers on the $2^{2019}$ vertices of the hypercube $k$-harmonic if for any vertex, the sum of all 2019 numbers that are edge-adjacent to this vertex is equal to $k$ times the number on this vertex. Let $S$ be the set of all possible values of $k$ such that there exists a $k$-harmonic placement. Find $\sum_{k \in S}|k|$.
Answer: 2040200
By adding up all the equations on each vertex, we get $2019 S=k S$ where $S$ is the sum of all entries, so $k=2019$ unless $S=0$. In the latter case, by adding up all the equations on a half of the cube, we get $2018 S-S=k S$ where $S$ is the sum of all entries on that half of the cube, so $k=2017$ unless $S=0$. In the latter case (the sum of all entries of any half is zero), by adding up all the equations on a half of the half-cube, we get $2017 S-2 S=k S$, so $k=2015$ unless $S=0$. We continue this chain of casework until we get that the sum of every two vertices connected by unit segments is zero, in which case we have $k=-2019$. This means that $k$ can take any odd value between -2019 and 2019 inclusive, so the sum of absolute values is $2 \cdot 1010^{2}=2040200$.
To achieve these values, suppose that the vertices of the hypercube are $\{0,1\}^{2019}$ and that the label of $\left(x_{1}, x_{2}, \ldots, x_{2019}\right)$ is $a_{1}^{x_{1}} a_{2}^{x_{2}} \ldots a_{2019}^{x_{2019}}$ for constants $a_{1}, a_{2}, \ldots, a_{2019} \in\{-1,1\}$, then it is not difficult to see that this labeling is $\left(a_{1}+a_{2}+\cdots+a_{2019}\right)$-harmonic for any choice of $a_{i}$ 's, so this can achieve all odd values between -2019 and 2019 inclusive.