Editorial for LCC '24 Contest 2 S3 - Partners
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
For every , there's another
such that
+
=
, where
is the sum of each pair.
If you add every together, you'll end up adding
pairs of
, so the sum is
. Since we know
, we can just divide this sum by
to find
. Then, it remains to subtract
from
to find your partner.
Comments