Sameer Raj's submission of ATM | CodeChef