Equalising Audio
문제
As a radio engineer at the Balanced Audio Podcast \copyright{} your job is to deliver an equal listening experience at all times. You did a poll among the listeners and they are especially concerned about fluctuations in loudness. To resolve this you bought a transformer to equalise the audio, but alas, its software got corrupted during transport.
Your job is to rewrite the equalising software. As input the transformer gets amplitudes , with an average perceived loudness of . The output should contain the same amplitudes, but renormalised by some constant positive factor, such that the average perceived loudness is . There is one exception: total silence should always be preserved.
입력
The input consists of:
- One line with a two integers and (, , the number of amplitudes and the average perceived loudness to achieve.
- One line with integers (), the amplitudes.
출력
Output one line containing numbers, the renormalised amplitudes with an average perceived loudness of .
Your answers should have an absolute or relative error of at most .
예제
예제 1
5 6 0 1 -2 3 -4
0 1 -2 3 -4
예제 2
4 1 1 3 3 7
0.242535625 0.7276068751 0.7276068751 1.697749375