포럼
문제 ICPC00255

E. Explosion Exploit

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

In a two player card game, you have \(n\) minions on the board and the opponent has \(m\) minions. Each minion has a health between \(1\) and \(6\).

You are contemplating your next move. You want to play an "Explosion" spell which deals \(d\) units of damage randomly distributed across all minions. The damage is dealt one unit at a time to some remaining minion on the board. Each living minion (including your own) has the same chance of receiving each unit of damage. When a minion receives a unit of damage, its health is decreased by one. As soon as the health of a minion reaches zero, it is immediately removed from the board, before the next damage is dealt. If there are no minions left on the board, any excess damage caused by the spell is ignored.

Given the current health of all minions, what is the probability that the Explosion will remove all of the opponent's minions? Note that it does not matter if all your own minions die in the process as well, and the damage continues to be dealt even if all your own minions are gone.

제약
입력 형식

The first line of input contains the three integers \(n\), \(m\), and \(d\) (\(1 \le n, m \le 5\), \(1 \le d \le 100\)). Then follows a line containing \(n\) integers, the current health of all your minions. Finally, the third line contains \(m\) integers, the current health of all the opponent's minions. All healths are between \(1\) and \(6\) (inclusive).

출력 형식

Output the probability that the Explosion removes all the opponent's minions, accurate up to an absolute error of \(10^{-6}\).

예제 1
입력
1 2 2
2
1 1
출력
0.3333333333
예제 2
입력
2 3 12
3 2
4 2 3
출력
0.1377380946
문제 정보

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

출처 ICPC NCPC 2018

평가 및 의견

E. Explosion Exploit

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

Log in to rate problems.

개별 의견

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

풀이 제출

E. Explosion Exploit

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