Comments

Graphical Approach for Problem C

For problem C, I modelled it using trees with an edge between every number n and its n/spf(smallest possible factor). After making the tree, I ran a normal dfs for the required array.

Here's my submission: My Contest Submission