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

21093번 - Extreme Wealth 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
3 초 256 MB215342516.340%

문제

You have a friend working in casino and you decided to use it to your advantage. You'll play Red or Black exactly $R+B$ times and using your insider you know that exactly $R$ times the ball will fall on Red, while all the other $B$ times the ball will fall on Black.

You are starting with initial capital of 1ドル$ and before each spin of the roulette you can take any part of your current money and bet it either on Red or Black. You cannot bet on both in one spin. All the money you don't bet remains with you. If you guess the color correctly you get back double the bet, otherwise you lose the bet.

For what maximal $X$ you can guarantee you capital to be at least $X$ at the end of the game (if you play optimally)? If $X > 10^{9},ドル you don't really care about the exact value, so just print "Extreme Wealth".

입력

The only line contains two integers $R$ and $B$ (0ドル \le R, B \le 10^{13}$).

출력

Print the maximal value of $X$ if it is not more than 10ドル^{9},ドル otherwise print "Extreme Wealth" (without quotes).

Answer "Extreme Wealth" will be considered correct if the correct value of $X$ is at least 0ドル.99 \cdot 10^{9}$. Answer $X'$ will be considered correct if the actual value of $X$ is at most 1ドル.01 \cdot 10^{9}$ and $\frac{|X' - X|}{X} \le 10^{-6}$.

제한

예제 입력 1

3 2

예제 출력 1

3.2000000000000

예제 입력 2

0 29

예제 출력 2

536870912.0000000000000

예제 입력 3

30 0

예제 출력 3

Extreme Wealth

예제 입력 4

37 73

예제 출력 4

5028.4888595832190

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2021 > Day 5: Almost Retired Dandelion Contest, ICPC Camp Contest 2 L번

Contest > Open Cup > 2020/2021 Season > Stage 11: Grand Prix of Nizhny Novgorod L번

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

출처

대학교 대회

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

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