#C4396. Taco: Minimum Spotlights Problem
Taco: Minimum Spotlights Problem
Taco: Minimum Spotlights Problem
You are given n buildings and a spotlight with a fixed range of r. Each spotlight can illuminate exactly r consecutive buildings. The objective is to illuminate all buildings using the minimum number of spotlights.
Mathematically, you need to compute the value of \(\lceil\frac{n}{r}\rceil\). Although the input contains the heights of the buildings, they are not relevant for determining the minimum number of spotlights.
Note: The building heights are provided for extra information but do not affect the answer.
inputFormat
The input is read from standard input (stdin) and contains two parts:
- The first line contains two integers n and r separated by a space. Here, n is the number of buildings, and r is the range of each spotlight.
- The second line contains n integers separated by spaces, representing the heights of the buildings. (These heights are provided but are not used in computing the result.)
outputFormat
The output is a single integer printed to standard output (stdout): the minimum number of spotlights required to illuminate all n buildings.
This value is equivalent to \(\lceil\frac{n}{r}\rceil\).
## sample7 3
3 1 4 1 5 9 2
3
</p>