#K74552. Minimum Combined Power Level
Minimum Combined Power Level
Minimum Combined Power Level
In this problem, you are given n bases with initial power levels pi for i = 1, 2, \dots, n. At each second, every base increases its power level by exactly 1. After exactly t seconds, the power level of the i-th base becomes pi + t and the combined power level of all bases is given by:
$$\sum_{i=1}^n (p_i + t) = \left(\sum_{i=1}^n p_i\right) + n \cdot t. $$Your task is to compute this minimum combined power level after t seconds.
inputFormat
The input is given via standard input (stdin) with the following format:
The first line contains two integers n and t, where n is the number of bases and t is the number of seconds elapsed. The second line contains n space-separated integers indicating the initial power levels of each base.
outputFormat
Output a single integer representing the minimum combined power level of all bases after t seconds. The result should be printed to standard output (stdout).## sample
3 5
6 8 12
41