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

24757번 - Loot Chest 스페셜 저지다국어

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

문제

Your favorite online game has a prize system. After each match you win, there is a $P\%$ chance you will receive a prize. This value $P$ changes over time:

  • every time you lose a match, $P$ increases by $\Delta_L,ドル
  • every time you win a match but fail to receive a prize, $P$ increases by $\Delta_W,ドル and
  • every time you win a match and receive a prize, $P$ is set to 0ドル$.

Whenever $P$ is increased, it is capped at 100ドル$. That is, if $P$ is to be increased by $\Delta,ドル $P$ increases to $\min(P+\Delta, 100)$.

The developers just revealed one of the prizes this season is a silverback gorilla suit with star-shaped sunglasses. You want it! Each prize has a $G\%$ chance of being this gorilla suit.

You start with $P = 0\%$. You have an $L\%$ chance of losing each match you play. Given $\Delta_L, \Delta_W, G,$ and $L,ドル compute the expected number of matches you will have to play until you obtain the silverback gorilla suit.

For example, in the first sample case you win every match you play and are guaranteed to receive a prize every 2ドル$ matches. Each prize has a 50ドル\%$ chance of being the gorilla suit. So you expect to obtain the gorilla suit after receiving 2ドル$ prizes. Thus, in expectation, it takes 4ドル$ matches to obtain the gorilla suit.

입력

The input consists of a single line containing four integers $\Delta_L$ (1ドル \leq \Delta_L \leq 100$), $\Delta_W$ (1ドル \leq \Delta_W \leq 100$), $G$ (1ドル \leq G \leq 100$), and $L$ (0ドル \leq L \leq 99$), which are described above.

출력

Display the expected number of matches you will play before you obtain the gorilla suit. Your answer should have an absolute or relative error of at most 10ドル^{-6}$.

제한

예제 입력 1

1 100 50 0

예제 출력 1

4

예제 입력 2

50 50 100 25

예제 출력 2

2.8333333333333333333

예제 입력 3

1 100 10 0

예제 출력 3

20

예제 입력 4

2 3 10 80

예제 출력 4

197.00570671995630567

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > 2021 Rocky Mountain Regional Contest G번

  • 문제를 만든 사람: Zachary Friggstad
(追記) (追記ここまで)

출처

대학교 대회

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

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