The grades of the "statistics" course this semester are low and the professor has…
- User
The grades of the "statistics" course this semester are low and the professor has decided to increase the grades of the students. If the student's grade i the i a i a i Consider, the teacher wants a grade b i b i to register for him, so that the following conditions are met:
a i ≤ b i a i ≤b i
a i < a J ⇒ b i < b J a i <a J ⇒b i b J
all b i b i are natural.
In order for the grades to increase logically, the professor wants the average of the grades after the increase to be equal to the number M M and among the states that have this feature, the dispersion of scores should be minimized. The dispersion of an arbitrary sequence like c i , c 2 , ⋯ , c n c i c 2 , ⋯, c n with average T T is equal to:
Σ i
1 n ( c i
T ) 2 n n Σ i=1 n (c i −T) 2
input The first line of input contains two natural numbers n n, number of students, and no M ′ M ′ , so that M ′
M x n M ′ = M×n is
In the second line of the sequence a 1 , a 2 , ⋯ , a n a 1 , a 2 , ⋯, a n It has come so that a i a i Indicates the student's grade i i is The sequel a i a i It is strictly bullish. 1 ≤ n ≤ 1
000
000 1≤n≤1 000 000
1 ≤ a i ≤ 1 0 9 1≤a i ≤10 9
Σ i
1 n a i ≤ M ′ ≤ 1 0 18 Σ i=1 n a i ≤M ′ ≤10 18
output The sequel b 1 , b 2 , ⋯ , b n b 1 b 2 , ⋯, b n print on the output. If there are several answers, print one as desired.
Example Sample entry 1 39 1 2 3 Plain text Sample output 1 2 3 4 Plain text Sample entry 2 4 10 1 2 3 4 Plain text Sample output 2 1 2 3 4 c++
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.