Distance from the sand quarry and brick factory, adjacent to the highway is 30 km and the distance from the sand quarry to the road - 24 km. Building organization has to build a dirt road from the sand quarry to the road. Machines can run for up to 52 km / h on the highway, and the dirt road - up to 20 km / h. How far from the brick factory dirt road has to cross the highway, that the load coming from the sand quarry to the factory would spend the least time?
I believe I should use derivatives and make a function from the drawing. However, I couldn't manage to do so. The answer is 8 km, but I have got different ones. Could anyone make me a function? And explain why it is like you made. Calculations not neccesarry, I'll manage that. Thank you.

I believe I should use derivatives and make a function from the drawing. However, I couldn't manage to do so. The answer is 8 km, but I have got different ones. Could anyone make me a function? And explain why it is like you made. Calculations not neccesarry, I'll manage that. Thank you.