Hemant Joshi's submission of ATM | CodeChef