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: interview

Starter code:

Solutions:
from math import *

r, h = list(map(int, input().split()))
d = h % r

if d * 2 < r:
    print(h // r * 2 + 1)
elif sqrt(3) * (r / 2) + r - 1e-6 <= d + r:
    print(h // r * 2 + 3)
else:
    print(h // r * 2 + 2)


from math import sqrt

r,h = list(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())
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)



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()

3

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))


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 = list(map(int, input().split()))
a = 1 + 2 * h // r
if h % r >=3 ** 0.5 * r / 2:
    a += 1
print(a)


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)


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)

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)))

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

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)

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)))
# print((h % r) / r)


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))



# Made By Mostafa_Khaled


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)


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

#!/bin/python
from math import sqrt

r, h = (int(x) for x in input().split(' '))

# You can always put two in each "row" of the rectangle and one in the dome
in_box = 2 * h // r + 1

# You can add an additional one, like so:
#  O
# O
#
# since they all have radius r/2, you can get the height needed to add an additional one through Pythagorean theorem
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())
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)

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)