QOJ.ac

QOJ

Límite de tiempo: 5.0 s Límite de memoria: 1024 MB Puntuación total: 100

#14420. This Time I Will Be Lucky

Estadísticas

어느 카지노에 흰 공 $a$개와 검은 공 $b$개가 들어 있는 주머니가 있습니다. 주머니가 빌 때까지 우리는 주머니에서 무작위로 공 하나를 꺼낼 수 있으며, 꺼낸 공이 흰색이면 $1$달러를 얻고, 그렇지 않으면 $1$달러를 잃습니다. 그 후 꺼낸 공은 버립니다. 공을 하나도 꺼내기 전을 포함하여 언제든지 멈출 수 있습니다. 우리가 얻을 수 있는 최대 기대 이익은 얼마일까요?

입력

입력으로 공백으로 구분된 두 정수 $a$와 $b$($0 \le a, b \le 100\,000$)가 주어집니다.

출력

최대 기대 이익을 나타내는 실수 하나를 출력합니다. 절대 오차 또는 상대 오차가 최대 $10^{-6}$ 이하이면 정답으로 인정됩니다.

예제

예제 입력 1

0 0

예제 출력 1

0

예제 입력 2

3 4

예제 출력 2

0.342857142857142857

예제 입력 3

2 2

예제 출력 3

0.666666666666666666

예제 입력 4

3 0

예제 출력 4

3

노트

C++를 사용한다면 setprecision을 잊지 마세요.

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.