Square pyramid A and square pyramid B are similar. Their respective heights are 6 and 15 inches. The volume of pyramid B is 312.5 cubic inches. What is the volume of pyramid A?