I need help on solving this problem!! I'm so confused

The question wil be solved using principle of similar triangle
Considering Triangle ABC and Triangle CDB
[tex]\frac{AC}{CB}\text{ =}\frac{CB}{CD}[/tex][tex]\begin{gathered} \frac{50}{x}\text{ =}\frac{x}{18} \\ 50X18=x^2 \\ x^2=\text{ 900} \\ x\text{ = }\sqrt[]{900} \\ x\text{ = 30m} \end{gathered}[/tex]/CB/= x = 30m
Then /AB/ = Y Can be obtained from triangle ABC
[tex]\begin{gathered} 50^2=30^2+Y^2^{} \\ 2500=900+Y^2 \\ Y^2\text{ = 2500 -900} \\ Y^2=\text{ 1600} \\ Y\text{ =}\sqrt[]{1600} \\ Y\text{ =40M} \\ \end{gathered}[/tex]/AB/ = Y = 40M
Then P can then be obatined from triangle CDB
Again applying pythaoras theorem
[tex]\begin{gathered} 30^2=18^2+p^2 \\ 900=324+p^2 \\ p^2\text{ = 900 -324} \\ p^2\text{ =576} \\ p=\sqrt[]{576} \\ p\text{ =24m} \end{gathered}[/tex]Question A :How far is the spot on the Beach from the Parking lot?
Answer: The distance is P in the triangle CDB = 24m
Question B: How far will he have to walk from parking lot to refreshment stand
Answer: The distance Y in triangle ABC represents this value, which is equal to 40m