this is a good question. also one you can use in real life.
if the fence is 8ft tall you know you need at least an 8ft ladder to get over the fence.
the building is 4ft away but you need to clear the fence.
|\
|™\
| ™\
|__\
|™™ | \
|.....|...\........
So this is what your looking for. I find it easier to learn when you make it into a picture.
so it's 8ft high and 4ft from building so the ladder has to be 8×4 to go from the ground to the wall over the fence.