A teacher prepared math problems for students to solve in groups. She split her class into 4 groups. Each group got an equal number of problems. After distributing them, there were 2 left over. Group A completed their problems plus 2 extras (30 problems). How many problems did the teacher originally prepare?