Shivam Mittal's submission of ATM | CodeChef