QOJ.ac

QOJ

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

#10379. Unlucky [A]

Statistics

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
About Issues

We understand that our problem archive is not perfect. If you find any issues with the problem, including the statement, scoring configuration, time/memory limits, test cases, etc.

You may use this form to submit an issue regarding the problem. A problem moderator will review your issue and proceed it properly.

STOP! Before you submit an issue, please READ the following guidelines:

  1. This is not a place to publish a discussion, editorial, or requests to debug your code. Your issue will only be visible by you and problem moderators. Other users will not be able to view or reply your issues.
  2. Do not submit duplicated issues. If you have already submitted one, please wait for an moderator to review it. Submitting multiple issues will not speed up the review process and might cause your account to be banned.
  3. Issues must be filed in English or Chinese only.
  4. Be sure your issue is related to this problem. If you need to submit an issue regarding another problem, contest, category, etc., you should submit it to the corresponding page.

Active Issues 0

No issues in this category.

Closed/Resolved Issues 0

No issues in this category.