Let's say each row has x desks and there are y rows.
We then know that xy =25
We also know that x2-5=y (number number of rows is five less than twice the number of desks in each row)
So we substitute: x(x2-5)=25
putting numbers out of the brackets:
2xx-5x=25
2xx-5x-25=0
(2x+5)(x-5)=0 (this bracketing is true: you can check it by expanding it:
2xx-10x+5x-25
So that means that either x=-2.5which can't be : there can't be a fractional number of benches,
or x=5
so each row has 5 desks and there are 25-5 rows, or 5 rows.