A square plot of ground 100 feet on a side has vertices labeled A, B, C, D clockwise. Pipe is to be laid in a straight line from A to a point P on BC (P may be one of the vertices), and from there to point C. The cost of laying the pipe is $20 per foot if it goes through the lot (since if must be laid underground), and $10 per foot if it is laid along one of the sides of the square. What is the minimum cost for paying the pipe and how should the pipe be laid?