A cable runs along the wall from C to P at a cost of $45 per meter, and straight from P to M at a cost of $53 per meter. Let x be the distance from C to P. If M is 28 meters from the nearest point A on the wall where P lies, and A is 62 meters from C, find x such that the cost of installing the cable is minimized and find this cost.