A girl named Xenia has a cupboard that looks like an arc from ahead. The arc is made of a semicircle with radius r (the cupboard's top) and two walls of height h (the cupboard's sides). The cupboard's depth is r, that is, it looks like a rectangle with base r and height h + r from the sides. The figure below shows what the cupboard looks like (the front view is on the left, the side view is on the right). [Image] 

Xenia got lots of balloons for her birthday. The girl hates the mess, so she wants to store the balloons in the cupboard. Luckily, each balloon is a sphere with radius $\frac{r}{2}$. Help Xenia calculate the maximum number of balloons she can put in her cupboard. 

You can say that a balloon is in the cupboard if you can't see any part of the balloon on the left or right view. The balloons in the cupboard can touch each other. It is not allowed to squeeze the balloons or deform them in any way. You can assume that the cupboard's walls are negligibly thin.


-----Input-----

The single line contains two integers r, h (1 ≤ r, h ≤ 10^7).


-----Output-----

Print a single integer — the maximum number of balloons Xenia can put in the cupboard.


-----Examples-----
Input
1 1

Output
3

Input
1 2

Output
5

Input
2 1

Output
2

Difficulty: HARD
Tags: Geometry

Starter code:

Solutions:
(r, h) = list(map(int, input().split()))
a = 2 * (h // r)
h = h % r
print(a + 1 + (2 * h >= r) + (4 * h * h >= 3 * r * r))


import math
(r, h) = map(int, input().split())
a = h // r * 2
if 2 * (h % r) >= math.sqrt(3) * r:
	a += 3
elif 2 * (h % r) >= r:
	a += 2
else:
	a += 1
print(a)


from math import sqrt
(r, h) = list(map(int, input().split()))
num = h // r
rem = h % r
ans = num * 2
if rem * 2 < r:
	ans += 1
elif rem * 2 >= sqrt(3) * r:
	ans += 3
else:
	ans += 2
print(ans)


from math import sqrt
(r, h) = (int(x) for x in input().split(' '))
in_box = 2 * h // r + 1
remainder = h % r + r
height = r * sqrt(3) / 2 + r
if remainder < height:
	print(in_box)
else:
	print(in_box + 1)


(r, h) = map(int, input().split())
res = h // r * 2
if 2 * (h % r) >= 3 ** 0.5 * r:
	res += 3
elif 2 * (h % r) >= r:
	res += 2
else:
	res += 1
print(res)


3
(r, h) = tuple(map(int, input().split()))
ans = (2 * h + r) // (2 * r)
print(2 * ans + (3 * r ** 2 <= 4 * (h + r - ans * r) ** 2))


(r, h) = map(int, input().split())
half_count = (2 * h + r) // (2 * r)
res = 2 * half_count
x1 = 0
y1 = h + r / 2
x2 = r / 2
y2 = r * (2 * half_count - 1) / 2
if (x1 - x2) ** 2 + (y1 - y2) ** 2 >= r * r:
	res += 1
print(res)


import math
(r, h) = [int(r) for r in input().split(' ')]
print(math.floor(h / r * 2 + 1 + math.floor(h % r / r + 0.15)))


from math import *
(r, h) = map(int, input().split())
d = h % r
if d * 2 < r:
	print(h // r * 2 + 1)
elif sqrt(3) * (r / 2) + r - 1e-06 <= d + r:
	print(h // r * 2 + 3)
else:
	print(h // r * 2 + 2)


(r, h) = list(map(int, input().split()))
a = 1 + 2 * h // r
if h % r >= 3 ** 0.5 * r / 2:
	a += 1
print(a)


(r, h) = list(map(int, input().split()))
ans = h // r * 2
h %= r
if 2 * h < r:
	ans += 1
elif 2 * h < 1.732 * r:
	ans += 2
else:
	ans += 3
print(ans)


(r, h) = map(int, input().split())
h *= 2
if h < r:
	print(1)
	return
r *= 2
ans = (h + r // 2) // r * 2
h -= r * (ans // 2 - 1)
if h ** 2 * 4 >= r ** 2 * 3:
	ans += 1
print(ans)


from math import sqrt
(r, h) = map(int, input().split())
count = h // r * 2
h -= h // r * r
if h >= sqrt(3) / 2 * r:
	count += 3
elif h >= r / 2:
	count += 2
else:
	count += 1
print(count)


(r, h) = map(int, input().split())
ans = int(h // (r / 2))
balloons = ans + ans % 2
if balloons == 0:
	dist = r + 1
else:
	dist = ((r / 2) ** 2 + (h - (balloons // 2 - 1) * r) ** 2) ** 0.5
if dist >= r:
	balloons += 1
print(balloons)


(r, h) = map(int, input().split())
k = h // r * 2
d = h % r
if d >= 2 * r / 3 + 1:
	k += 3
elif d >= r / 2:
	k += 2
else:
	k += 1
print(k)


from math import sqrt
(r, h) = tuple(map(int, input().split()))
ans = (2 * h + r) // (2 * r)
print(2 * ans + (ans * r + sqrt(3.0) * r / 2 <= h + r))


(r, h) = map(int, input().split())
(d, p) = (3 ** 0.5 / 2 - 1, h / r)
print(max(1 + 2 * int(p - d), 2 * int(p + 0.5)))


from math import sqrt
(r, h) = [int(x) for x in input().split()]
r <<= 1
h <<= 1
ans = h // r * 2
h %= r
if h >= r // 2:
	ans += 2
	if 3 * r * r <= 4 * h * h:
		ans += 1
else:
	ans += 1
print(ans)


def __starting_point():
	inp = input()
	arr = inp.split(' ')
	r = int(arr[0])
	h = int(arr[1])
	ans = 2 * (h // r)
	d = h % r
	if d * 2 >= r:
		ans += 2
		if 4 * d * d >= 3 * r * r:
			ans += 1
	else:
		ans += 1
	print(ans)
__starting_point()


(r, h) = map(int, input().split())
s = h % r
a = h // r * 2
if s * s >= 3 * r * r / 4:
	a += 3
elif 2 * s >= r:
	a += 2
else:
	a += 1
print(a)


(r, h) = map(int, input().split())
h *= 2
if h < r:
	print(1)
	exit(0)
r *= 2
ans = (h + r // 2) // r * 2
h -= r * (ans // 2 - 1)
if h ** 2 * 4 >= r ** 2 * 3:
	ans += 1
print(ans)