Kattis Set 07 - Graph Matching and Easier Mathematics


2021-03-01 04:00 AKST

Kattis Set 07 - Graph Matching and Easier Mathematics


2021-03-08 00:30 AKST
The end is near!
Contest is over.
Not yet started.
Contest is starting in -325 days 20:18:17

Time elapsed


Time remaining


Problem G

Pelle is building a new advanced underground drill. He wants to build the drill out of a new titanium-aluminium-magnesium alloy. Such an alloy can be mixed in many ways. If an alloy is made with the ratios $x, y, z$ ($x + y + z = 1$) of titanium, aluminium and magnesium, the alloy gets a hardness of $xy$, and a price of $x + y$ SEK per kilogram.

Pelle only has a fixed amount of money per kilogram that he can spend on alloys for his drills. What is the maximum hardness he can get on his new alloy?


The first and only line of input contains a decimal number $c$ ($0 \le c < 2$, between $1$ and $6$ digits after the decimal point) – the amount of money in SEK that Pelle can spend per kilogram alloy.


Output a single decimal number, the maximum hardness of Pelle’s alloy.

Your answer will be considered correct if you have an absolute error of at most ${10}^{-6}$.

Sample Input 1 Sample Output 1