

Let the original number of students = x
Given, total budget of the food = 240
Now, original budget of each student = 240/x
Now, 4 students failed to go to the picnic,
So, number of students who went to picnic = x - 4
New budget of each student = 240/(x - 4)
Given, New budget of each student - Original budget of each student = 5
=> 240/(x - 4) - 240/x = 5
=> 240{1/(x - 4) - 1/x} = 5
=> 1/(x - 4) - 1/x = 5/240
=> {x - (x - 4)}/{x*(x - 4)} = 1/48
=> {x - x + 4}/{x2 - 4x} = 1/48
=> 4/{x2 - 4x} = 1/48
=> x2 - 4x = 4*48
=> x2 - 4x = 192
=> x2 - 4x - 192 = 0
=> (x - 16)*(x + 12) = 0
=> x = 16, -12
Since number fo students can not be negative,
So x = 16
Now, number of students who went for the picnic = x - 4 = 16 - 4 = 12
