solution to the smallest multiple problem