QOJ.ac

QOJ

Time Limit: 3 s Memory Limit: 256 MB Total points: 100

#968. 극도의 부

Statistics

카지노에서 일하는 친구를 둔 당신은 이를 이용하기로 했습니다. 당신은 정확히 $R + B$ 번의 룰렛 게임을 하게 되며, 내부 정보를 통해 공이 정확히 $R$ 번 빨간색(Red)에 떨어지고, 나머지 $B$ 번은 검은색(Black)에 떨어진다는 것을 알고 있습니다.

당신은 초기 자본 $1$을 가지고 시작하며, 매 회전마다 현재 가진 돈의 일부(정수일 필요는 없음)를 빨간색이나 검은색에 걸 수 있습니다. 한 회전에 두 색깔 모두에 걸 수는 없습니다. 걸지 않은 돈은 그대로 유지됩니다. 색깔을 맞히면 건 돈의 두 배를 돌려받고, 틀리면 건 돈을 모두 잃습니다.

최적으로 플레이할 때, 게임 종료 시 자본이 최소 $X$가 됨을 보장할 수 있는 최대 $X$는 얼마입니까? 만약 $X > 10^9$라면 정확한 값은 중요하지 않으므로 "Extreme Wealth"를 출력하십시오.

입력

한 줄에 두 정수 $R$과 $B$ ($0 \le R, B \le 10^{13}$)가 주어집니다.

출력

$X$가 $10^9$ 이하인 경우 최대 $X$ 값을 출력하고, 그렇지 않으면 "Extreme Wealth"를 출력하십시오(따옴표 제외).

"Extreme Wealth"라는 답은 실제 $X$ 값이 최소 $0.99 \cdot 10^9$ 이상일 때 정답으로 간주됩니다. $X$라는 답은 실제 $X$ 값이 최대 $1.01 \cdot 10^9$ 이하이고 $\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

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#324EditorialOpen题解jiangly2025-12-14 07:05:28View

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.