Official algorithmic problem description and constraints.
You are given an array π₯2,π₯3,β¦,π₯π. Your task is to find any array
π1,β¦,ππ, where:
Here πmodπ denotes the remainder of the division of the integer π by the integer π. For example 5mod2=1, 72mod3=0, 143mod14=3
Note that if there is more than one π which satisfies the statement, you are allowed to find any.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.