// Задача "Футбол"
// 14-ая личная Интернет-олимпиада сезона 2007-2008, 
// Автор задачи: Федор Царев, tsarev@rain.ifmo.ru
// Автор решения: Федор Царев, tsarev@rain.ifmo.ru

import java.io.*;
import java.util.*;

public class football_ft_bug implements Runnable {

	private Scanner in;
	private PrintWriter out;
	String fname = "football";

	private void myAssert(boolean e, String message) {
		if (!e) {
			throw new Error("Assertion failure!!! " + message);
		}
	}

	double calc(double t, double x11, double y11, double x12, double y12, 
					      double x21, double y21, double x22, double y22) {
					     
		double d1 = Math.hypot(x11 - x12, y11 - y12);
		double d2 = Math.hypot(x21 - x22, y21 - y22);
		double v1 = d1 / t;
		double v2 = d2 / t;
		double x01 = x11;
		double y01 = y11;
		double x02 = x21;
		double y02 = y21;
		double vx1 = (x12 - x11) / d1 * v1;
		double vy1 = (y12 - y11) / d1 * v1;
		double vx2 = (x22 - x21) / d2 * v2;
		double vy2 = (y22 - y21) / d2 * v2;
		double dx = x01 - x02;
		double dvx = vx1 - vx2;
		double dy = y01 - y02;
		double dvy = vy1 - vy2;
		double a = dvx * dvx + dvy * dvy;
		double b = 2 * dx * dvx + 2 * dvy * dy;
		double c = dx * dx + dy * dy - r * r;
		double d = b * b - 4 * a * c;
		if (d < 0) {
			return t;
		}
		d = Math.sqrt(d);
		double t1 = (-b - d) / (2 * a);
		double t2 = (-b + d) / (2 * a);
		double l = Math.max(t1, 0);
		double r = Math.min(t2, t);
		return Math.max(0, r - l);
	}

	double r;

	public void solve() {
		int n = in.nextInt();
		r = in.nextInt();
		double[] xp = new double[n];
		double[] yp = new double[n];
		double[] t = new double[n];
		double[] xb = new double[n];
		double[] yb = new double[n];
		for (int i = 0; i < n; i++) {
			t[i] = in.nextInt();
			xp[i] = in.nextInt();
			yp[i] = in.nextInt();
			xb[i] = in.nextInt();
			yb[i] = in.nextInt();
		}
		double ans = 0;
		for (int i = 0; i + 1< n; i++) {
			ans += calc(t[i + 1] - t[i], xp[i], yp[i], xp[i + 1], yp[i + 1], 
					   					 xb[i], yb[i], xb[i + 1], yb[i + 1]);			
		}
		out.println(ans);
	}

	public void run() {
		try {
			solve();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		} finally {
			out.close();
		}		
	}

	public football_ft_bug() {
		try {
			in = new Scanner(new File(fname + ".in"));
			out = new PrintWriter(new File(fname + ".out"));
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}


	public static void main(String[] args) {
		Locale.setDefault(Locale.US);
		new Thread(new football_ft_bug()).start();
	}

}                       