Anders Kaseorg's submission of Forgotten Tree 9 | CodeChef