Vivek Ghosh's submission of ATM | CodeChef