XY's submission of Winning Ways | CodeChef