A comment by Ethan Bolker is a good hint to the original question.
($AP=PB\Rightarrow AP=6,AH=\frac 12AC=4\Rightarrow \text{perimeter}=20$, a contradiction.)
To find the sides of the parallelogram, let $AP=HM=a,AH=PM=b$. Then, we have
$$2a+2b=18\Rightarrow b=9-a.$$
Here, note that we have
$$CH=8-b=8-(9-a)=a-1,\ \ PB=12-a.$$
Since $\triangle{CHM}$ and $\triangle{MPB}$ are similar, we have
$$CH:MP=HM:PB,$$
i.e.
$$a-1:9-a=a:12-a.$$
Solving this gives you $AP=a=3,AH=b=6$.
A comment by Ethan Bolker is a good hint to the original question.
($AP=PB\Rightarrow AP=6,AH=\frac 12AC=4\Rightarrow \text{perimeter}=20$, a contradiction.)
To find the sides of the parallelogram, let $AP=HM=a,AH=PM=b$. Then, we have $$2a+2b=18\Rightarrow b=9-a.$$ Here, note that we have $$CH=8-b=8-(9-a)=a-1,\ \ PB=12-a.$$
Since $\triangle{CHM}$ and $\triangle{MPB}$ are similar, we have $$CH:MP=HM:PB,$$ i.e. $$a-1:9-a=a:12-a.$$ Solving this gives you $AP=a=3,AH=b=6$.