Udesh Ranjan's submission of ATM | CodeChef