Dashboard Layout: Sentence Screen Fitting

You are arranging a status sentence inside a dashboard card. The sentence is a list of words, and every word must stay whole. Put exactly one space between consecutive words. After the final word, the sentence wraps back to its first word, so the same sentence may repeat across the card.

The card has rows rows and cols columns. Each row must contain only complete words and spaces. A word may begin on a row only if the entire word fits on that row. Return how many complete copies of the sentence appear in the card.

The words are placed in their given order. A word that does not fit in the remaining columns moves to the next row, and unused cells at the end of a row are ignored.

Dashboard Story

The product dashboard repeats a short alert sentence through a fixed-size announcement panel. The rendering service knows the panel dimensions, but it must calculate the number of full alert cycles without building the complete panel. Treat the sentence as a circular stream and advance through it one row at a time.

Examples
Input: [["a"],1,1]
Output: 1
Hints
Related Problems

Dashboard Layout: Sentence Screen Fitting

You are arranging a status sentence inside a dashboard card. The sentence is a list of words, and every word must stay whole. Put exactly one space between consecutive words. After the final word, the sentence wraps back to its first word, so the same sentence may repeat across the card.