So I have this problem:
A vertical flag pole of height $h\;\text{meters}$ is erected exactly in the middle of the flat roof of a building. The roof is rectangular of width $w\;\text{meters}$ and depth $d\;\text{meters}$. The flag pole is stabilized by cables that join the corners of the roof top to the flag pole at a point $k\;\text{meters}$ below the top of the flagpole.
Let $\ell\;\text{m}$ be the total length of cable required to stabilize the flag pole. Find a correct expression for $\ell$ in terms of $w$, $d$, $h$ and $k$.

After working it out several times I always came to the conclusion that the answer should be $$4\sqrt{\frac{w^2+d^2}{2}+(h-k)^2}$$
However the correct answer is actually $$4\sqrt{\frac{w^2+d^2}{4}+(h-k)^2}$$ and I just don't understand why you would divide by 4 instead of 2?
The diagonal length of the roof is calculated using Pythagorean Theorem $\sqrt{w^2+d^2}$. However, what's used for determining the hypotenuse is just half of that diagonal length right? If someone could explain this it would be of great assistance.