~mcf/adventofcode

35f3898fef64df21020642826ec971c5e1453f6a — Michael Forney 11 months ago d2f03c5
Wording
2 files changed, 1 insertions(+), 1 deletions(-)

M 2023/11.pdf
M 2023/11.tex
M 2023/11.pdf => 2023/11.pdf +0 -0
M 2023/11.tex => 2023/11.tex +1 -1
@@ 9,7 9,7 @@

\maketitle

Given the number of galaxies $n$, expansion scale $k$, sorted $x$ coordinates $x_1$, ..., $x_n$, and sorted $y$ coordinates $y_1$, ..., $y_n$, the sum of the distances between each galaxy, accounting for expansion, is
Given the number of galaxies $n$, expansion scale $k$, sorted $x$ coordinates $x_1$, ..., $x_n$, and sorted $y$ coordinates $y_1$, ..., $y_n$, the sum of the distances between each galaxy pair, accounting for expansion, is

\begin{equation*}
\sum_{i=1}^{n} (2i-n-1)(x_i + y_i) + (k-1)(i-1)(n-i+1)(\textup{max}(x_i - x_{i-1} - 1, 0) + \textup{max}(y_i - y_{i-1} - 1, 0)))