Your problem is a variation upon the Bin packing problem.
Unfortunately, your particular constraints--variable size bins & constrained number of items per bin--do not fit with either of the bin packing solutions on cpan: Algorithm::BinPack & Algorithm::Bucketize.
I think now we have clarified what the problem is that you are trying to solve, it might be better to post a new top-level node--perhaps I should do that on your behalf to ensure it is clear--so that the other monks with more CS chops than I might take a second look at your problem.
I have some thoughts on it and might post something here later.
In reply to Re^7: Help Me in following code ::
by BrowserUk
in thread Help Me in following code ::
by gskoli
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |