Number of students of Std 6th = 140
Number of students of Std 7th = 196
The maximum same number of students of each class that can be divided into each group is the HCF of 140 and 196.
Factors of 140: 1, 2, 4, 5, 7, 10, 14, 20, 28, 35, 70, 140
Factors of 196: 1, 2, 4, 7, 14, 28, 49, 98, 196
Common factors of 140 and 196: 1, 2, 4, 7, 14, 28
HCF of 140 and 196 = 28
∴ Maximum same number of students of each class that can be divided into each group = 28
Thus, the maximum number of students that can be in each group is 28.
Each group should have the maximum possible number of students so as to minimise the total amount paid to the guides.