#C2706. Minimum Video Clips
Minimum Video Clips
Minimum Video Clips
You are given a forest of n cameras. Each camera has generated a certain number of video clips as given in an array vi
. Your task is to select exactly k cameras such that the sum of video clips from these selected cameras is minimized. Although you are allowed to perform up to s swaps between camera placements, these swaps do not affect the final clip counts. Essentially, the problem reduces to selecting the k cameras with the smallest clip counts.
Note: The parameter s is provided as part of the input but does not influence the result. Your solution should simply compute the sum of the smallest k numbers from the list.
Input Format: The first line contains three space-separated integers n, k, and s. The second line contains n space-separated integers representing the clip counts of each camera.
Output Format: Output a single integer representing the minimum possible total number of video clips from the selected k cameras.
inputFormat
The first line of input contains three space-separated integers n, k, and s. The second line contains n space-separated integers, where the i-th integer denotes the number of video clips generated by the i-th camera.
outputFormat
Output a single integer which is the minimum possible sum of video clips from the selected k cameras.## sample
4 2 1
5 3 8 2
5
</p>