a cable runs along the wall from C to P at a cost of $3 per meter and straight from P to M at a cost of $5 per meter if M is 12 meters from the nearest point A on the wall where P lies and A is 25 meters from C find the distance from C to P such that the cost of installing the cable is minimized and find this cost