Madhav Jha's submission of pattern14 | CodeChef