#K10931. Minimum Attacks Required

    ID: 23356 Type: Default 1000ms 256MiB

Minimum Attacks Required

Minimum Attacks Required

You are given an integer (N) representing the number of monsters and an integer (K) representing the attack power. Each monster has a health value given in an array of (N) integers. In one attack, you can reduce the health of any monster by (K) points. Your task is to calculate the minimum number of attacks required to reduce the health of all monsters to zero or below.

Formally, for each monster with health (h), the number of attacks required is (\lceil \frac{h}{K} \rceil). The total number of attacks is the sum of the attacks needed for each monster.

Input/Output via standard input and output.

inputFormat

The first line contains two integers (N) and (K) where (1 \leq N \leq 10^5) and (1 \leq K \leq 10^9). The second line contains (N) space-separated integers representing the health values of the monsters. Each health value (h_i) satisfies (1 \leq h_i \leq 10^9).

outputFormat

Output a single integer, the minimum number of attacks required to reduce all monsters' health to zero or less.## sample

5 100
450 900 200 300 700
26