Devesh Agarwal's submission of Factor Tree | CodeChef