아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Denormalization

시간 제한5초메모리 제한1024 MB

요약
유클리드 노름으로 정규화한 뒤 소수점 12자리로 반올림한 값을 보고, 각 원소가 10000 이하이고 최대공약수가 1인 원래 정수 목록을 복원한다.
난이도

보통10점 중 7점

유형
수학, 정수론, 구현, 완전 탐색
정답자
아직 제출이 없습니다

문제

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

  • 1≤a_i≤10,0001 \leq a\_i \leq 10\\,000 for all 1≤i≤N1 \leq i \leq N and
  • their greatest common divisor was 11.

Dr. Hočevar decided to do his colleague a favor and normalized the list, as he thought that it represents a vector in the nn-dimensional real vector space. Namely, he calculated the number d=∑_i=1Na_i2=a_12+a_22+⋯+a_N2d = \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,…,a_N/d]\[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,…,x_N]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 AA. 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,…,r_N]R = \[r\_1, r\_2, \ldots, r\_N], such that after normalization it would differ from XX by at most 10−610^{-6} in each corresponding element.

입력

The first line of the input contains an integer NN, i.e. the length of the list XX. The ii-th of the following NN lines contains a floating-point number x_ix\_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 NN lines containing the reconstructed integers r_1,r_2,…,r_Nr\_1, r\_2, \ldots, r\_N in this order. You can output any acceptable solution as described above.

  • 1≤r_i≤10,0001 \leq r\_i \leq 10\\,000 for all 1≤i≤N1 \leq i \leq N
  • gcd⁡(r_1,…,r_N)=1\gcd(r\_1, \ldots, r\_N) = 1

제한

  • 2≤N≤10,0002 \leq N \leq 10\\,000
  • 0<x_i<10 < x\_i < 1 for all 1≤i≤N1 \leq i \leq N

예제1

  1. 예제 1

    입력
    6
    0.137516331034
    0.165019597241
    0.275032662068
    0.412548993102
    0.825097986204
    0.165019597241
    
    예상 출력
    5
    6
    10
    15
    30
    6