UVa 10792 - The Laurel-Hardy Story

10792 - The Laurel-Hardy Story

 * http://acm.uva.es/p/v107/10792.html

Summary
Geometry Problem.

Explanation
http://acm.uva.es/p/v107/p10792b.jpg

$$ AB = 2\sqrt{r^2-(r-d)^2} $$

$$ \alpha = \sin^{-1}(\frac{r-h1}{r}) $$

$$ \beta = \sin^{-1}(\frac{r-d}{r}) $$

$$ \theta = \alpha - \beta $$

$$ h2 = h1 + AB * sin(\theta) $$

Input
2 10 10 10 10 7 6

Output
Case 1: 10.0000 Case 2: 8.0342