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*.
Only one line containing two positive integers *a* and *b* (1 ≤ *a*, *b* ≤ 10<sup class="upper-index">9</sup>).
from math import ceil, log, floor, sqrt
import math	
	
	
k = 1	
def mod_expo(n, p, m):
	"""find (n^p)%m"""
	result = 1
	while p != 0:
		if p%2 == 1:
			result = (result * n)%m
		p //= 2
		n = (n * n)%m
	return result
	
def is_prime(n):
	m = 2
	while m*m <= n:
		if n%m == 0:
			return False
		m += 1
	return True
	
def find_left_x(x, y):
	x0 = (x-y)/(2*k)
	#print(x0, 2*k)
	if x0 < y:
		return -1
	return x0

def find_right_x(x, y):
	x0 = (x+y)/(2*k+2)	
	if x0 < y:
		return -1
	return x0
	
def get_x(x, y):
	global k 
	k = (x-y)//(2*y)
	if k < 0:
		return -1
	left, right = find_left_x(x, y), find_right_x(x, y)
	#print(k, left, right)
	if x == y:
		return x
	if left == -1 and right == -1:
		return -1
	if left == -1:
		return right
	if right == -1:
		return left
	return min(left, right)

t = 1
#t = int(input())
while t:
	t = t - 1
	points = []
	#n = int(input()) 
	a, b = map(int, input().split()) 
	#print(discover())
	# = map(int, input().split())
	#arr = list(map(int, input().strip().split()))[:n]
	#w = list(map(int, input().strip().split()))[:k]
	#for i in range(3):
	#	x, y = map(int, input().split()) 
	#	points.append((x, y))
	#s = input()
	#if happy_guests(a, b, n, m):
#		print("Yes")
#	else:
#		print("No")
	
	#print(get_res(s))
	#print(get_x(a, b))
	print("{:.10f}".format(get_x(a, b)))
