QOJ.ac

QOJ

시간 제한: 5.0 s 메모리 제한: 1024 MB 총점: 100

#14420. This Time I Will Be Lucky

통계

בקזינו יש שק ובו $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

הערה

אל תשכחו להשתמש ב-setprecision אם אתם משתמשים ב-C++.

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.