Sameer Raj's submission of Mahasena | CodeChef