So you have to find the volume of the tank, and the volume of the pyramid. Then subtract the volume of the pyramid from that out of the tank. The formula for pyramid is v = lwh/3. For the tank (which is a cube in this case) It's any given side cubed.
40*30*30 = 3600/3=1200cm cubed
40^3 = 6400cm cubed
6400-1200=5200cm^3 of water
(If you don't get this answer then I may have made a calculation error as I did this quickly in my head, just check my answer and yours to see)