#C10066. Days to Finish Books
Days to Finish Books
Days to Finish Books
You are given a collection of books, each with a certain number of pages. You can read at most (p) pages each day. Your task is to determine how many days it takes to finish each book. The number of days for each book is computed using ceiling division, i.e., (\lceil \frac{\text{pages}}{p} \rceil). For example, if a book has 12 pages and you read 5 pages per day, it will take (\lceil 12/5 \rceil = 3) days to finish.
inputFormat
The input consists of two lines. The first line contains two integers (n) and (p) where (n) is the number of books and (p) is the maximum number of pages you can read in a day. The second line contains (n) space-separated integers representing the number of pages in each book.
outputFormat
Output a single line with (n) integers separated by spaces. Each integer indicates the number of days required to finish the corresponding book.## sample
3 5
12 10 8
3 2 2