eolymp
bolt
Try our new interface for solving problems
Problems

A triangle of maximal area

A triangle of maximal area

On the plane, given a circle of radius \textbf{R}. From it cut two circles of radii \textbf{R_1} and \textbf{R_2} such that \textbf{R_1} + \textbf{R_2} = \textbf{R}. Find the maximum area of a triangle that can fit into the resulting figure. \InputFile The input data contain a variety of test cases (no more \textbf{100 000}). Each test case is recorded in a separate row two numbers \textbf{R_1} and \textbf{R_2} (\textbf{1} ≤ \textbf{R_1}, \textbf{R_2} ≤ \textbf{10^6}) -- radii of circles. Numbers separated by a space. Input ends with \textbf{EOF}. \OutputFile For each pair of radii of the input data output to a row in the maximum area of the inscribed triangle with an absolute or relative error \textbf{10^\{--8\}}.
Time limit 1 second
Memory limit 256 MiB
Input example #1
1 4
Output example #1
5.8656968895435
Author A. Milanin
Source ACM, Ukraine, First Stage, 09.04.2011