QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 32 MB Total points: 10

#10379. Unlucky [A]

الإحصائيات

Quite unluckily Byteasar has found himself in the middle of a desert, $ s $ meters from the closest oasis.

Lucky enough, Byteasar has a compass and he perfectly knows in which direction he should go to reach the oasis. He has $ w $ milliliters of water with him, but he is able to carry at most $ k $ milliliters at a time. Walking one meter requires drinking one milliliter of water for Byteasar; for simplicity we assume that Byteasar drinks water at a fixed pace, e.g. after walking 1 / 3 meters he has drunk 1 / 3 milliliters of water. At each moment of time Byteasar can put aside any amount of water that he can drink later. Sometimes it may pay him off to come back for water that he has left behind.

To prevent further unlucky coincidence, Byteasar would like to bring as much water to the oasis as possible (who knows if there is any water in that oasis, anyway?). How much water is he able to bring?

We assume that Byteasar is able to reach the oasis if he chooses a smart enough water-drinking strategy.

Input Format

The first line of the standard input contains three integers $ s $, $ w $ and $ k $ ($10 \le s , w, k \leq 100\,000\,000$) that represent Byteasar's distance from the oasis, the quantity of water that he has and the maximum quantity of water that he can carry.

Output Format

Your program should write to the standard output one real number: the maximum volume of water (in milliliters) that Byteasar can bring to the oasis. The number should be written with three digits after the dot. Your solution will be accepted if it differs from the exact result by at most $10^{-3}$.

Example

Input

10 30 10

Output

5.333

Discussions

About Discussions

The discussion section is only for posting: Editorials, 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. Submitting multiple issues may cause your account to be banned.
  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.