The average of 30 students = 12
Sum of the ages in a class= 30x12=360
The sum of ages of group 1=10x5=50
The sum of ages of group 2=14x5=70
The sum of ages of remaining student= 360-(70+50)=240
The average age of the remaining 20 student=240/20=12