Find the altitude of a triangle if its area with base 24 cm is equal to the area of a square with side 24 cm.