Adding solution to the prtm problem.