Problem: N people run a marathon. There are M resting places on the way. For each resting place, the i-th runner takes a break with probability P_i percent. When the i-th runner takes a break, he gets rest for T_i time.

The i-th runner runs at constant speed V_i, and the distance of the marathon is L.

You are requested to compute the probability for each runner to win the first place. If a runner arrives at the goal with another person at the same time, they are not considered to win the first place.



Input

A dataset is given in the following format:

N M L
P_1 T_1 V_1
P_2 T_2 V_2
...
P_N T_N V_N


The first line of a dataset contains three integers N (1 \leq N \leq 100), M (0 \leq M \leq 50) and L (1 \leq L \leq 100,000). N is the number of runners. M is the number of resting places. L is the distance of the marathon.

Each of the following N lines contains three integers P_i (0 \leq P_i \leq 100), T_i (0 \leq T_i \leq 100) and V_i (0 \leq V_i \leq 100) describing the i-th runner. P_i is the probability to take a break. T_i is the time of resting. V_i is the speed.

Output

For each runner, you should answer the probability of winning. The i-th line in the output should be the probability that the i-th runner wins the marathon. Each number in the output should not contain an error greater than 10^{-5}.

Examples

Input

2 2 50
30 50 1
30 50 2


Output

0.28770000
0.71230000


Input

2 1 100
100 100 10
0 100 1


Output

0.00000000
1.00000000


Input

3 1 100
50 1 1
50 1 1
50 1 1


Output

0.12500000
0.12500000
0.12500000


Input

2 2 50
30 0 1
30 50 2


Output

0.51000000
0.49000000

Solution (in CPP):

Solution:
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	double P,T,V;
};

int calc(int x,int y){
	if(y == 0){
		return x;
	}else{
		return calc(y,x%y);
	}
}

int main(){

	int N,M;
	double L;

	scanf("%d %d %lf",&N,&M,&L);


	int mCk[M+1][M+1];
	for(int i = 0; i <= M; i++){
		for(int k = 0; k <= M; k++)mCk[i][k] = 1;
	}

	int bunshi[51],bunbo[51],common;

	for(int k = 0; k <= M; k++){

		for(int a = 0; a < k; a++)bunshi[a] = (M-a);
		for(int a = 0; a < k; a++)bunbo[a] = (k-a);

		for(int shita = 0; shita < k; shita++){
			for(int ue = 0; ue < k; ue++){

				if(bunshi[ue] >= bunbo[shita]){
					common = calc(bunshi[ue],bunbo[shita]);
				}else{
					common = calc(bunbo[shita],bunshi[ue]);
				}
				bunshi[ue] /= common;
				bunbo[shita] /= common;
			}
		}

		for(int a = 0; a < k; a++)mCk[k][a] = bunshi[a];
	}

	Info info[N];

	for(int i = 0; i < N; i++){
		scanf("%lf %lf %lf",&info[i].P,&info[i].T,&info[i].V);
		info[i].P /= 100.0;
	}

	double time[N][M+1];

	for(int i = 0; i < N; i++){
		for(int k = 0; k <= M; k++){
			time[i][k] = L/info[i].V + k*info[i].T;
		}
	}

	double table[N][M+1],base;

	for(int i = 0; i < N; i++){
		for(int k = 0; k <= M; k++){
			base = 1.0;
			for(int a = 0; a < k; a++){
				base *= info[i].P;
			}
			for(int a = 0; a < M-k; a++){
				base *= (1.0-info[i].P);
			}
			for(int a = 0; a < k; a++){
				base *= mCk[k][a];
			}
			table[i][k] = base;
		}
	}


	double win,base_time,tmp,tmp2;
	bool FLG;

	for(int i = 0; i < N; i++){
		win = 0.0;

		FLG = true;
		for(int k = 0; k <= M; k++){

			base_time = time[i][k];
			tmp = 1.0;
			for(int enemy = 0; enemy < N; enemy++){
				if(enemy == i)continue;

				FLG = false;
				tmp2 = 0.0;
				for(int a = 0; a <= M; a++){
					if(time[enemy][a] > base_time){
						tmp2 += table[enemy][a];
						FLG = true;
					}
				}
				if(!FLG)break;
				tmp *= tmp2;
			}
			if(!FLG){
				break;
			}else{
				win += table[i][k]*tmp;
			}
		}
		printf("%.8lf\n",win);
	}

	return 0;
}