Nitesh Pathak's submission of ATM | CodeChef