Let number of children = c
Let amount to be originally given to each child = n
Then total amount = cn.
When 8 children are absent, then the children left are = (c - 8)
Also each child gets an amount 20 more,
i.e.,each child gets amount = (n + 20)
Hence total amount
= (c - 8)(n + 20) = cn
OR
20c - 8n = 160 ------------(1)
When there are 7 children more, total children = (c + 7)
Also each child gets an amount 10 less,
i.e., each child gets amount = (n - 10)
Hence total amount
= (c + 7)(n - 10) = cn
OR
7n - 10c = 70 -------------(2)
Solving equations (1) and (2) for c and n,
Total no. of children c = 28
Amount per child = 50
Total amount = 28 x 50 = 1400
No conclusion can be drawn from the question as to why Anuj decided to distribute money for books.