포럼
문제 ICPC00200

G. Gnoll Hypothesis

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

You are a huge fan of the RPG The Eldest Scrolls: Earthrim and know all of the game's internal mechanics. For instance, when spawning a new monster, each of the \(n\) different types of monsters in the game has some fixed probability of appearing, and you know exactly what this probability distribution over monster types is.

However, in the latest update the developers seem to have changed the way monsters are spawned. After some testing and reverse engineering, you realise that instead of spawning all \(n\) types of monsters, each spawn location only has a spawn pool of \(k\) monster types. These spawn pools are chosen randomly at the start of the game, independently for each spawn location, with every monster type having the same chance of being chosen for the spawn pool. And apparently a developer was lazy with adjusting the spawn chances. Instead of normalising the spawn chances of the \(k\) chosen types, the developer decided that if a type of monster is not chosen, its spawn chance is added to the next chosen monster type in the list of types (and if monster types at the end of the list are not chosen, their spawn chances are added to the first chosen monster type in the list). For example, Figure shows a small example with \(n=5\) monsters, a possible random choice of \(k=3\) of those monsters, and the resulting spawn probabilities for those \(3\) monsters.

After the update, some monster types seem to appear less often than before, and some more often (for instance now there seem to be Gnolls all over the place). You believe that the new spawning logic may be responsible for this by having changed the effective spawn chances of the monsters. In order to test this hypothesis, you decide to compute these effective spawn chances after the update.

제약
입력 형식

The input consists of:
- One line with two integers \(n\) and \(k\) (\(1 \le k \le n \le 500\)), the number of different types of monsters and the number of monsters that are randomly chosen for the spawn pool of each spawn location.
- One line with \(n\) real numbers \(s_1, s_2, \ldots, s_n\) (\(s_i \ge 0\) for each \(i\), \(\sum^{n}_{j=1}s_j = 100\)), where \(s_i\) is the spawn chance in percent for the \(i\)th type in the list of monster types. Every real number has at most six digits after the decimal point.

출력 형식

Output a single line containing \(n\) real numbers, the effective spawn chance in percent of each type of monster. The \(i\)th number in your output should correspond to the \(i\)th type of monster. Your answers should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
5 3
1 25 39 12 23
출력
8.7 17.6 31 21.4 21.3
예제 2
입력
3 2
2.019 87.51234 10.46866
출력
4.8355533 59.01456 36.1498867
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC NWERC 2019

평가 및 의견

G. Gnoll Hypothesis

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

G. Gnoll Hypothesis

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8