Codeforces Round 320 (Div. 1) [Bayan Thanks-Round]
A
A Problem about Polyline
Codeforces
1700
原题
←B →
翻译中…

There is a polyline going through points $(0, 0) – (*x*, *x*) – (2*x*, 0) – (3*x*, *x*) – (4*x*, 0) – ... - (2*kx*, 0) – (2*kx* + *x*, *x*) – ...$.

翻译中…

We know that the polyline passes through the point $(*a*, *b*)$. Find minimum positive value $*x*$ such that it is true or determine that there is no such $*x*$.

翻译中…

Input

翻译中…

Only one line containing two positive integers $*a*$ and $*b*$ ($1 ≤ *a*, *b* ≤ 10^{9}$).

翻译中…

Output

翻译中…

Output the only line containing the answer. Your answer will be considered correct if its relative or absolute error doesn't exceed $10^{ - 9}$. If there is no such $*x*$ then output $- 1$ as the answer.

翻译中…

Note

翻译中…

You can see following graphs for sample 1 and sample 3.

翻译中…

image

翻译中…

image

翻译中…

样例

Input #1
3 1
Output #1
1.000000000000
InputCopy OutputCopy
Input #2
1 3
Output #2
-1
InputCopy OutputCopy
Input #3
4 1
Output #3
1.250000000000
InputCopy OutputCopy
题目信息
题号
578A
时间限制
1 s
内存限制
256 MB
标签
计算几何
数学

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。