Sparsh Kumar Sinha's submission of ATM | CodeChef