Air conditioning usage: Rooms in a hospital corridor are stacked next to each other in such a way that the wall separating 2 rooms only occupy half the height of the room, There is provision for installation of AC’s in some of the rooms and the hospital is looking to procure ACs. ACs are categorised as {1 tonne, 2 tonne, 3 tonne "x" tonne} based on the area they are capable of cooling; larger the tonnage more area they are capable of cooling. Assume that 1 tonne AC cools 1 room, 2 tonne AC cook) the room and its adjacent rooms arid so on and so forth . Suppose there are "n" rooms next to each other numbered 1 to n, And that the value for "n" as well as the room numbers having provision for installation of ACs are giver as Input. Write a program that figures out the minimum tonnage of AC's to be procured to cool all the rooms. Assume that the tonnage for all the ACs being procured is the same g)
Input:
First line consists of a single integer, R - number of rooms.
Second line consists of a single integer, P, denoting the number of positions to place AC’s .
Third line consists of a N integers separated by a space. A[N]. (Position to place AC)
Output:
For each test case, print the minimum number of AC’s required.
Constraints:
1<=R<=10000
1<=P<=10000
1<=N<=10000
No editorial available for this problem.