Yo`nalishlar
Hozirda online

Statistika

Masalalar soni: 909

Foydalanuvchilar soni: 8821

Jo'natishlar soni: 714441

Muhokama yozuvlari: 4541

Yangiliklar soni: 98

Yangiliklar izohlari: 1174


So'ngi izohlar

735. The circle and line
Vaqt limiti: 1 sekund
Xotira limiti: 64 MB

There is a circle of radius R with center (x,y) and the line which is given by the coordinates of its two points. What is the length of the line segment lies inside the circle?
   Input

The string with 7 numbers is given: the radius of the circle, the coordinates x, y of the center and 2points of the line. All numbers are integers, their absolute value does not exceed 10000. 2points don’t coincide.

   Output

  Print the desired length with 5 digits after the decimal point. If the circle and the line do not intersect, print -1, if touches - print 0.

Samples

Input

Output

1

5 0 0 4 1 4 2

6.00000

 

Tayyorladi: Azat Yusupov
Text from: e-olimp.com
Mening urinishlarim(0) Muhokama (0) Jo'natish Eng yaxshi yechimlar Barcha muvaffaqiyatli urinishlar(20) Barcha urinishlar(58)