#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<iomanip>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define dme cout<<-1<<endl;return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
const int mod=1e9+7;
const llint big=1e16+100;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
lldo gethan(lldo r,lldo hi,lldo mg){//0<=hi<mg
	if(r<mg){mg=r;}
	lldo ans=0;
	ans+=mg*sqrt(r*r-mg*mg)/2;
	ans+=r*r*(acos(hi/r)-acos(mg/r))/2;
	ans-=hi*sqrt(r*r-hi*hi)/2;
	return ans;
}
lldo getsol(lldo r,lldo hi,lldo mg,lldo ta){
	lldo hit=sqrt(r*r-hi*hi);
	if(ta<=-hit){return gethan(r,hi,mg)*2;}
	if(ta>=hit){return 0;}
	lldo mgt=sqrt(r*r-mg*mg);
	if(-hit<=ta&&ta<=-mgt){
		//cerr<<"de"<<__LINE__<<endl;
		lldo tar=sqrt(r*r-ta*ta);//ta???x??§?¨?
		return gethan(r,hi,mg)*2-gethan(r,hi,tar)+ta*(hi-tar);
	}
	
	if(mgt<=ta&&ta<=hit){
		//cerr<<"de"<<__LINE__<<endl;
		lldo tar=sqrt(r*r-ta*ta);//ta???x??§?¨?
		return gethan(r,hi,tar)+ta*(hi-tar);
	}
	//cerr<<"de"<<__LINE__<<endl;
	return gethan(r,hi,mg)-ta;
}
int main(void){
	int i,j,n,r;cin>>n>>r;
	int taka[200]={0};//??????????????????0 ??§?\????????????¢??????
	for(i=0;i<n;i++){
		int x,w,h;cin>>x>>w>>h;
		for(int j=x+100;j<min(200,100+x+w);j++){
			//99,100????¢?????????????
			taka[j]=h;
		}
	}
	lldo bmax=101,bmin=0;
	for(int h=0;h<42;h++){
		lldo gen=(bmax+bmin)/2;
		lldo solars=0;
		for(i=100-r;i<100+r;i++){
			lldo hi=min(abs(100-i),abs(99-i));
			lldo mg=max(abs(100-i),abs(99-i));
			solars+=getsol(r,hi,mg,taka[i]-gen);
		}
		//cerr<<"de gen="<<gen<<"solars="<<solars<<endl;
		if(solars>(r*r*pai/2)){bmax=gen;}
		else{bmin=gen;}
	}
	cout<<fixed<<setprecision(20)<<(bmax+bmin)/2<<endl;
	return 0;
}