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

21898번 - Wedding cake 서브태스크스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 512 MB214433.333%

문제

Julia's wedding is going to have a huge one ton cake. All $n$ guests want to taste the cake, so it's going to be cut in $n$ pieces. But this task is not that easy, because all guests are on a special mathematical diet. Guest $i$ is only willing to eat the cake if the weight of his piece in tons $w_i$ has exactly $a_i$ significant digits after the decimal point. In decimal representation all digits up to the last non-zero digit after the decimal point are significant. For example, number 0.007 contains three significant digits after the decimal point, number 1.45 --- two, and number 17.0 has no significant digits after the decimal point.

Your task is to cut the cake for Julia's wedding so that every guest could taste it.

입력

First line contains single integer $n$ --- number of guests (1ドル \le n \le 10^5$).

Next line contains $n$ integers $a_i$ --- constraint for the weight of $i$-th piece (1ドル \le a_i \le 10^5$).

Sum of all $a_i$ doesn't exceed 10ドル^5$.

출력

Output should contain "NO", if there is no way to cut the cake.

Otherwise, output "YES" on the first line. Each of the next $n$ lines should contain one single real number $w_i$ --- weight of the piece for the $i$-th guest with exactly $a_i$ digits after the decimal point. All $a_i$ digits after the decimal point have to be significant.

제한

서브태스크

번호배점제한
117

$n \le 100 ,ドル $a_i \le 10$

221

$n \le 10^5,ドル all $a_i$ are equal

325

$n \le 10^3,ドル sum of all $a_i$ doesn't exceed 10ドル^3$

437

$n \le 10^5,ドル sum of all $a_i$ doesn't exceed 10ドル^5$

예제 입력 1

5
2 4 4 3 2

예제 출력 1

YES
0.47
0.1234
0.1326
0.024
0.25

힌트

출처

Contest > Innopolis Open in Informatics > Innopolis Open, Elimination round, 2016-2017 D번

채점 및 기타 정보

  • 예제는 채점하지 않는다.
(追記) (追記ここまで)

출처

대학교 대회

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

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