My solution of PackProblem