The Largest number of four digits is 9999. Required number must be divisible by L.C.M. of 12,15,18,27 i.e. 540. On dividing 9999 by 540,we get 279 as remainder . Required number = (9999-279) = 9720.
The number students in each room = HCF of 70,98 and 126 =14 In each room , maximum 14 students can be seated. Total number students = 70 + 98 +126 =294 Number of rooms required = 294/14 =21