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 <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, m;
double l;
double p[1000];
double t[1000];
double v[1000];
double prob[2][101][51];
double sum[101][55];
double ans[101];

inline double Sum(int i, int j) { return sum[i][j + 1]; }

int main() {
  while (scanf("%d %d %lf", &n, &m, &l) > 0) {
    MEMSET(prob, 0);
    MEMSET(sum, 0);
    MEMSET(ans, 0);
    REP(i, n) {
      scanf("%lf %lf %lf", &p[i], &t[i], &v[i]);
      p[i] /= 100.0;
      prob[0][i][0] = 1;
      REP(j, m) {
        int prev = j & 1;
        int next = prev ^ 1;
        //MEMSET(prob[next][i], 0);
        FOREQ(k, 0, m) {
          prob[next][i][k] = (1.0 - p[i]) * prob[prev][i][k];
          assert(prob[next][i][k] >= 0.0);
          if (k != 0) {
            prob[next][i][k] += p[i] * prob[prev][i][k - 1];
          }
          assert(prob[next][i][k] >= 0.0);
        }
      }
      FOREQ(j, 0, m) {
        sum[i][j + 1] = sum[i][j] + prob[m & 1][i][j];
      }
    }


    REP(i, n) {
      if (v[i] == 0) { continue; }
      FOREQ(j, 0, m) {
        double time = l / v[i] + t[i] * j;
        if (isnan(time)) { continue; }
        double lans = 1.0;
        REP(k, n) {
          if (i == k || v[k] == 0) { continue; }
          double ntime = l / v[k];
          double lp = 1.0;
          FOREQ(cnt, 0, m) {
            if (ntime  - time > EPS) { break; }
            lp -= prob[m  & 1][k][cnt];
            assert(lp >= -EPS);
            ntime += t[k];
          }
          lans *= lp;
          if (lans == 0) { break; }
        }
        ans[i] += lans * prob[m & 1][i][j];
      }
    }
    REP(i, n) {
      printf("%.8f\n", ans[i]);
    }
  }
}