For the full problem, please refer to LOJ #2632. Submission for this problem is currently closed.
Using your Hydro universal account