Infinity 2021 (CodeChef ERC) Solution Explanations (finished)