Ive encounter this problem which is very confusing for me

Tim needs to run a pipeline to his camp that is 100 feet west along the shore and 30 feet north across a lake from his starting position. It cost $10 per foot to run pipe over land and $20 to run pipe over water What path should Tim take to minimize his cost? What his minimum cost ?

I so if I draw a mental picture you a height of 30 feet on the y axis and 100 feet on the x axis

I know I can use the distance formula somehow but i am still lost