One Dimensional Kingdoms | CodeChef