Let the number of students in halls A and B are x and y, respectively.
Now, by given condition, x – 10 = y + 10
x - y = 20 …(i)
and (x + 20) = 2(y - 20)
x–2y = -60 …(ii)
On subtracting Eq. (ii) from Eq. (i), we get
(x - y) - (x -2y) = 80
y = 80
On putting y = 80 in Eq. (i), we get
x – 80 = 20
so, x = 100
Hence, 100 students are in hall A and 80 students are in hall B.