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	
	
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 get_x(x, y):
	x0 = -1
	num = (x-y)
	k = 1
	while True:	
		cur = num/(2*k)
		if cur < y:
			l = x0
			break
		x0 = cur
		k += 1
	x0 = -1
	num = (x+y)
	k = 1
	while True:	
		cur = num/(2*k + 2)
		if cur < y:
			r = x0
			break
		x0 = cur
		k += 1
	if l == -1:
		return r
	if r == -1:
		return l
	return min(l, r)
	
def discover():
	for i in range(24, 60):
		if is_prime(i):
			if not is_prime(pow(2, i)-1):
				print(i)
				return False
	return True

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("%.10f" % round(get_x(a, b)))
