//* Problem  : B - Tour Guide
//* Contest  : acm.tju.edu.cn
//* Origin   : Nordic CPC 2006
//* Type     : Solution
//* Date     : 2008.05.29
//* Author   : alt
//* Language : C++
//* Compiler : Microsoft Visual C++ 8.0

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <iostream>
using namespace std;
#define int64 long long

long double x[10], y[10], dx[10], dy[10], w[10];
long double res, v;

int n;

vector <int> a;

inline long double len(long double x1, long double y1, long double x2, long double y2)
{
	long double dx = x1 - x2;
	long double dy = y1 - y2;
	return dx * dx + dy * dy;
}

inline int ok(long double t, double xx, double yy, double x, double y, double dx, double dy)
{
	double ddx = x + dx * t;
	double ddy = y + dy * t;
	double l = len(xx, yy, ddx, ddy);
	return (v * t * v * t >= l);
}

inline long double calc(long double xx, long double yy, long double x, long double y, long double dx, long double dy, int k)
{
                    /* ((xi-x)+vix*t)^2+((yi-y)+viy*t)^2=(v*t)^2
                     * ==>
                     * (xi-x)^2+2(xi-x)*vix*t+vix^2*t^2 +
                     * (yi-y)^2+2(yi-y)*viy*t+viy^2*t^2 = v^2*t^2
                     * ==>
                     * (vix^2+viy^2-v^2)* t^2    +2((xi-x)*vix+(yi-y)*viy)*t +
                     * ((xi-x)^2+(yi-y)^2 = 0
                     */
                    double a = dx*dx+dy*dy-v*v;
                    double b = 2*((x-xx)*dx+(y-yy)*dy);
                    double c = (x-xx)*(x-xx)+(y-yy)*(y-yy);
                    double t = (-b-sqrt(b*b-4*a*c))/(2*a);
					return t;
 
/*	long double sq = 
		-2.0*v*v*x*xx
		-2.0*v*v*y*yy
		+2.0*dx*dx*y*yy
		+2*dy*x*xx
		+v*v*yy*yy
		-dx*dx*y*y
		-dx*dx*yy*yy
		-dy*dy*x*x
		-dy*dy*xx*xx
		+v*v*y*y
		+2.0*xx*dx*yy*dy
		+2.0*x*y*dy*dx	
		-2.0*x*dx*yy*dy
		-2.0*xx*dx*dy*y
		+v*v*xx*xx
		+v*v*x*x;
	sq = sqrt(sq);
	long double res = -xx*dx+x*dx+y*dy-yy*dy+sq;
	return res / (v*v - dx * dx - dy * dy);*/
/*
	double l = 0, r = 10000000, m;
	while (fabs(r-l)>(1E-2))
	{
		m = (l + r) / 2.0;
		if (ok(m, xx, yy, x, y, dx, dy))
			r = m;
		else
			l = m;
	}
	return (l + r) / 2.0;*/
}

void run()
{
	long double t = 0, xx = 0, yy = 0, last = 0;
	for (int i = 0; i < n; i++)
	{
		long double tt = calc(xx, yy, x[a[i]] + dx[a[i]] * t, y[a[i]] + dy[a[i]] * t, dx[a[i]], dy[a[i]], a[i]);
		t += tt;
		xx = x[a[i]] + dx[a[i]] * t;
		yy = y[a[i]] + dy[a[i]] * t;	
		last = max(last, sqrt(len(xx, yy, 0, 0)) / w[a[i]] + t);
	}
//	if (res > max(t, last))
//	printf("%llf %llf\n", t, last);
	res = min(res, max(t, last));
//	printf("%d %d %d %d %d %d %d %d\n", a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7]);
//	printf("   %lf\n", res);
}

int main()
{
#ifdef _DEBUG
 	freopen("g.in", "r", stdin);
 	freopen("g.out", "w", stdout);
#endif
	while (scanf("%d", &n) && n)
	{
		scanf("%lf", &v);
		for (int i = 0; i < n; i++)
		{
			long double a, v;
			scanf("%lf%lf%lf%lf", &x[i], &y[i], &v, &a);
			dx[i] = v * cos(a); dy[i] = v * sin(a); w[i] = v;
		}
		res = 1E100;
		a.clear(); a.resize(n);
		for (int i = 0; i < n; i++) a[i] = i;
		do
		{
			run();
		}
		while (next_permutation(a.begin(), a.end()));
		printf("%.0lf\n", res);
	}	
	return 0;
}
