.
The solution by tutor @solver91311 is not correct.
To demonstrate it, I will construct a contradictory example.
Let all the books are 15 cm wide.
Then the total number of books is = 16,
and we can place ONLY 3 such books at each shelf.
So, having 5 shelves, we can place only 3*5 = 15 such books, and we need then
the 6-th shelf for the 16-th book.
Now, after completing this counter-example, I can solve the problem in full.
My statement is that 6 shelves is always enough.
1) In the 1-st shelf, I can fill at least 40 cm of 56 cm.
Indeed, if less than 40 cm is filled, then I can add any book (since it is no
thicker than 16 cm).
2) In the 2-nd shelf, I can fill at least 40 cm of 56 cm.
Indeed, if less than 40 cm is filled, then I can add any book (since it is no
thicker than 16 cm).
3) In the 3-rd shelf, I can fill at least 40 cm of 56 cm.
Indeed, if less than 40 cm is filled, then I can add any book (since it is no
thicker than 16 cm).
4) In the 4-th shelf, I can fill at least 40 cm of 56 cm.
Indeed, if less than 40 cm is filled, then I can add any book (since it is no
thicker than 16 cm).
5) In the 5-th shelf, I can fill at least 40 cm of 56 cm.
Indeed, if less than 40 cm is filled, then I can add any book (since it is no
thicker than 16 cm).
6) In the 6-th shelf I can fill at least 40 cm of 56 cm.
Indeed, if less than 40 cm is filled, then I can add any book (since it is no
thicker than 16 cm).
So, I can fill at least 40 cm of 56 cm in each of 6 shelves.
Taken together, 6 times 40 cm comprise 2 m 40 cm,
which means that ALL the books will be placed in 6 shelves.
***********************************
THE PROOF IS COMPLETED.
***********************************
It is a TRUE Math Olympiad level Math problem (!)