okay...i've got another wired counting problem, this time it's about rectangles!
gotta find the minimum number of lines to divide a rectangle into squares! i went for...ehh
well a dumb idea of cutting the max square off, and cutting the little ones recursively, but...
doesn't always work.
you're given the two dimensions of the rectangle...that's it. both are integers btw.
gregorynoob
2
Junior Poster in Training
Recommended Answers
Jump to PostFind a point that is as far in as the length of the height (assuming height < width). Then you have a square and a new rectangle. Repeat the procedure using the shortest side as the side of the new square you want to cut. Do this until S1 == …
Jump to PostIts confusing but post some code once you try it out.
All 5 Replies
dmanw100
36
Posting Whiz in Training
dmanw100
36
Posting Whiz in Training
gregorynoob
2
Junior Poster in Training
stilllearning
148
Posting Whiz
dmanw100
36
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.