A bookshelf has length L and borders of height h. A book of
height H is standing vertically at its left side. Bibliophile gnomes
want to drop the book onto the shelf. For that, they pull the lower edge of the
book to the right along the surface of the shelf. The left side of the
book remains leaning on the left border of the shelf. The gnomes pull the book
until it lies horizontally on the shelf. However, the gravity may get in their
way: if the center of the book gets too far beyond the left edge of the shelf, the
book may overturn and fall to the floor.
Let us assume that the book, shelf, and borders of the shelf have zero width.
It is required to find how far to the left the center of the book can get
in the process of the motion.
The only input line contains the integers h, H, and L
(1 ≤ h < H < L ≤ 1000).
Output the value of the maximal displacement to the left of the center of the
book with respect to the left side of the shelf
accurate up to at least 10−5.
7 120 200
Problem Author: Dmitry Ivankov
Problem Source: XI USU Open Personal Contest (March 13, 2010)