Amr loves Geometry. One day he came up with a very interesting problem.

Amr has a circle of radius r and center in point (x, y). He wants the circle center to be in new position (x', y').

In one step Amr can put a pin to the border of the circle in a certain point, then rotate the circle around that pin by any angle and finally remove the pin.

Help Amr to achieve his goal in minimum number of steps.


-----Input-----

Input consists of 5 space-separated integers r, x, y, x' y' (1 ≤ r ≤ 10^5,  - 10^5 ≤ x, y, x', y' ≤ 10^5), circle radius, coordinates of original center of the circle and coordinates of destination center of the circle respectively.


-----Output-----

Output a single integer — minimum number of steps required to move the center of the circle to the destination point.


-----Examples-----
Input
2 0 0 0 4

Output
1

Input
1 1 1 4 4

Output
3

Input
4 5 6 5 6

Output
0



-----Note-----

In the first sample test the optimal way is to put a pin at point (0, 2) and rotate the circle by 180 degrees counter-clockwise (or clockwise, no matter).

[Image]

Difficulty: interview

Starter code:

Solutions:
from math import ceil
def dist(x, y):
    return (x ** 2 + y ** 2) ** 0.5
r, x, y, x2, y2 = map(int, input().split())
print(ceil(dist(x - x2, y - y2) / (2 * r)))

"""
Codeforces Contest 287 Div 2 Problem B

Author  : chaotic_iak
Language: Python 3.4.2
"""

################################################### SOLUTION

def main():
    r,x1,y1,x2,y2 = read()
    dist = ((x2-x1)**2 + (y2-y1)**2)**.5
    import math
    return math.ceil(dist/2/r)

#################################################### HELPERS



def read(mode=2):
    # 0: String
    # 1: List of strings
    # 2: List of integers
    inputs = input().strip()
    if mode == 0: return inputs
    if mode == 1: return inputs.split()
    if mode == 2: return list(map(int, inputs.split()))

def write(s="\n"):
    if s is None: s = ""
    if isinstance(s, list): s = " ".join(map(str, s))
    s = str(s)
    print(s, end="")

write(main())

from math import ceil

r, x0, y0, x1, y1 = map(int, input().split())

dist = ((x1 - x0) ** 2 + (y1 - y0) ** 2) ** 0.5

print(ceil(dist / (2 * r)))

r, x,y,a,b = [int(x) for x in input().strip().split()]
dis = ((a-x)**2 + (b-y)**2)**0.5
ct = 0
while(dis>0):
	dis-= 2*r
	ct+=1
print(ct)


from math import sqrt,ceil

r, x, y, xx, yy = map(int, input().split())
diff = sqrt((x - xx)**2 + (y - yy) ** 2)

print(ceil(ceil(diff)/(r*2)))

import math
line = input().split()
r = int(line[0])
x0 = int(line[1])
y0 = int(line[2])
x1 = int(line[3])
y1 = int(line[4])

while True:
    if x0 == x1 and y0 == y1:
        print('0')
        break
    dist = ((x1 - x0) ** 2 + (y1 - y0) ** 2) ** (1 / 2)
    print(str(math.ceil(dist / (2 * r))))
    break


import math
r, x, y, x1, y1 = map(int, input().split())
ln = math.sqrt((x-x1)**2 + (y-y1)**2)
print(math.ceil(ln/(2*r)))

import math
r,x,y,a,b=list(map(int,input().split()))

d = (a-x)*(a-x) + (b-y)*(b-y)

sd = d


d = pow(d,0.5)

di = int(d)
Q = False


if(di*di == sd):
    Q=True
else:
    di=di+1
    if(di*di==sd):
        Q=True
    else:
        di=di-2
        if(di*di==sd):
            Q=True

if(Q):
    f=0
    if(di%(2*r)!=0):
        f=1
    print(di//(2*r)+f)
else:
    di=math.floor(d)
    print(di//(2*r)+1)


r, x, y, n_x, n_y = list(map(int, input().split()))
d = 2 * r
dis = (x - n_x) ** 2 + (y - n_y) ** 2
ans = pow(dis / (d ** 2), 0.5)
if ans ** 2 == int(ans) ** 2 + 0.0:
    print(int(ans))
else:
    print(int(ans)+1)


import math

def ans():
    r, x1, y1, x2, y2= [int(i) for i in input().split()]
    d= math.sqrt(((x2- x1)**2)+((y2- y1)**2))
    #print(d, d/(2*r))
    if d%(2*r)== 0:
        print(int(d/(2*r)))
    else:
        print(int(d/(2*r))+ 1)
        
    return

ans()

from math import sqrt
s = input().split()
s = [int(s) for s in s]
r,x,y,x1,y1 = s[0],s[1],s[2],s[3],s[4]
d = sqrt((x-x1)**2+(y-y1)**2)
ans = d // (r*2)
if d > ans*r*2:
    ans += 1
print(int(ans))

        
    


def way_cut(x1,y1,x2,y2):
    return (((x1-x2)**2+(y1-y2)**2)**0.5)
r,x,y,x1,y1 = list(map(int,input().split()))
z = way_cut(x,y,x1,y1)
if z % (2 * r) == 0:
    print(int(z // (2 * r)))
else:
    print(int(z // (2 * r))+1)


from math import sqrt
from math import ceil


r, x, y, x2, y2 = list(map(int, input().split()))

print(ceil(sqrt((x-x2)**2+(y-y2)**2) / (2*r)))





import math

r, x0, y0, x1, y1 = list(map(int, input().split()))
print(math.ceil(math.sqrt((x0 - x1) ** 2 + (y0 - y1) ** 2) * .5 / r))


#! /usr/bin/python3

import decimal
import math

r, x, y, x1, y1 = map(decimal.Decimal, input().split())
r *= decimal.Decimal('2')
R = ((x - x1) ** 2 + (y - y1) ** 2) ** decimal.Decimal("0.5")
eps = decimal.Decimal('0.000000001')

print(math.floor((R + r - eps) / r))

from math import hypot
r, x, y, xn, yn = map(int, input().split())
d = hypot(x - xn, y - yn)
ans = 0
if d == r or d == 0:
    print(0)
elif d < r:
    print(1)
else:
    mama = 0
    while mama < d:
        mama += 2 * r
        ans += 1
    print(ans)

from math import sqrt

__author__ = 'Konrad Strack'


def solve():
    r, x1, y1, x2, y2 = [int(x) for x in input().split()]

    d = sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2)

    steps = int(d // (2 * r))
    if steps * (2 * r) < d:
        steps += 1

    print(steps)


def __starting_point():
    solve()
__starting_point()

from math import sqrt as S
r,x,y,X,Y=list(map(int,input().split()))
D=(x-X)*(x-X)+(y-Y)*(y-Y)
d=S(D)
r*=2
k=d/r
j=int(k)
T=j*r
T=T*T
if T!=D:j+=1
print(j)


r, x1, y1, x2, y2 = (float(x) for x in input().split())
dest = ((x1-x2)**2 + (y1-y2)**2)**0.5
if x1 == x2 and y1 == y2:
	print(0)
else:
	res = 0
	while dest > 0:
		dest -= 2*r
		res += 1
	print(res)

import sys


def main():
	[r0, x0, y0, x1, y1] = list(map(int, sys.stdin.readline().split()))
	distance2 = (x1 - x0)*(x1 - x0) + (y1 - y0)*(y1 - y0)

	r = 2*r0

	n = int((distance2 ** 0.5) / r) + 1

	if (n * r)**2 == distance2:
		print(n)
		return

	if ((n-1) * r)**2 == distance2:
		print(n-1)
		return

	if ((n+1) * r)**2 == distance2:
		print(n+1)
		return

	print(n)


main()



__author__ = 'Hippskill'
import math
def main():
    rdl = list(map(int,input().split()))
    way = math.sqrt((max(rdl[1],rdl[3])-min(rdl[1],rdl[3]))**2+(max(rdl[4],rdl[2])-min(rdl[2],rdl[4]))**2)
    rdl[0] = rdl[0]*2
    print(math.ceil(way/rdl[0]))
main()

def up(a,b):
    if a/b == int(a/b):
        return a/b
    return int(a/b)+1

r,x,y,x1,y1=map(int, input().split())
dis = ((x1-x)**2+(y1-y)**2)**.5
print(int(up(dis,2*r)))

import math
(r,xa,ya,xb,yb) = [int(x) for x in input().split()]
print(int(math.ceil(math.sqrt((xb-xa)**2+(yb-ya)**2)/(2*r))))


from math import ceil, hypot

r,x,y,xx,yy = list(map(float, input().split()))
print(ceil(hypot(xx-x, yy-y)/2/r))


import math
r, x, y, x1, y1 = list(map(int, input().split()))
dist = ((x-x1)**2 + (y-y1)**2)**0.5
print(math.ceil(dist / (2*r)))