Anders Kaseorg's submission of (Challenge) SnackDown 99 | CodeChef