For the full problem, please refer to LOJ #2012. Note that submissions for this problem are currently closed.
Using your Hydro universal account