Please, help me with this mistake. I'm totaly confused

Program is compiling well. But after execution the result is:
Average math: 3.67
Average phis: 4.33
Average inf: 4.33
Result: 4.67
Segmentation fault
The result is right, but where is segmantation fault happened?
Here is a program:

Technically pointing at at any of the classes you've implemented would work.

However, there's a few general OOP issues that don't make sense here. For example, all of the subclasses are, in everything other than name, the same. And, oddly, the superclass relies on the subclasses for one of it's functions.