The average age of 5 girls is 35 and the average of another 4 girls is 40. What would be the combined average.
So, what you describe is this
(ages combined) / 5 = 35
ages combined = 175
and
ages combined / 4 = 40
ages combined = 160
Total number of years of ages combined = 175+160 = 335 years
total # girls = 5 + 4 = 9
Average age = 335 / 9 = 37.22 years old