#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>
#include <cassert>
using namespace std;

const int MAX_N = 1509;
const double PI = atan(1.0)*4.0;
const pair<double, double> nothing = make_pair(0,0);

int N, K;

double dp[MAX_N][MAX_N + 1][2];
double xs[MAX_N], ys[MAX_N], rs[MAX_N];

int next_idx[MAX_N];
int cover_next[MAX_N];
vector< pair<double, double> > ranges;

//pxÌæÔÖf[^ðÏ··é
void convert(){

	ranges.assign(N, nothing);
	for(int i=0; i<N; i++)if(ys[i] + rs[i] > 0){
		complex<double> center(xs[i], ys[i]);
		double r = rs[i];
		ranges[i].first = arg(center) - asin(r/abs(center));
		ranges[i].second = arg(center) + asin(r/abs(center));

		if( ranges[i].first < -PI ){
			ranges[i].first += 2*PI;
		}
		if( ranges[i].second > PI){
			ranges[i].second -= 2*PI;
		}

		if( xs[i] > 0 && ys[i] - rs[i] <= 0){
			ranges[i].first = 0.0;
		}
		if( xs[i] < 0 && ys[i] - rs[i] <= 0){
			ranges[i].second = PI;
		}
	}

}

//³ÊÈæÔð¸çµ½èAÌindexðß½è
void init(){
	convert();

	for(int i=0; i<N; i++){
		assert(ranges[i].first <= ranges[i].second);
//		assert(0 <= ranges[i].first && ranges[i].second <= PI);
	}


	vector< pair<double, double> > tmp;
	sort(ranges.begin(), ranges.end());
	for(int i=0; i<N; i++)if(ranges[i] != nothing){
		bool ok = true;
		for(int j=0; j<N; j++)if(i!=j){
			if(ranges[j].first <= ranges[i].first && ranges[i].second <= ranges[j].second){
				ok = false;
			}
		}
		if(ok){
			tmp.push_back(ranges[i]);
		}
		else{
			ranges[i] = nothing;
		}
	}

	ranges = tmp;
	N = ranges.size();
	K = min(K, N);

	//¶[Å\[g
	sort(ranges.begin(), ranges.end());

	//í¢·éÅêÔ¾ÈàÌ
	fill(cover_next, cover_next+N, -1);
	for(int i=0; i<N-1; i++){
		double most_right = ranges[i].second;
		for(int j=i+1; j<N; j++){
			if(ranges[j].first <= ranges[i].second && most_right < ranges[j].second){
				most_right = ranges[j].second;
				cover_next[i] = j;
			}
		}
	}

	//í¢µÈ¢ÅÌàÌ
	fill(next_idx, next_idx+N, N);
	for(int i=0; i<N-1; i++){
		if(cover_next[i] == -1){
			next_idx[i] = i + 1;
		}
		else if(cover_next[i] < N-1){
			next_idx[i] = cover_next[i]+1;
		}
	}


	if(0)for(int i=0; i<N; i++){
		printf("[%f, %f], c_n:%d, ncn:%d\n", ranges[i].first, ranges[i].second, cover_next[i],next_idx[i]);
	}

	for(int i=0; i<N; i++){
		assert( ranges[i].second - ranges[i].first > 0);
	}

}


double solve(){
	init();
	if(N==0){
		return 0.0;
	}
	//dp[i][j][k] = {iÔÚÜÅ©½B±êÜÅÉjÂgÁ½B
	//                 k=0ÈçiÔÚÍgÁÄÈ¢Ak=1ÈçiÔÚðgÁÄ¢é
	//k=0ÉÂ¢ÄÍiÔÚÌæÔÍ»êÜÅÌÆI[o[bvµÈ¢
	for(int i=0; i<N; i++){
		for(int j=0; j<=K; j++){

			int next = cover_next[i];
			int non_cover_next = next_idx[i];

			//½à¹¸ÉpX
			dp[i+1][j][0] = max(dp[i+1][j][0], dp[i][j][0]);
			dp[non_cover_next][j][0] = max(dp[non_cover_next][j][0], dp[i][j][1]);

			//Vµ­Ìp·é
			if(j < K){
				dp[i][j+1][1] = max(dp[i][j+1][1], dp[i][j][0] + (ranges[i].second - ranges[i].first));
			}

			//dÈÁÄéªª éÌðLÎ·
			if(next != -1 && j < K){
				dp[next][j+1][1] = max(dp[next][j+1][1], dp[i][j][1] + (ranges[next].second - ranges[i].second));
			}
		}
	}

	double ans = 0.0;
	for(int i=0; i<=K; i++)for(int k=0; k<2; k++){
		ans = max(ans, dp[N][i][k]);
	}

	return ans/PI;
}


int main(){

	scanf("%d%d",&N,&K);
	for(int i=0; i<N; i++){
		scanf("%lf%lf%lf", xs+i, ys+i, rs+i);
	}

	printf("%.7f\n", solve());

	return 0;
}

Measured memory_bytes: 24000