In a school hostel,there is enough food for 30 days. After 10 days, 40 students left the hostel and 100 more students join the hostel.how long will the food last?

After 10 days, there was enough food for 20 days for x students. So, if the number of students grew from x to x+60, it will only last

20x/(x+60) = 20 - 1200/x+60

more days. So, it depends on how many students there were to start with. If there were x at first, then the 20-day supply will be divided among x+60, as shown in the table below. The more students there were at first, the longer the remaining food will last the increased number of students.

x__n
40 800/100 = 8
41 820/101 = 8.1
60 1200/100 = 12
100 2000/160 = 12.5
1000 20000/1060 = 18.86

The longest the remaining food will last is 20 days, if there was a very large number to start with