#C3742. Total Printing Time

    ID: 47203 Type: Default 1000ms 256MiB

Total Printing Time

Total Printing Time

You are given n documents. Each document has a certain number of pages, specified by an array of integers. The printer can print m pages per minute. You need to determine the total time required to print all the documents. Mathematically, the total printing time is given by the formula:

i=1npagesim\lceil \frac{\sum_{i=1}^{n} pages_i}{m} \rceil

where (pages_i) is the number of pages in the (i^{th}) document.

inputFormat

The input is given via standard input (stdin) in the following format:

  • The first line contains a single integer n representing the number of documents.
  • The second line contains n space-separated integers representing the number of pages in each document.
  • The third line contains a single integer m which denotes the number of pages the printer can print per minute.

outputFormat

Output via standard output (stdout) a single integer indicating the minimum number of minutes required to print all documents.## sample

3
3 3 3
2
5