In a classroom, the average age of boys (b) is g and the average age of girls (g) is b. The average age of all is b+g. At the time of calculation, the class teacher, who is 42 years old was also present in the class. Can you find the value of b+g? Choices:
A) 8 B) 3 C) 7 D) 9 E) 10
8   b+g = 8   for b in range(1,99):   for g in range(1,99):   sum1=2*b*g+42   sum2=(b+g)*(b+g+1)   if(sum1==sum2):   print(b,g,sum1)   (b,g)=(3,5) =&gt; b+g=8
<result>A</result>
In a classroom, the average age of boys (b) is g and the average age of girls (g) is b. The average age of all is b+g. At the time of calculation, the class teacher, who is 42 years old was also present in the class. Can you find the value of b+g?