시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
4 초 (추가 시간 없음) | 1024 MB | 99 | 45 | 42 | 51.852% |
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 $n$ amplitudes $a_1, \ldots, a_n$, with an average perceived loudness of $\frac{1}{n}\sum_{i=1}^n a_i^2$. The output should contain the same amplitudes, but renormalised by some constant positive factor, such that the average perceived loudness is $x$. There is one exception: total silence should always be preserved.
The input consists of:
Output one line containing $n$ numbers, the renormalised amplitudes with an average perceived loudness of $x$.
Your answers should have an absolute or relative error of at most $10^{-6}$.
5 6 0 1 -2 3 -4
0 1 -2 3 -4
4 1 1 3 3 7
0.242535625 0.7276068751 0.7276068751 1.697749375
ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2022 E번