Logo
(追記) (追記ここまで)

26190번 - Denormalization 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 (추가 시간 없음) 1024 MB529675913.258%

문제

Dr. Brodnik prepared a list $A = [a_1, a_2, \ldots, a_N]$ that contained $N$ integers. No one knows what exactly these numbers represented, but it is well known that:

  • 1ドル \leq a_i \leq 10,000円$ for all 1ドル \leq i \leq N$ and
  • their greatest common divisor was 1ドル$.

Dr. Hočevar decided to do his colleague a favor and normalized the list, as he thought that it represents a vector in the $n$-dimensional real vector space. Namely, he calculated the number $$d = \sqrt{\sum_{i=1}^{N}a_i^2} = \sqrt{a_1^2 + a_2^2 + \cdots + a_N^2}$$ and replaced Dr. Brodnik's list by $[a_1 / d, a_2 / d, \ldots, a_N / d]$. The numbers in this normalized list were also rounded to 12 decimal places for storage. We will refer to the elements of the stored normalized list as $X = [x_1, x_2, \ldots, x_N]$. After some time, he realized that it was a mistake and he now wishes to recover the original list $A$. Of course, no backup of the original has been made. Since Dr. Hočevar is too busy at the moment doing more important tasks, your help will be much appreciated.

As some data was lost due to rounding, he will be happy with any reconstructed list $R = [r_1, r_2, \ldots, r_N],ドル such that after normalization it would differ from $X$ by at most 10ドル^{-6}$ in each corresponding element.

입력

The first line of the input contains an integer $N,ドル i.e. the length of the list $X$. The $i$-th of the following $N$ lines contains a floating-point number $x_i$ with exactly 12 decimal places. It is guaranteed that the input is valid, i.e. it was really obtained in the described manner from a list of integers with the properties described above.

출력

The output should contain $N$ lines containing the reconstructed integers $r_1, r_2, \ldots, r_N$ in this order. You can output any acceptable solution as described above.

  • 1ドル \leq r_i \leq 10,000円$ for all 1ドル \leq i \leq N$
  • $\gcd(r_1, \ldots, r_N) = 1$

제한

  • 2ドル \leq N \leq 10,000円$
  • 0ドル < x_i < 1$ for all 1ドル \leq i \leq N$

예제 입력 1

6
0.137516331034
0.165019597241
0.275032662068
0.412548993102
0.825097986204
0.165019597241

예제 출력 1

5
6
10
15
30
6

힌트

출처

ICPC > Regionals > Europe > Central European Regional Contest > CERC 2022 E번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /