The question above is a ratio problem so since both shadows end at point B, then the towers are proportional.
Start with 40:5 and reduce it to 8:1. Now, for every 8 meters of the big tower, the little tower increases one.
Now since the little tower is 4 meters, the big tower will be 36 meters.
I hope my answer helped you.