Semaphore script

Hello, i have problem with a semaphore script. There must be 3 printers and we have 7 books to print which have 7 chapters each.
Printing times each chapter:
Ch1 => 5 seconds
Ch2 => 6s
Ch3 => 7s
Ch4 => 4s
Ch5 => 5s
Ch6 => 6s
Ch7 => 3s

Any ideas how to write script and solve this problem as fastes we can ?

Is this a homework assignment?

If you know how long it is going to take to print something before you send it to the printer, what you have is a scheduling problem; not a semaphore problem. (But, if you think you know how long it will take to print something before it completes printing, you have obviously never used a real printer; which will invariably run out of paper, toner, etc.; at the worst possible time.)

If this is a homework assignment, please close this thread and repost it in the Homework & Coursework Forum with a completely filled out homework template. Otherwise, please give a much clearer description of what problem you are trying to solve, tell us what operating system and shell you're using, and show us what you have do so far to solve this problem.