Let the night be H, then width=H+3 and length=3H+1, so volume=640=H(H+3)(3H+1).
H(3H^2+10H+3)=640; 3H^3+10H^2+3H=640, or 3H^3+10H^2+3H-640=0.
By a bit of trial and error, we can find that H=5 satisfies the equation, so we can use synthetic division to reduce the cubic to a quadratic:
5 | 3 10.....3 -640
.....3 15 125 640
.....3 25 128 | 0 ⇒ 3H^2+25H+128=0, which doesn't factorise, so H=5 and width=8 and length=16 units.
So the dimensions are length=16, width=8 and height=5 units.