Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There are n lines of length 90 inches which need to be cut at 1/2 places so that the new parts formed after cut have a total length as close as possible to 90.


the minimum length is 24 and maximum is 48.
the length to be cut are decided on input

example we need

6 lines of 24
5 of 26
4 of 28
7 of 32
8 of 37
9 of 38
7 of 40
6 of 42

There for total line segments after cut = 6+5+4+7+8+9+7+6 = 42 which would need around 12 lines of 90" ..

how to cut them to minimize wastage e.g

If I cut 26+28 +32 = 86, I waste 4". How to keep the wastage to minimum?

share|cite|improve this question

migrated from Nov 20 '12 at 12:39

This question came from our site for professional and enthusiast programmers.

Did not read care fully, but either rod cutting problem or knapsack could worth a look. – Nishant Oct 29 '12 at 16:25
This seems like the cutting stock problem. – interjay Oct 29 '12 at 16:27
thanks @interjay. Problem Solved :) – Akshat Goel Oct 29 '12 at 16:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.