Zhang Yide's submission of Mahasena | CodeChef