Turbo mode, because run without screen refresh crashes my computer. Maybe comment rectangles per second. I manage 3000 in Scratch, and 30000 in Turbowarp.
First, a line of maximum width is drawn parallel to the longest side, filling up most of the rectangle. Then, this line is outlined with 4 other lines of the maximum width such that no white space remains, and they all fit along the edges of the rectangle's constraints. This is repeated recursively, on an average of 2 more times until minRes has been achieved.