Time Limit: 1000 mSec
Memory Limit: 32768 KB
All K (1 <= K <= 1,000) of the cows are participating in Farmer John's annual reading contest. The competition consists of reading a single book with N (1<=N<=100,000) pages as fast as possible while understanding it.
Cow i has a reading speed S_i (1<=S_i<=100) pages per minute, a maximum consecutive reading time T_i (1<=T_i<=100) minutes, and a minimum rest time R_i (1<=R_i<=100) minutes. The cow can read at a rate of S_i pages per minute, but only for T_i minutes at a time. After she stops reading to rest, she must rest for R_i minutes before commencing reading again.
Determine the number of minutes (rounded up to the nearest full minute) that it will take for each cow to read the book.
* Lines 1..K: Line i should indicate how many minutes (rounded up to the nearest full minute) are required for cow i to read the whole book.