Ok, just to throw a spanner in the works then the smallest numeber of pieces over the target length will always be 1 , it will never be 2 or 3, therefore, your example would be 1 x 8500mm (smallest possible) after that you start having to choose from many millions of combinations.
I feel you're missing my point, you need to draw up a table of sizes for whatever it is your working with, same sizes across the top as down the side (like a mileage chart) so you can always intersect for two pieces so your first column would be 1 down to 8500 your first row would be the same. Now your thinking that you need to have more pieces, so how long is a piece? where does it not fit in with the equation before you need another piece?
It's a lot more complicated that you think, but until you can come up with some parameters on when another piece should be selected and repeated until the size requirement is complete we'll be unable to help.