Answer:
16 years
Explanation:
Given,
Number of students in group A = X,
Sum of their ages = 221,
So, the average age of students in group A =


According to the question,

∴ X must be a factor of 221,
∵ 221 = 13 × 17,
Now, If X = 13,
Then the number of students in group B = 26 ( NOT POSSIBLE )
If X = 17,
Then the number of students in group B = 34
Which is between 30 and 40,
Now, Let S be the sum of ages of students in group B,
So, the average age in group B =

Again according to the question,






Therefore, the average age of B =
= 16 years.