Jiaye Zhu's submission of ATM | CodeChef