Children from Year 4 took part in a maths-based challenge to see who could build the tower that held the most books.