Problem:
Marathon Match
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}
.
Sample Input 1
2 2 50
30 50 1
30 50 2
Output for the Sample Input 1
0.28770000
0.71230000
Sample Input 2
2 1 100
100 100 10
0 100 1
Output for the Sample Input 2
0.00000000
1.00000000
Sample Input 3
3 1 100
50 1 1
50 1 1
50 1 1
Output for the Sample Input 3
0.12500000
0.12500000
0.12500000
Sample Input 4
2 2 50
30 0 1
30 50 2
Output for the Sample Input 4
0.51000000
0.49000000

Submitted solutions:

code_snippet: #include<bits/stdc++.h>
template <class T>
inline bool rd(T &ret) {
    char c; int sgn;
    if(c=getchar(),c==EOF) return 0;
    while(c!='-'&&(c<'0'||c>'9')) c=getchar();
    sgn=(c=='-')?-1:1;
    ret=(c=='-')?0:(c-'0');
    while(c=getchar(),c>='0'&&c<='9') ret=ret*10+(c-'0');
    ret*=sgn;
    return 1;
}
template <class T>
inline void pt(T x) {
    if (x <0) {
        putchar('-');
        x = -x;
    }
    if(x>9) pt(x/10);
    putchar(x%10+'0');
}
using namespace std;
typedef long long ll;
const int MAXN = 55;
double C[MAXN+1][MAXN+1];
void Initial()
{
    memset(C, 0, sizeof C);
    for(int i=0; i<=MAXN; ++i)
    {
        C[0][i] = 0.0;
        C[i][0] = 1.0;
    }
    for(int i=1; i<=MAXN; ++i)
    {
        for(int j=1; j<=MAXN; ++j)
        C[i][j] = C[i-1][j] + C[i-1][j-1];
    }
}
const int N = 110;
int n, m;
int l, t[N], v[N];
double p[N];
double Pow(double x, int y){
    double ans = 1.0;
    while(y){
        if(y&1)ans *= x;
        x = x*x;
        y >>= 1;
    }
    return ans;
}
double work(int x){
    double ans = 0.0;
    for(int i = 0; i <= m; i++)
    {
        double pp = C[m][i] * Pow(p[x], i) * Pow(1.0-p[x], m-i);
        for(int j = 1; j <= n; j++)
        {
            if(j == x)continue;
            double siz = 0;
            for(int k = m; k >= 0; k--)
            {
                if(l*v[j] + i*t[x]*v[j]*v[x] < l*v[x] + k*t[j]*v[x]*v[j])
                    siz += C[m][k] * Pow(p[j], k) * Pow(1.0-p[j], m-k);
                else break;
            }
            pp *= siz;
        }
        ans += pp;
    }
    return ans;
}
void input(){
    for(int i = 1; i <= n; i++)
        {
            rd(p[i]);rd(t[i]);rd(v[i]);
            p[i] /= 100.0;
        }
}
int main(){
    Initial();
    while(cin>>n>>m>>l){
        input();
        for(int i = 1; i <= n; i++)
            printf("%.10f\n", work(i));
    }
    return 0;
}
/*
30 0 12
0.5
0
13

*/
accuracy: 1
time_ms: 70
memory_kb: 3596
final_rank: 5

code_snippet: #include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) sort(ALL(v)), (v).erase(unique(ALL(v)), (v).end())
#define SZ(v) (int)v.size()
#define MIN(v) *min_element(ALL(v))
#define MAX(v) *max_element(ALL(v))
#define LB(v, x) int(lower_bound(ALL(v), (x)) - (v).begin())
#define UB(v, x) int(upper_bound(ALL(v), (x)) - (v).begin())

using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
const int inf = 0x3fffffff;
const ll INF = 0x1fffffffffffffff;

template <typename T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T, typename U> T ceil(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U> T floor(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T> int popcnt(T x) {
    return __builtin_popcountll(x);
}
template <typename T> int topbit(T x) {
    return (x == 0 ? -1 : 63 - __builtin_clzll(x));
}
template <typename T> int lowbit(T x) {
    return (x == 0 ? -1 : __builtin_ctzll(x));
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "P(" << p.first << ", " << p.second << ")";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const set<T> &set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
#ifdef LOCAL
#define show(...) _show(0, #__VA_ARGS__, __VA_ARGS__)
#else
#define show(...) true
#endif
template <typename T> void _show(int i, T name) {
    cerr << '\n';
}
template <typename T1, typename T2, typename... T3>
void _show(int i, const T1 &a, const T2 &b, const T3 &...c) {
    for (; a[i] != ',' && a[i] != '\0'; i++)
        cerr << a[i];
    cerr << ":" << b << " ";
    _show(i + 1, a, c...);
}

/**
 * @brief template
 */

int main() {
    ll N, M, L;
    cin >> N >> M >> L;
    vector<double> P(N);
    vector<ll> T(N), V(N);
    rep(i,0,N) {
        cin >> P[i] >> T[i] >> V[i];
        P[i] /= 100.0;
    }
    vector<vector<double>> X(N);
    rep(i,0,N) {
        if (V[i] == 0) continue;
        vector<double> DP(M+1,0), NewDP(M+1,0);
        DP[0] = 1;
        rep(j,0,M) {
            rep(k,0,M+1) NewDP[k] = 0;
            rep(k,0,M+1) {
                if (DP[k] == 0) continue;
                NewDP[k] += DP[k] * (1-P[i]);
                NewDP[k+1] += DP[k] * P[i];
            }
            swap(DP,NewDP);
        }
        X[i].resize(M+1);
        rep(j,0,M+1) X[i][j] = DP[j];
    }
    rep(i,0,N) {
        double ANS = 0;
        rep(j,0,X[i].size()) {
            double MUL = X[i][j];
            rep(k,0,N) {
                if (k == i) continue;
                double SUM = 0.0;
                if (X[k].empty()) SUM = 1.0;
                else {
                    rep(l,0,X[k].size()) {
                        if ((L+V[i]*T[i]*j)*V[k] < (L+V[k]*T[k]*l)*V[i]) SUM += X[k][l];
                    }
                }
                MUL *= SUM;
            }
            ANS += MUL;
        }
        printf("%.12f\n", ANS);
    }
}
accuracy: 1
time_ms: 10
memory_kb: 3592
final_rank: 1

code_snippet: #include <bits/stdc++.h>

using namespace std;

#define rep(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rrep(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define ALL(v) (v).begin(), (v).end()
#define UNIQUE(v) sort(ALL(v)), (v).erase(unique(ALL(v)), (v).end())
#define SZ(v) (int)v.size()
#define MIN(v) *min_element(ALL(v))
#define MAX(v) *max_element(ALL(v))
#define LB(v, x) int(lower_bound(ALL(v), (x)) - (v).begin())
#define UB(v, x) int(upper_bound(ALL(v), (x)) - (v).begin())

using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long;
using i128 = __int128_t;
using u128 = __uint128_t;
const int inf = 0x3fffffff;
const ll INF = 0x1fffffffffffffff;

template <typename T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T, typename U> T ceil(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U> T floor(T x, U y) {
    assert(y != 0);
    if (y < 0)
        x = -x, y = -y;
    return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T> int popcnt(T x) {
    return __builtin_popcountll(x);
}
template <typename T> int topbit(T x) {
    return (x == 0 ? -1 : 63 - __builtin_clzll(x));
}
template <typename T> int lowbit(T x) {
    return (x == 0 ? -1 : __builtin_ctzll(x));
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "P(" << p.first << ", " << p.second << ")";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
template <typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
template <typename T> ostream &operator<<(ostream &os, const set<T> &set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end())
            os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
#ifdef LOCAL
#define show(...) _show(0, #__VA_ARGS__, __VA_ARGS__)
#else
#define show(...) true
#endif
template <typename T> void _show(int i, T name) {
    cerr << '\n';
}
template <typename T1, typename T2, typename... T3>
void _show(int i, const T1 &a, const T2 &b, const T3 &...c) {
    for (; a[i] != ',' && a[i] != '\0'; i++)
        cerr << a[i];
    cerr << ":" << b << " ";
    _show(i + 1, a, c...);
}

/**
 * @brief template
 */

int main() {
    ll N, M, L;
    cin >> N >> M >> L;
    vector<double> P(N);
    vector<ll> T(N), V(N);
    rep(i,0,N) {
        cin >> P[i] >> T[i] >> V[i];
        P[i] /= 100.0;
    }
    vector<vector<double>> X(N);
    rep(i,0,N) {
        if (V[i] == 0) continue;
        vector<double> DP(M+1,0), NewDP(M+1,0);
        DP[0] = 1;
        rep(j,0,M) {
            rep(k,0,M+1) NewDP[k] = 0;
            rep(k,0,M+1) {
                if (DP[k] == 0) continue;
                NewDP[k] += DP[k] * (1-P[i]);
                NewDP[k+1] += DP[k] * P[i];
            }
            swap(DP,NewDP);
        }
        X[i].resize(M+1);
        rep(j,0,M+1) X[i][j] = DP[j];
    }
    rep(i,0,N) {
        double ANS = 0;
        rep(j,0,X[i].size()) {
            double MUL = X[i][j];
            rep(k,0,N) {
                if (k == i) continue;
                double SUM = 0.0;
                rep(l,0,X[k].size()) {
                    if ((L+V[i]*T[i]*j)*V[k] < (L+V[k]*T[k]*l)*V[i]) SUM += X[k][l];
                }
                MUL *= SUM;
            }
            ANS += MUL;
        }
        printf("%.12f\n", ANS);
    }
}
accuracy: 0.18571428571428572
time_ms: 10
memory_kb: 3612
final_rank: 13

code_snippet: #line 2 "cp-library/src/cp-template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull  = unsigned long long;
using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;
using i128 = __int128_t;
template < class T > bool chmin(T& a, T b) { if(a > b) { a = b; return true; } return false; }
template < class T > bool chmax(T& a, T b) { if(a < b) { a = b; return true; } return false; }
template < class T, class U > T ceil (T x, U y) { return (x > 0 ? (x + y - 1) / y :           x / y); }
template < class T, class U > T floor(T x, U y) { return (x > 0 ?           x / y : (x - y + 1) / y); }
int popcnt(i32 x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(i64 x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }

#line 2 "cp-library/src/utility/rep_itr.hpp"
template < class T > struct itr_rep {
    T i, d;
    constexpr itr_rep(const T i) noexcept : i(i), d(1) {}
    constexpr itr_rep(const T i, const T d) noexcept : i(i), d(d) {}
    void operator++() noexcept { i += d; }
    constexpr int operator*() const noexcept { return i; }
    constexpr bool operator!=(const itr_rep x) const noexcept { return d > 0 ? i < x.i : i > x.i; }
};

template < class T > struct rep {
    const itr_rep< T > s, t;
    constexpr rep(const T t) noexcept : s(0), t(t) {}
    constexpr rep(const T s, const T t) noexcept : s(s), t(t) {}
    constexpr rep(const T s, const T t, const T d) noexcept : s(s, d), t(t, d) {}
    constexpr auto begin() const noexcept { return s; }
    constexpr auto end  () const noexcept { return t; }
};

template < class T > struct revrep {
    const itr_rep < T > s, t;
    constexpr revrep(const T t) noexcept : s(t - 1, -1), t(-1, -1) {}
    constexpr revrep(const T s, const T t) noexcept : s(t - 1, -1), t(s - 1, -1) {}
    constexpr revrep(const T s, const T t, const T d) noexcept : s(t - 1, -d), t(s - 1, -d) {}
    constexpr auto begin() const noexcept { return s; }
    constexpr auto end  () const noexcept { return t; }
};
#line 3 "cp-library/src/utility/io.hpp"

/* 128bit integer */
istream& operator>>(istream& is, i128& x) {
    std::string s; is >> s;
    int pm = (s[0] == '-');
    x = 0;
    for(int i : rep(pm, int(s.size()))) x = x * 10 + (s[i] - '0');
    if(pm) x *= -1;
    return is;
}
ostream& operator<<(ostream& os, const i128& x) {
    if(x == 0) return os << '0';
    i128 y = x;
    if(y < 0) { os << '-'; y *= -1; }
    std::vector<int> ny;
    while(y > 0) { ny.push_back(y % 10); y /= 10; }
    for(int i : revrep(ny.size())) os << ny[i];
    return os;
}

template < class S, class T > istream& operator>>(istream& is,       std::pair< S, T >& x) { is >> x.first        >> x.second; return is; }
template < class S, class T > ostream& operator<<(ostream& os, const std::pair< S, T >& x) { os << x.first << " " << x.second; return os; }

namespace scanner {
    struct sca {
        template < class T > operator T() {
            T s; std::cin >> s; return s;
        }
    };
    struct vec {
        int n;
        vec(int n) : n(n) {}
        template < class T > operator std::vector< T >() {
            std::vector< T > v(n);
            for(T& x : v) std::cin >> x;
            return v;
        }
    };
    struct mat {
        int h, w;
        mat(int h, int w) : h(h), w(w) {}
        template < class T > operator std::vector< std::vector< T > >() {
            std::vector m(h, std::vector< T >(w));
            for(std::vector< T >& v : m) for(T& x : v) std::cin >> x;
            return m;
        }
    };
    struct speedup {
        speedup() {
            std::cin.tie(0);
            std::ios::sync_with_stdio(0);
        }
    } speedup_instance;
}
scanner::sca in() { return scanner::sca(); }
scanner::vec in(int n) { return scanner::vec(n); }
scanner::mat in(int h, int w) { return scanner::mat(h, w); }

namespace printer {
    void precision(int d) { std::cout << std::fixed << std::setprecision(d); }
    void flush() { std::cout.flush(); }
}

template < class T >
ostream& operator<<(ostream& os, const std::vector< T > a) {
    int n = a.size();
    for(int i : rep(n)) { os << a[i]; if(i != n - 1) os << ' '; }
    return os;
}

int print() { std::cout << '\n'; return 0; }
template < class head, class... tail > int print(head&& h, tail&&... t) {
    std::cout << h; if(sizeof...(tail)) std::cout << ' ';
    return print(std::forward<tail>(t)...);
}
template < class T > int print_n(const std::vector< T > a) {
    int n = a.size();
    for(int i : rep(n)) std::cout << a[i] << "\n";
    return 0;
}


#line 2 "cp-library/src/utility/key_val.hpp"

template < class K, class V >
struct key_val {
    K key; V val;
    key_val() {}
    key_val(K key, V val) : key(key), val(val) {}
    template < std::size_t Index >
    std::tuple_element_t< Index, key_val >& get() {
        if constexpr (Index == 0) return key;
        if constexpr (Index == 1) return val;
    }
};

namespace std {

template < class K, class V > struct tuple_size < key_val< K, V > > : integral_constant< size_t, 2 > {};
template < class K, class V > struct tuple_element < 0, key_val< K, V > > { using type = K; };
template < class K, class V > struct tuple_element < 1, key_val< K, V > > { using type = V; };

}
#line 2 "cp-library/src/utility/vec_op.hpp"
template < class T > key_val< int, T > max_of(const vector< T >& a) {
    int i = std::max_element(a.begin(), a.end()) - a.begin();
    return {i, a[i]};
}
template < class T > key_val< int, T > min_of(const vector< T >& a) {
    int i = std::min_element(a.begin(), a.end()) - a.begin();
    return {i, a[i]};
}
template < class S, class T > S sum_of(const vector< T >& a) {
    S sum = 0;
    for(const T x : a) sum += x;
    return sum;
}
template < class S, class T > vector< S > freq_of(const vector< T >& a, T L, T R) {
    vector< S > res(R - L, S(0));
    for(const T x : a) res[x - L] += 1;
    return res;
}
template < class S, class T > struct prefix_sum {
    vector< S > s;
    prefix_sum(const vector< T >& a) : s(a) {
        s.insert(s.begin(), S(0));
        for(int i : rep(a.size())) s[i + 1] += s[i];
    }
    // [L, R)
    S sum(int L, int R) { return s[R] - s[L]; }
};
#line 3 "cp-library/src/utility/heap.hpp"

template < class T > using heap_min = std::priority_queue< T, std::vector< T >, std::greater< T > >;
template < class T > using heap_max = std::priority_queue< T, std::vector< T >, std::less< T > >;

#line 27 "cp-library/src/cp-template.hpp"

#line 1 "cp-library/src/algorithm/bin_search.hpp"
template < class T, class F >
T bin_search(T ok, T ng, F f) {
    while(abs(ng - ok) > 1) {
        T mid = (ok + ng) / 2;
        (f(mid) ? ok : ng) = mid;
    }
    return ok;
}

template < class T, class F >
T bin_search_real(T ok, T ng, F f, int step = 80) {
    while(step--) {
        T mid = (ok + ng) / 2;
        (f(mid) ? ok : ng) = mid;
    }
    return ok;
}
#line 2 "cp-library/src/algorithm/argsort.hpp"

template < class T > std::vector< int > argsort(const std::vector< T > &a) {
    std::vector< int > ids((int)a.size());
    std::iota(ids.begin(), ids.end(), 0);
    std::sort(ids.begin(), ids.end(), [&](int i, int j) {
        return a[i] < a[j] || (a[i] == a[j] && i < j);
    });
    return ids;
}
#line 1 "macro.hpp"
namespace macro {

using size_type = int;
template < class container > void  sort(container& a) { std::sort(std:: begin(a), std:: end(a)); }
template < class container > void rsort(container& a) { std::sort(std::rbegin(a), std::rend(a)); }
template < class container > void reverse(container& a) { std::reverse(std::begin(a), std::end(a)); }
template < class container > void unique(container& a) {
    std::sort(std::begin(a), std::end(a));
    a.erase(std::unique(std::begin(a), std::end(a)), std::end(a));
}
template < class container > container  sorted(const container& a) { container b = a;  sort(b); return std::move(b); }
template < class container > container rsorted(const container& a) { container b = a; rsort(b); return std::move(b); }
template < class container, class compare > void sort(container& a, const compare& cmp) { std::sort(std::begin(a), std::end(a), cmp); }
template < class container, class compare > container sorted(const container& a, const compare& cmp) { container b = a; sort(b, cmp); return std::move(b); }
template < class container, class value > size_type lower_bound(const container& a, const value& x) { return std::lower_bound(std::begin(a), std::end(a), x) - std::begin(a); }
template < class container, class value > size_type upper_bound(const container& a, const value& x) { return std::upper_bound(std::begin(a), std::end(a), x) - std::begin(a); }

const std::vector<std::pair<size_type, size_type>> dir4 = { {+1,  0}, {-1,  0}, { 0, +1}, { 0, -1} };
const std::vector<std::pair<size_type, size_type>> dir8 = { {-1, -1}, {-1,  0}, {-1, +1}, { 0, -1}, { 0, +1}, {+1, -1}, {+1,  0}, {+1, +1} };

#ifdef _DEBUG
#define debug(x) std::cout << "[" << __LINE__ << "] " << #x << ": " << x << std::endl
#else
#define debug(x)
#endif

template < class container > void concat(container& a, const container& b) {
    a.insert(std::end(a), std::begin(b), std::end(b));
}
std::vector<size_type> iota(const size_type n) {
    std::vector<size_type> I(n);
    std::iota(std::begin(I), std::end(I), 0);
    return I;
}
template < class container > std::vector<size_type> sort_idx(const container& a) {
    const size_type n = a.size();
    std::vector<size_type> I = iota(n);
    std::sort(std::begin(I), std::end(I), [&](size_type i, size_type j) { return a[i] < a[j] or (a[i] == a[j] and i < j); });
    return I;
}
template < class container, class compare > std::vector<size_type> sort_idx(const container& a, const compare& cmp) {
    const size_type n = a.size();
    std::vector<size_type> I = iota(n);
    std::sort(std::begin(I), std::end(I), [&](size_type i, size_type j) { return cmp(a[i], a[j]) or (a[i] == a[j] and i < j); });
    return std::move(I);
}

struct grid {
    using size_type = int;
    size_type H, W;
    grid(const size_type H, const size_type W) : H(H), W(W) {}
    bool contains(const size_type i, const size_type j) {
        return 0 <= i and i < H and 0 <= j and j < W;
    }
};

} // namespace macro

using namespace macro;
#line 2 "cp-library/src/number/binom_table.hpp"

template < class T >
std::vector< std::vector< T > > binom_table(int N) {
    std::vector table(N + 1, std::vector(N + 1, T(0)));
    table[0][0] = 1;
    for(int i : rep(1, N + 1)) {
        table[i][0] = 1;
        for(int j : rep(1, N + 1))
            table[i][j] = table[i - 1][j - 1] + table[i - 1][j];
    }
    return table;
}
#line 4 "A.cpp"

int main() {
    i64 N = in(), M = in(), L = in();
    vector<i64> P(N), T(N), V(N);
    for(int i : rep(N)) P[i] = in(), T[i] = in(), V[i] = in();

    auto comb = binom_table<ld>(55);

    vector<ld> ans(N, 0.0);
    for(int i : rep(N)) {
        for(int xi = 0; xi <= M; xi++) {
            ld pxi = 1.0;
            for(int j : rep(N)) if(j != i) {
                ld cur = 0.0;
                for(int xj = 0; xj <= M; xj++) {
                    i64 lhs = V[i] * V[j] * T[i] * xi + L * V[j];
                    i64 rhs = V[i] * V[j] * T[j] * xj + L * V[i];
                    if(lhs < rhs) {
                        cur += comb[M][xj] * pow(P[j] / 100.0, xj) * pow(1.0 - P[j] / 100.0, M - xj);
                    }
                }
                pxi *= cur;
            }
            pxi *= comb[M][xi] * pow(P[i] / 100.0, xi) * pow(1.0 - P[i] / 100.0, M - xi);
            ans[i] += pxi;
        }
    }

    printer::precision(20);
    for(int i : rep(N)) print(ans[i]);
}
accuracy: 1
time_ms: 890
memory_kb: 4032
final_rank: 12

code_snippet: #include <bits/stdc++.h>
#include <chrono>
#include <thread>
////#include <atcoder/all>

//using namespace atcoder;
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using vd = vector<double>;
using vvd = vector<vd>;
using vvvd = vector<vvd>;
#define all(A) A.begin(),A.end()
#define ALL(A) A.begin(),A.end()
#define rep(i, n) for (ll i = 0; i < (ll) (n); i++)
using pqr = priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>>;

template<class T>
bool chmax(T& p, T q, bool C = 1) {
    if (C == 0 && p == q) {
        return 1;
    }
    if (p < q) {
        p = q;
        return 1;
    }
    else {
        return 0;
    }
}

double EPS = 1e-9;
template<class T>
bool chmin(T& p, T q) {
    if (p > q + EPS) {
        p = q;
        return 1;
    }
    else {
        return 0;
    }
}

ll gcd(ll(a), ll(b)) {
    if (b == 0)return a;
    ll c = a;
    while (a % b != 0) {
        c = a % b;
        a = b;
        b = c;
    }
    return b;
}

vector<ll> fact, factinv, inv;
ll mod = 998244353;
void prenCkModp(ll n) {
    fact.resize(n + 5);
    factinv.resize(n + 5);
    inv.resize(n + 5);
    fact.at(0) = fact.at(1) = 1;
    factinv.at(0) = factinv.at(1) = 1;
    inv.at(1) = 1;
    for (ll i = 2; i < n + 5; i++) {
        fact.at(i) = (fact.at(i - 1) * i) % mod;
        inv.at(i) = mod - (inv.at(mod % i) * (mod / i)) % mod;
        factinv.at(i) = (factinv.at(i - 1) * inv.at(i)) % mod;
    }

}
ll nCk(ll n, ll k) {
    if (k < 0)return 0;
    if (n < k) return 0;
    return fact.at(n) * (factinv.at(k) * factinv.at(n - k) % mod) % mod;
}
vector<string>S;
ll dfs(ll L, ll R, ll n, char c = '+') {
    ll res = 0;
    if (c == '*')res = 1;
    for (ll i = L; i <= R; i++) {
        ll d = 0;
        if (S[i].size() != n + 1)continue;
        if (S[i][n] == '+') {
            bool OK = 1;
            for (ll j = i + 1; j < R; j++) {
                if (S[j].size() == n + 1) {
                    d = dfs(i + 1, j - 1, n + 1, '+');
                    OK = 0;
                    break;
                }

            }
            if (OK)d = dfs(i + 1, R, n + 1, '+');
        }
        else if (S[i][n] == '*') {
            bool OK = 1;
            for (ll j = i + 1; j < R; j++) {
                if (S[j].size() == n + 1) {
                    d = dfs(i + 1, j - 1, n + 1, '*');
                    OK = 0;
                    break;
                }

            }
            if (OK)d = dfs(i + 1, R, n + 1, '*');
        }
        else {
            d = S[i][n] - '0';
        }
        if (c == '+')res += d;
        else res *= d;
    }
    return res;
}
unordered_map<ll, ll> MA;


int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    vvll comb(51,vll(51,0));
    rep(i,51){
        comb[i][0]=1;
        rep(j,50){
            comb[i][j+1]=comb[i][j]*double(i-j)/double(j+1);
        }
    }

    ll N,M,L;
    cin>>N>>M>>L;
    vector<tuple<double,ll,ll>> H(N);
    rep(n,N){
        double p;ll t,v;
        cin>>p>>t>>v;
        H[n]={p/100.0,t,v};
    }
    rep(n,N){
        double an=0.0;
        double p=get<0>(H[n]);
        ll t=get<1>(H[n]);
        ll v=get<2>(H[n]);
        if(v<0.5){
            cout<<0.0<<endl;
            continue;
        }
        rep(m,M+1){
            double q=double(comb[M][m])*pow(p,m)*pow(1-p,M-m);
            rep(i,N){
                if(n==i)continue;
                double res=0.0;
                double pi=get<0>(H[i]);
                ll ti=get<1>(H[i]);
                ll vi=get<2>(H[i]);
                rep(j,M+1){
                    if(L*v+j*ti*vi*v<=L*vi+m*t*vi*v)continue;
                    res+=double(comb[M][j])*pow(pi,j)*pow(1-pi,M-j);
                }
                q*=res;
            }
            an+=q;
        }
        cout<<fixed<<setprecision(16)<<an<<endl;
    }
}
accuracy: 1
time_ms: 860
memory_kb: 3996
final_rank: 10

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}
template<class t>
bool operator>(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator > b.numerator * a.denominator;
}
template<class t>
bool operator==(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator == b.numerator * a.denominator;
}

double combination(int a,int b){
    double res = 1;
    rep(i,b){
        res *= a - i;
        res /= i + 1;
    }
    return res;
}

vector<long double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,long double>;
    method(calc,vector<P>,long double p,int v,int t){
        vector<P> res;
        rep(i,m+1){
            res.emplace_back(F(l,v)+F(t*i,1),combination(m,i) * pow(1-p,m-i) * pow(p,i));
        }
        return res;
    };
    vvector<P> line;
    const F inf = F(1000000,1);
    rep(i,n){
        long double p = in() / 100.0;
        int t = in();
        int v = in();
        if(v==0){
            line.emplace_back(vector<P>({{inf,1}}));
        }else{
            line.emplace_back(calc(p,v,t));
        }
    }
    vector<long double> res;
    rep(i,n){
        long double sum = 0;
        foreach(p,line[i]){
            long double add = p.second;
            rep(j,n){
                if(i==j)continue;
                long double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())printf("%.20Lf\n",i);
    return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3748
final_rank: 6

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}
template<class t>
bool operator>(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator > b.numerator * a.denominator;
}
template<class t>
bool operator==(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator == b.numerator * a.denominator;
}

double combination(int a,int b){
    double res = 1;
    rep(i,b){
        res *= a - i;
        res /= i + 1;
    }
    return res;
}

vector<long double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,long double>;
    method(calc,vector<P>,long double p,int v,int t){
        vector<P> res;
        rep(i,m+1){
            res.emplace_back(F(l,v)+F(t*i,1),combination(m,i) * pow(1-p,m-i) * pow(p,i));
        }
        return res;
    };
    vvector<P> line;
    const F inf = F(1000000,1);
    rep(i,n){
        long double p = in() / 100.0;
        int t = in();
        int v = in();
        if(v==0){
            line.emplace_back(vector<P>({{inf,1}}));
        }else{
            line.emplace_back(calc(p,v,t));
        }
    }
    vector<long double> res;
    rep(i,n){
        long double sum = 0;
        foreach(p,line[i]){
            long double add = p.second;
            rep(j,n){
                if(i==j)continue;
                long double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())println(i);
    return 0;
}
accuracy: 0.14285714285714285
time_ms: 20
memory_kb: 3716
final_rank: 16

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}
template<class t>
bool operator>(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator > b.numerator * a.denominator;
}
template<class t>
bool operator==(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator == b.numerator * a.denominator;
}

vector<long double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,long double>;
    method(calc,vector<P>,long double p,int v,int t){
        vector<long double> dp(m+1,0);
        dp[0] = 1;
        rep(_,m){
            vector<long double> ndp(m+1,0);
            rep(i,m+1){
                ndp[i] += (1-p) * dp[i];
                if(i+1<dp.size()){
                    ndp[i+1] += p * dp[i];
                }
            }
            swap(dp,ndp);
        }
        vector<P> res;
        rep(i,dp.size()){
            res.emplace_back(F(l,v)+F(t*i,1),dp[i]);
        }
        return res;
    };
    vvector<P> line;
    const F inf = F(1000000,1);
    rep(i,n){
        long double p = in() / 100.0;
        int t = in();
        int v = in();
        if(v==0){
            line.emplace_back(vector<P>({{inf,1}}));
        }else{
            line.emplace_back(calc(p,v,t));
        }
    }
    vector<long double> res;
    rep(i,n){
        long double sum = 0;
        foreach(p,line[i]){
            long double add = p.second;
            rep(j,n){
                if(i==j)continue;
                long double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())println(i);
    return 0;
}
accuracy: 0.14285714285714285
time_ms: 20
memory_kb: 3676
final_rank: 14

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}
template<class t>
bool operator>(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator > b.numerator * a.denominator;
}
template<class t>
bool operator==(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator == b.numerator * a.denominator;
}

vector<long double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,long double>;
    method(calc,vector<P>,long double p,int v,int t){
        vector<long double> dp(m+1,0);
        dp[0] = 1;
        rep(_,m){
            vector<long double> ndp(m+1,0);
            rep(i,m+1){
                ndp[i] += (1-p) * dp[i];
                if(i+1<dp.size()){
                    ndp[i+1] += p * dp[i];
                }
            }
            swap(dp,ndp);
        }
        vector<P> res;
        rep(i,dp.size()){
            res.emplace_back(F(l,v)+F(t*i,1),dp[i]);
        }
        return res;
    };
    vvector<P> line;
    const F inf = F(1000000,1);
    rep(i,n){
        long double p = in() / 100.0;
        int t = in();
        int v = in();
        if(v==0){
            line.emplace_back(vector<P>({{inf,1}}));
        }else{
            line.emplace_back(calc(p,v,t));
        }
    }
    vector<long double> res;
    rep(i,n){
        long double sum = 0;
        foreach(p,line[i]){
            long double add = p.second;
            if(p.first==inf)continue;
            rep(j,n){
                if(i==j)continue;
                long double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())println(i);
    return 0;
}
accuracy: 0.14285714285714285
time_ms: 20
memory_kb: 3688
final_rank: 15

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}
template<class t>
bool operator>(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator > b.numerator * a.denominator;
}
template<class t>
bool operator==(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator == b.numerator * a.denominator;
}

vector<long double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,long double>;
    method(calc,vector<P>,long double p,int v,int t){
        vector<long double> dp(m+1,0);
        dp[0] = 1;
        rep(_,m){
            vector<long double> ndp(m+1,0);
            rep(i,m){
                ndp[i] += (1-p) * dp[i];
                ndp[i+1] += p * dp[i];
            }
            swap(dp,ndp);
        }
        vector<P> res;
        rep(i,dp.size()){
            res.emplace_back(F(l,v)+F(t*i,1),dp[i]);
        }
        return res;
    };
    vvector<P> line;
    const F inf = F(1000000,1);
    rep(i,n){
        long double p = in() / 100.0;
        int t = in();
        int v = in();
        if(v==0){
            line.emplace_back(vector<P>({{inf,1}}));
        }else{
            line.emplace_back(calc(p,v,t));
        }
    }
    vector<long double> res;
    rep(i,n){
        long double sum = 0;
        foreach(p,line[i]){
            long double add = p.second;
            if(p.first==inf)continue;
            rep(j,n){
                if(i==j)continue;
                long double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())println(i);
    return 0;
}
accuracy: 0.14285714285714285
time_ms: 20
memory_kb: 3764
final_rank: 20

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}
template<class t>
bool operator>(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator > b.numerator * a.denominator;
}
template<class t>
bool operator==(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator == b.numerator * a.denominator;
}

vector<double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,double>;
    method(calc,vector<P>,double p,int v,int t){
        vector<double> dp(m+1,0);
        dp[0] = 1;
        rep(_,m){
            vector<double> ndp(m+1,0);
            rep(i,m){
                ndp[i] += (1-p) * dp[i];
                ndp[i+1] += p * dp[i];
            }
            swap(dp,ndp);
        }
        vector<P> res;
        rep(i,dp.size()){
            res.emplace_back(F(l,v)+F(t*i,1),dp[i]);
        }
        return res;
    };
    vvector<P> line;
    const F inf = F(1000000,1);
    rep(i,n){
        double p = in() / 100.0;
        int t = in();
        int v = in();
        if(v==0){
            line.emplace_back(vector<P>({{inf,1}}));
        }else{
            line.emplace_back(calc(p,v,t));
        }
    }
    vector<double> res;
    rep(i,n){
        double sum = 0;
        foreach(p,line[i]){
            double add = p.second;
            if(p.first==inf)continue;
            rep(j,n){
                if(i==j)continue;
                double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())println(i);
    return 0;
}
accuracy: 0.14285714285714285
time_ms: 20
memory_kb: 3752
final_rank: 17

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}

vector<double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,double>;
    method(calc,vector<P>,double p,int v,int t){
        vector<double> dp(m+1,0);
        dp[0] = 1;
        rep(_,m){
            vector<double> ndp(m+1,0);
            rep(i,m){
                ndp[i] += (1-p) * dp[i];
                ndp[i+1] += p * dp[i];
            }
            swap(dp,ndp);
        }
        vector<P> res;
        rep(i,dp.size()){
            res.emplace_back(F(l,v)+F(t*i,1),dp[i]);
        }
        return res;
    };
    vvector<P> line;
    rep(i,n){
        double p = in() / 100.0;
        int t = in();
        int v = in();
        if(v==0){
            line.emplace_back(vector<P>({{F(1000000,1),1}}));
        }else{
            line.emplace_back(calc(p,v,t));
        }
    }
    vector<double> res;
    rep(i,n){
        double sum = 0;
        foreach(p,line[i]){
            double add = p.second;
            rep(j,n){
                if(i==j)continue;
                double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())println(i);
    return 0;
}
accuracy: 0.14285714285714285
time_ms: 20
memory_kb: 3760
final_rank: 19

code_snippet: #include<bits/stdc++.h>
#define rep(i,a,...) for(int i = (a)*(strlen(#__VA_ARGS__)!=0);i<(int)(strlen(#__VA_ARGS__)?__VA_ARGS__:(a));++i)
#define per(i,a,...) for(int i = (strlen(#__VA_ARGS__)?__VA_ARGS__:(a))-1;i>=(int)(strlen(#__VA_ARGS__)?(a):0);--i)
#define foreach(i, n) for(auto &i:(n))
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
#define lambda(RES_TYPE, ...) (function<RES_TYPE(__VA_ARGS__)>)[&](__VA_ARGS__) -> RES_TYPE
#define method(FUNC_NAME, RES_TYPE, ...) function<RES_TYPE(__VA_ARGS__)> FUNC_NAME = lambda(RES_TYPE, __VA_ARGS__)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}
#ifdef DEBUG
#define debug(x) cout<<"LINE "<<__LINE__<<": "<<#x<<" = "<<x<<endl;
#else
#define debug(x) (void)0
#endif

namespace templates{
    ll modpow(ll x, ll b,ll mod=MOD){
        ll res = 1;
        while(b){
            if(b&1)res = res * x % mod;
            x = x * x % mod;
            b>>=1;
        }
        return res;
    }

    ll modinv(ll x){
        return modpow(x, MOD-2);
    }

    bool was_output = false;

    void print();
    template <class t> void print(const vector<t> &);
    template <class t, class u> void print(const pair<t, u> &);
    template <class t> void print(const t&);
    template <class Head, class... Tail> void print(const Head&, const Tail&...);

    template <class t> void println(const vector<vector<t>>&);
    template <class t> void println(const vector<t>&);
    template <class t> void println(const t&);
    template <class Head, class... Tail> void println(const Head&, const Tail&...);
    void println();
    void newline();

    void print(){
        return;
    }

    template <class t>
    void print(const vector<t>&x){
        for(const t&i:x)print(i);
    }
    template <class t, class u>
    void print(const pair<t,u>&p){
        print(p.first);
        print(p.second);
    }
    template <class t>
    void print(const t&x){
        if(was_output)cout<<" ";
        cout<<x;
        was_output = true;
    }
    template <class Head, class... Tail>
    void print(const Head&head,const Tail&...tail){
        print(head);
        print(tail...);
    }

    template<class t>
    void println(const vector<vector<t>>&x){
        for(vector<t> i:x)println(i);
    }
    template<class t>
    void println(const vector<t>&x){
        for(const t&i:x)print(i);
        println();
    }
    template <class t>
    void println(const t&x){
        print(x);
        println();
    }
    void println(){
        if(was_output){
            cout << endl;
            was_output = false;
        }
    }
    template <class Head, class... Tail>
    void println(const Head&head,const Tail&...tail){
        print(head);
        println(tail...);
    }

    void newline(){
        was_output = true;
        println();
    }

    template<class t>
    istream& operator>>(istream&is, vector<t>&x){
        for(auto &i:x)is >> i;
        return is;
    }

    template<class t, class u>
    istream& operator>>(istream&is, pair<t, u>&x){
        is >> x.first >> x.second;
        return is;
    }

    template<class t>
    ostream& operator<<(ostream&os, vector<t> &v){
        os << "{";
        for(t &i:v){
            os << i << ", ";
        }
        os << "}";
        return os;
    }

    template<class t = long long>
    t in(){
        t res; cin >> res; return res;
    }

    template<class t>
    vector<t> sorted(vector<t> line,function<bool(t,t)> comp=[](t a,t b){return a<b;}){
        sort(line.begin(),line.end(),comp);
        return line;
    }

    template<class t>
    vector<t> reversed(vector<t> line){
        reverse(line.begin(),line.end());
        return line;
    }
    string reversed(string str){
        reverse(str.begin(),str.end());
        return str;
    }

    long long gcd(long long a,long long b){
        while(b){
            a %= b;
            swap(a,b);
        }
        return a;
    }

    long long lcm(long long a,long long b){
        return a / gcd(a,b) * b;
    }

    class output_initializer{
    public:
        output_initializer(){
            ios::sync_with_stdio(false);
            cin.tie(nullptr);
            cout << setprecision(20);
        }
    };output_initializer OUTPUT_INITIALIZER_INSTANCE = output_initializer();
}

using namespace templates;


template<class t>
class fraction{
	public:
		t numerator;
		t denominator;

		fraction():numerator(t(0)), denominator(t(1)){}
		fraction(t a, t b):numerator(a), denominator(b){}
		fraction(const fraction &a):numerator(a.numerator), denominator(a.denominator){}

		fraction pow(long long k){
			fraction res(1, 1);
			fraction sum(*this);
			while(k){
				if(k&1)res*=sum;
				sum*=sum;
				k>>=1;
			}
			return res;
		}

		fraction& operator+=(fraction a){
			numerator = numerator * a.denominator + a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator-=(fraction a){
			numerator = numerator * a.denominator - a.numerator * denominator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator*=(fraction a){
			numerator *= a.numerator;
			denominator *= a.denominator;
			return *this;
		}

		fraction& operator/=(fraction a){
			numerator *= a.denominator;
			denominator *= a.numerator;
			return *this;
		}

		fraction operator+(fraction a){return fraction(*this) += a;}
		fraction operator-(fraction a){return fraction(*this) -= a;}
		fraction operator*(fraction a){return fraction(*this) *= a;}
		fraction operator/(fraction a){return fraction(*this) /= a;}
};

template<class t>
bool operator<(fraction<t> a,fraction<t> b){
    return a.numerator * b.denominator < b.numerator * a.denominator;
}

vector<double> func(){
    int n = in();
    int m = in();
    int l = in();
    using F = fraction<ll>;
    using P = pair<F,double>;
    method(calc,vector<P>,double p,int v,int t){
        vector<double> dp(m+1,0);
        dp[0] = 1;
        rep(_,m){
            vector<double> ndp(m+1,0);
            rep(i,m){
                ndp[i] += (1-p) * dp[i];
                ndp[i+1] += p * dp[i];
            }
            swap(dp,ndp);
        }
        vector<P> res;
        rep(i,dp.size()){
            res.emplace_back(F(l,v)+F(t*i,1),dp[i]);
        }
        return res;
    };
    vvector<P> line;
    rep(i,n){
        double p = in() / 100.0;
        int t = in();
        int v = in();
        line.emplace_back(calc(p,v,t));
    }
    vector<double> res;
    rep(i,n){
        double sum = 0;
        foreach(p,line[i]){
            double add = p.second;
            rep(j,n){
                if(i==j)continue;
                double psum = 0;
                foreach(k,line[j]){
                    if(p.first < k.first)psum += k.second;
                }
                add *= psum;
            }
            sum += add;
        }
        res.emplace_back(sum);
    }
    return res;
}

int main(){
    foreach(i,func())println(i);
    return 0;
}
accuracy: 0.14285714285714285
time_ms: 20
memory_kb: 3756
final_rank: 18

code_snippet: #include<bits/stdc++.h>
using namespace std;
using P = pair<int64_t,int64_t>;

void solve(){
  int64_t N, M, L;
  cin >> N >> M >> L;
  vector<long double> p(N);
  vector<P> vec(N);
  for(int i=0; i<N; i++){
    cin >> p[i];
    p[i] /= 100;
    int x, y;
    cin >> x >> y;
    vec[i] = P(x,y);
  }
  vector<int64_t> COM(M+1);
  vector<vector<long double>> C(N,vector<long double>(M+1));
  for(int i=0; i<=M; i++){
    if(i == 0){
      COM[i] = 1;
    }
    else{
      COM[i] = COM[i-1]*(M-i+1)/i;
    }
    for(int j=0; j<N; j++){
      C[j][i] = COM[i]*pow(p[j],i)*pow(1-p[j],M-i);
    }
  }
  for(int i=0; i<N; i++){ //person
    long double ans = 0;
    auto[a1,b1] = vec[i];
    for(int j=0; j<=M; j++){ //rest times
      long double prob = C[i][j];
      for(int k=0; k<N; k++){
        if(k == i){
          continue;
        }
        auto[a2,b2] = vec[k];
        long double prob2 = 0;
        for(int l=0; l<=M; l++){
          if(b2*(a1*j*b1 + L) < b1*(a2*l*b2 + L)){
            //cout << j << " " << k << " " << *pow(p[k],l)*pow(1-p[k],M-l) << endl;
            prob2 += C[k][l];
          }
        }
        //cout << "SUM:" << i << " " << j << " " << prob2 << endl;
        prob *= prob2;
      }
      ans += prob;
    }
    cout << fixed << setprecision(15) << ans << endl;
  }
}

int main(){
  while(true){
    solve();
    break;
  }
}
accuracy: 1
time_ms: 20
memory_kb: 3652
final_rank: 4

code_snippet: #pragma region Macros
#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
#ifdef DEBUG
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << '(' << p.first << ',' << p.second << ')';
    return os;
}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << '{';
    for(int i = 0; i < (int)v.size(); i++) {
        if(i) { os << ','; }
        os << v[i];
    }
    os << '}';
    return os;
}
void debugg() { cerr << endl; }
template <class T, class... Args>
void debugg(const T &x, const Args &... args) {
    cerr << " " << x;
    debugg(args...);
}
#define debug(...)                                                             \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]: ", debugg(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

struct Setup {
    Setup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __Setup;

using ll = long long;
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define FOR(i, a, b) for(int i = (a); i < int(b); i++)
#define REP(i, n) FOR(i, 0, n)
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
constexpr int MOD = 1000000007;

void Case(int i) { cout << "Case #" << i << ": "; }
int popcount(int x) { return __builtin_popcount(x); }
ll popcount(ll x) { return __builtin_popcountll(x); }
#pragma endregion Macros

ll C[55][55];

void init() {
    C[0][0] = 1;
    FOR(i, 1, 55) {
        C[i][0] = 1;
        FOR(j, 1, 55) {
            C[i][j] = C[i-1][j-1] + C[i-1][j];
        }
    }
}

int main() {
    init();
    int N, M, L;
    cin >> N >> M >> L;
    vector<ll> P(N), T(N), V(N);
    REP(i, N) cin >> P[i] >> T[i] >> V[i];

    vector prob(N, vector(M+1, vector<double>(M+1)));
    REP(i, N) {
        prob[i][0][0] = 1.0;
        REP(j, M) {
            REP(k, M+1) {
                prob[i][j+1][k] += prob[i][j][k] * (100 - P[i]) / 100;
                if(k < M) prob[i][j+1][k+1] += prob[i][j][k] * P[i] / 100;
            }
        }
    }

    REP(i, N) {
        if(V[i] == 0) {
            cout << 0.0 << endl;
            continue;
        }
        double ans = 0.0;
        REP(ci, M+1) {
            double p = prob[i][M][ci];
            REP(j, N) {
                if(i == j) continue;
                if(V[j] == 0) continue;
                double sum = 0;
                REP(cj, M+1) {
                    double diff = double(L)/V[i] + ci*T[i] - double(L)/V[j] - cj*T[j];
                    if(diff >= 0.0) continue;
                    sum += prob[j][M][cj];
                }
                p *= sum;
            }
            ans += p;
        }
        cout << ans << endl;
    }
}
accuracy: 1
time_ms: 20
memory_kb: 5524
final_rank: 9

code_snippet: /*	author:  Kite_kuma
	created: 2021.09.01 15:05:47 */

// #ifdef LOCAL
// #define _GLIBCXX_DEBUG
// #endif
#include <bits/stdc++.h>
using namespace std;

#pragma region macros

#define foa(s, v) for(auto &s : v)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcnt(n) __builtin_popcountll((long long)n)

#define REPname(a, b, c, d, e, ...) e
#define rep(...) REPname(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define REP0(x) for(int Counter_in_rep_macro = 0; Counter_in_rep_macro < (x); ++Counter_in_rep_macro)
#define REP1(i, x) for(int i = 0; i < (x); ++i)
#define REP2(i, l, r) for(int i = (l); i < (r); ++i)
#define REP3(i, l, r, c) for(int i = (l); i < (r); i += (c))

#define DREPname(a, b, c, d, e, ...) e
#define drep(...) DREPname(__VA_ARGS__, DREP3, DREP2, DREP1)(__VA_ARGS__)
#define DREP1(i, x) for(int i = (x)-1; i >= 0; --i)
#define DREP2(i, l, r) for(int i = (r)-1; i >= (l); --i)
#define DREP3(i, l, r, c) for(int i = (r)-1; i >= (l); i -= (c))

#pragma endregion

#pragma region aliases

using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vvvi = std::vector<std::vector<std::vector<int>>>;
using vll = std::vector<ll>;
using vvll = std::vector<vll>;
using vvvll = std::vector<vvll>;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
template <class T = ll>
using V = std::vector<T>;
template <class T = ll>
using VV = V<V<T>>;
template <class T = ll>
using VVV = V<V<V<T>>>;
template <class T = ll>
using pqup = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <class T = ll>
using pqdn = std::priority_queue<T>;

#pragma endregion

#pragma region constants

const int inf = 1e9;
const long long INF = 1e18;
const long double pi = acos(-1);
const char dl = '\n';
const char sp = ' ';
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

const int mod_1000000007 = 1000000007;
const int mod_998244353 = 998244353;

#pragma endregion

#pragma region basic_operation

template <class T0, class T1, class T2>
inline bool in_range(T0 x, T1 lef, T2 rig) {
	return ((lef <= x) && (x < rig));
}

template <class T>
inline bool chmin(T &a, T b) {
	if(a > b) {
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b) {
	if(a < b) {
		a = b;
		return true;
	}
	return false;
}

void Yes(bool f = 1) { std::cout << (f ? "Yes" : "No") << '\n'; }
void No() { std::cout << "No\n"; }
void YES(bool f = 1) { std::cout << (f ? "YES" : "NO") << '\n'; }
void NO() { std::cout << "NO\n"; }

template <class T>
void drop(T answer) {
	std::cout << answer << '\n';
	exit(0);
}

void err(bool flag = true) {
	if(!flag) return;
	std::cout << -1 << '\n';
	exit(0);
}

template <class T>
void vout(std::vector<T> const &v, bool vertically = 0) {
	if(vertically) {
		for(auto const &a : v) {
			std::cout << a << '\n';
		}
		return;
	}
	for(auto it = v.begin(); it != v.end(); it++) {
		std::cout << (*it);
		if(it != v.end() - 1) {
			std::cout << ' ';
		}
	}
	std::cout << '\n';
	return;
}

inline void print() { std::cout << '\n'; }
template <class T>
inline void print(T x) {
	std::cout << x << '\n';
	return;
}
template <typename Head, typename... Tail>
void print(Head H, Tail... T) {
	std::cout << H << " ";
	print(T...);
}

template <class T>
void add(std::vector<T> &v, T val) {
	for(auto &a : v) a += val;
	return;
}

template <class T>
T dup(T a, T b) {
	assert(b != 0);
	return (a + b - 1) / b;
}

template <class T>
T greatest_lower_multiple(T x, T d) {
	if(d == 0) return 0;
	if(d < 0) d *= -1;
	T y = x % d;
	if(y < 0) y += d;
	return x - y;
}

template <class T>
T least_upper_multiple(T x, T d) {
	return -greatest_lower_multiple(-x, d);
}

long long POW(long long a, long long n) {
	long long res = 1;
	while(n > 0) {
		if(n & 1) res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}

long long modpow(long long a, long long n, long long mod) {	 // a^n mod
	assert(n >= 0 && mod);
	if(mod == 1) return 0LL;
	long long res = 1;
	a %= mod;
	while(n > 0) {
		if(n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res < 0 ? res + mod : res;
}

// return x which satisfies a * x % mod == gcd(a, mod)
// not (mod | a)
long long modinv(long long a, long long mod) {
	long long b = mod, u = 1, v = 0;
	while(b) {
		long long t = a / b;
		a -= t * b;
		std::swap(a, b);
		u -= t * v;
		std::swap(u, v);
	}
	u %= mod;
	if(u < 0) u += mod;
	return u;
}

template <class T>
int lb(const std::vector<T> &a, const T x) {
	return std::distance(a.begin(), std::lower_bound(a.begin(), a.end(), x));
}
template <class T>
int ub(const std::vector<T> &a, const T x) {
	return std::distance(a.begin(), std::upper_bound(a.begin(), a.end(), x));
}
template <class T>
void unq_sort(std::vector<T> &a) {
	std::sort(a.begin(), a.end());
	a.erase(std::unique(a.begin(), a.end()), a.end());
}
template <class T>
std::vector<int> press(std::vector<T> &a) {
	auto vec = a;
	unq_sort(vec);
	std::vector<int> ret;
	for(auto &v : a) ret.push_back(lb(vec, v));
	return ret;
}

#pragma endregion

#pragma region input
#define VEC(type, name, size) \
	vector<type> name(size);  \
	scanner::INPUT(name)
#define VVEC(type, name, h, w)                     \
	vector<vector<type>> name(h, vector<type>(w)); \
	scanner::INPUT(name)
#define INT(...)     \
	int __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LL(...)            \
	long long __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define STR(...)        \
	string __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define CHR(...)      \
	char __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define DBL(...)        \
	double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LD(...)              \
	long double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define TPL3(type0, type1, type2, name)   \
	std::tuple<type0, type1, type2> name; \
	scanner::INPUT(name);
#define TPL4(type0, type1, type2, type3, name)   \
	std::tuple<type0, type1, type2, type3> name; \
	scanner::INPUT(name);

namespace scanner {
template <class T>
void scan(T &a) {
	std::cin >> a;
}

template <class T, class L>
void scan(std::pair<T, L> &p) {
	scan(p.first);
	scan(p.second);
}

template <class T0, class T1, class T2>
void scan(std::tuple<T0, T1, T2> &p) {
	T0 t0;
	T1 t1;
	T2 t2;
	scan(t0);
	scan(t1);
	scan(t2);
	p = std::make_tuple(t0, t1, t2);
}

template <class T0, class T1, class T2, class T3>
void scan(std::tuple<T0, T1, T2, T3> &p) {
	T0 t0;
	T1 t1;
	T2 t2;
	T3 t3;
	scan(t0);
	scan(t1);
	scan(t2);
	scan(t3);
	p = std::make_tuple(t0, t1, t2, t3);
}

template <class T>
void scan(std::vector<T> &a) {
	for(auto &i : a) scan(i);
}

void INPUT() {}
template <class Head, class... Tail>
void INPUT(Head &head, Tail &... tail) {
	scan(head);
	INPUT(tail...);
}
}  // namespace scanner

template <typename T1, typename T2>
std::istream &operator>>(std::istream &is, std::pair<T1, T2> &p) {
	is >> p.first >> p.second;
	return is;
}
#pragma endregion

#pragma region debug

#pragma region output
template <typename T1, typename T2>
std::ostream &std::operator<<(std::ostream &os, const std::pair<T1, T2> &p) {
	os << p.first << " " << p.second;
	return os;
}
template <class T>
std::ostream &std::operator<<(std::ostream &os, const std::vector<T> &v) {
	for(int i = 0; i < (int)v.size(); i++) {
		if(i) os << " ";
		os << v[i];
	}
	return os;
}
#pragma endregion

#pragma region view

namespace viewer {
void view(const long long e) {
	if(e == INF)
		std::cerr << "INF";
	else if(e == -INF)
		std::cerr << "-INF";
	else
		std::cerr << e;
}

void view(const int e) {
	if(e == inf)
		std::cerr << "inf";
	else if(e == -inf)
		std::cerr << "-inf";
	else
		std::cerr << e;
}

template <typename T>
void view(const T e) {
	std::cerr << e;
}

template <typename T, typename U>
void view(const std::pair<T, U> &p) {
	std::cerr << "(";
	view(p.first);
	std::cerr << ", ";
	view(p.second);
	std::cerr << ")";
}

template <class T0, class T1, class T2>
void view(const std::tuple<T0, T1, T2> &p) {
	std::cerr << "(";
	view(std::get<0>(p));
	std::cerr << ", ";
	view(std::get<1>(p));
	std::cerr << ", ";
	view(std::get<2>(p));
	std::cerr << ")";
}

template <class T0, class T1, class T2, class T3>
void view(const std::tuple<T0, T1, T2, T3> &p) {
	std::cerr << "(";
	view(std::get<0>(p));
	std::cerr << ", ";
	view(std::get<1>(p));
	std::cerr << ", ";
	view(std::get<2>(p));
	std::cerr << ", ";
	view(std::get<3>(p));
	std::cerr << ")";
}

template <typename T>
void view(const std::set<T> &s) {
	if(s.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(auto &t : s) {
		view(t);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::unordered_set<T> &s) {
	if(s.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(auto &t : s) {
		view(t);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::vector<T> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << "{ ";
	for(const auto &e : v) {
		view(e);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <typename T>
void view(const std::vector<std::vector<T>> &vv) {
	std::cerr << "{\n";
	for(const auto &v : vv) {
		std::cerr << "\t";
		view(v);
		std::cerr << '\n';
	}
	std::cerr << "}";
}

template <typename T, typename U>
void view(const std::vector<std::pair<T, U>> &v) {
	std::cerr << "{\n";
	for(const auto &c : v) {
		std::cerr << "\t(";
		view(c.first);
		std::cerr << ", ";
		view(c.second);
		std::cerr << ")\n";
	}
	std::cerr << "}";
}

template <class T0, class T1, class T2>
void view(const std::vector<std::tuple<T0, T1, T2>> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << '{';
	for(const auto &t : v) {
		std::cerr << "\n\t";
		view(t);
		std::cerr << ",";
	}
	std::cerr << "\n}";
}

template <class T0, class T1, class T2, class T3>
void view(const std::vector<std::tuple<T0, T1, T2, T3>> &v) {
	if(v.empty()) {
		std::cerr << "{ }";
		return;
	}
	std::cerr << '{';
	for(const auto &t : v) {
		std::cerr << "\n\t";
		view(t);
		std::cerr << ",";
	}
	std::cerr << "\n}";
}

template <typename T, typename U>
void view(const std::map<T, U> &m) {
	std::cerr << "{\n";
	for(const auto &t : m) {
		std::cerr << "\t[";
		view(t.first);
		std::cerr << "] : ";
		view(t.second);
		std::cerr << '\n';
	}
	std::cerr << "}";
}

template <typename T, typename U>
void view(const std::unordered_map<T, U> &m) {
	std::cerr << "{\n";
	for(const auto &t : m) {
		std::cerr << "\t[";
		view(t.first);
		std::cerr << "] : ";
		view(t.second);
		std::cerr << '\n';
	}
	std::cerr << "}";
}
}  // namespace viewer

#pragma endregion

// when debugging : g++ foo.cpp -DLOCAL
#ifdef LOCAL
void debug_out() {}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	viewer::view(H);
	std::cerr << ", ";
	debug_out(T...);
}
#define debug(...)                                                \
	do {                                                          \
		std::cerr << __LINE__ << " [" << #__VA_ARGS__ << "] : ["; \
		debug_out(__VA_ARGS__);                                   \
		std::cerr << "\b\b]\n";                                   \
	} while(0)
#define dump(x)                                      \
	do {                                             \
		std::cerr << __LINE__ << " " << #x << " : "; \
		viewer::view(x);                             \
		std::cerr << '\n';                           \
	} while(0)

#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

#pragma endregion

using R = long double;

void solve(int n) {
	int m;
	cin >> m;
	int length;
	cin >> length;
	vector<R> prob(n);
	vector<R> time(n);
	vector<R> velocity(n);

	rep(i, n) {
		cin >> prob[i] >> time[i] >> velocity[i];
		prob[i] /= 100;
	}

	auto cost_all = [&](int person, int rest_count) {
		return velocity[person] > 0 ? time[person] * rest_count + length / velocity[person] : INF;
	};

	VV<R> prob_rest(n, V<R>(m + 1));
	rep(i, n) prob_rest[i][0] = 1;
	rep(m) {
		auto tmp = prob_rest;
		tmp.assign(n, V<R>(m + 1, 0));

		rep(i, n) {
			rep(j, m + 1) {
				tmp[i][j] += prob_rest[i][j] * (1 - prob[i]);
				if(j < m) {
					tmp[i][j + 1] += prob_rest[i][j] * prob[i];
				}
			}
		}

		swap(tmp, prob_rest);
	}

	debug(prob_rest);

	auto win_prob = [&](int person, int rest_count) {
		R cost = cost_all(person, rest_count);
		R ans = 1;
		debug(person, rest_count, cost);
		rep(opponent, n) {
			if(opponent == person) continue;
			R res = 0;
			rep(rest_count_opponent, m + 1) {
				if(cost_all(opponent, rest_count_opponent) > cost + 1e-10) {
					res += prob_rest[opponent][rest_count_opponent];

					debug(opponent, rest_count_opponent);
				}
			}
			ans *= res;
		}
		return ans * prob_rest[person][rest_count];
	};

	R ret = 0;
	rep(i, n) {
		ret = 0;
		rep(j, m + 1) { ret += win_prob(i, j); }
		cout << ret << dl;
	}

	return;
}

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout << std::fixed << std::setprecision(15);
	// std::cerr << std::fixed << std::setprecision(15);
	srand((unsigned)time(NULL));

	int n;
	while(cin >> n) {
		// cout << (solve(n)) << dl;
		solve(n);
	}

	return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3708
final_rank: 7

code_snippet: #line 1 "/Users/nok0/Documents/Programming/nok0/template.hpp"
#include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif

#pragma region Macros
// rep macro
#define foa(v, a) for(auto &v : a)
#define REPname(a, b, c, d, e, ...) e
#define REP(...) REPname(__VA_ARGS__, REP3, REP2, REP1, REP0)(__VA_ARGS__)
#define REP0(x) for(int i = 0; i < (x); ++i)
#define REP1(i, x) for(int i = 0; i < (x); ++i)
#define REP2(i, l, r) for(int i = (l); i < (r); ++i)
#define REP3(i, l, r, c) for(int i = (l); i < (r); i += (c))
#define REPSname(a, b, c, ...) c
#define REPS(...) REPSname(__VA_ARGS__, REPS1, REPS0)(__VA_ARGS__)
#define REPS0(x) for(int i = 1; i <= (x); ++i)
#define REPS1(i, x) for(int i = 1; i <= (x); ++i)
#define RREPname(a, b, c, d, e, ...) e
#define RREP(...) RREPname(__VA_ARGS__, RREP3, RREP2, RREP1, RREP0)(__VA_ARGS__)
#define RREP0(x) for(int i = (x)-1; i >= 0; --i)
#define RREP1(i, x) for(int i = (x)-1; i >= 0; --i)
#define RREP2(i, r, l) for(int i = (r)-1; i >= (l); --i)
#define RREP3(i, r, l, c) for(int i = (r)-1; i >= (l); i -= (c))
#define RREPSname(a, b, c, ...) c
#define RREPS(...) RREPSname(__VA_ARGS__, RREPS1, RREPS0)(__VA_ARGS__)
#define RREPS0(x) for(int i = (x); i >= 1; --i)
#define RREPS1(i, x) for(int i = (x); i >= 1; --i)

// name macro
#define pb push_back
#define eb emplace_back
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define popcnt(x) __builtin_popcountll(x)
template <class T = int>
using V = std::vector<T>;
template <class T = int>
using VV = std::vector<std::vector<T>>;
template <class T>
using pqup = std::priority_queue<T, std::vector<T>, std::greater<T>>;
using ll = long long;
using ld = long double;
using int128 = __int128_t;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;

// input macro
template <class T, class U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
	is >> p.first >> p.second;
	return is;
}
template <class T>
std::istream &operator>>(std::istream &is, std::vector<T> &v) {
	for(T &i : v) is >> i;
	return is;
}
std::istream &operator>>(std::istream &is, __int128_t &a) {
	std::string s;
	is >> s;
	__int128_t ret = 0;
	for(int i = 0; i < s.length(); i++)
		if('0' <= s[i] and s[i] <= '9')
			ret = 10 * ret + s[i] - '0';
	a = ret * (s[0] == '-' ? -1 : 1);
	return is;
}
#if __has_include(<atcoder/all>)
std::istream &operator>>(std::istream &is, atcoder::modint998244353 &a) {
	long long v;
	is >> v;
	a = v;
	return is;
}
std::istream &operator>>(std::istream &is, atcoder::modint1000000007 &a) {
	long long v;
	is >> v;
	a = v;
	return is;
}
template <int m>
std::istream &operator>>(std::istream &is, atcoder::static_modint<m> &a) {
	long long v;
	is >> v;
	a = v;
	return is;
}
template <int m>
std::istream &operator>>(std::istream &is, atcoder::dynamic_modint<m> &a) {
	long long v;
	is >> v;
	a = v;
	return is;
}
#endif
namespace scanner {
void scan(int &a) { std::cin >> a; }
void scan(long long &a) { std::cin >> a; }
void scan(std::string &a) { std::cin >> a; }
void scan(char &a) { std::cin >> a; }
void scan(char a[]) { std::scanf("%s", a); }
void scan(double &a) { std::cin >> a; }
void scan(long double &a) { std::cin >> a; }
template <class T, class U>
void scan(std::pair<T, U> &p) { std::cin >> p; }
template <class T>
void scan(std::vector<T> &a) { std::cin >> a; }
void INPUT() {}
template <class Head, class... Tail>
void INPUT(Head &head, Tail &... tail) {
	scan(head);
	INPUT(tail...);
}
}  // namespace scanner
#define VEC(type, name, size)     \
	std::vector<type> name(size); \
	scanner::INPUT(name)
#define VVEC(type, name, h, w)                                    \
	std::vector<std::vector<type>> name(h, std::vector<type>(w)); \
	scanner::INPUT(name)
#define INT(...)     \
	int __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LL(...)            \
	long long __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define STR(...)             \
	std::string __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define CHAR(...)     \
	char __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define DOUBLE(...)     \
	double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)
#define LD(...)              \
	long double __VA_ARGS__; \
	scanner::INPUT(__VA_ARGS__)

// output-macro
template <class T, class U>
std::ostream &operator<<(std::ostream &os, const std::pair<T, U> &p) {
	os << p.first << " " << p.second;
	return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &a) {
	for(int i = 0; i < int(a.size()); ++i) {
		if(i) os << " ";
		os << a[i];
	}
	return os;
}
std::ostream &operator<<(std::ostream &dest, __int128_t &value) {
	std::ostream::sentry s(dest);
	if(s) {
		__uint128_t tmp = value < 0 ? -value : value;
		char buffer[128];
		char *d = std::end(buffer);
		do {
			--d;
			*d = "0123456789"[tmp % 10];
			tmp /= 10;
		} while(tmp != 0);
		if(value < 0) {
			--d;
			*d = '-';
		}
		int len = std::end(buffer) - d;
		if(dest.rdbuf()->sputn(d, len) != len) {
			dest.setstate(std::ios_base::badbit);
		}
	}
	return dest;
}
#if __has_include(<atcoder/all>)
std::ostream &operator<<(std::ostream &os, const atcoder::modint998244353 &a) { return os << a.val(); }
std::ostream &operator<<(std::ostream &os, const atcoder::modint1000000007 &a) { return os << a.val(); }
template <int m>
std::ostream &operator<<(std::ostream &os, const atcoder::static_modint<m> &a) { return os << a.val(); }
template <int m>
std::ostream &operator<<(std::ostream &os, const atcoder::dynamic_modint<m> &a) { return os << a.val(); }
#endif
template <class T>
void print(const T a) { std::cout << a << '\n'; }
template <class Head, class... Tail>
void print(Head H, Tail... T) {
	std::cout << H << ' ';
	print(T...);
}
template <class T>
void printel(const T a) { std::cout << a << '\n'; }
template <class T>
void printel(const std::vector<T> &a) {
	for(const auto &v : a)
		std::cout << v << '\n';
}
template <class Head, class... Tail>
void printel(Head H, Tail... T) {
	std::cout << H << '\n';
	printel(T...);
}
void Yes(const bool b = true) { std::cout << (b ? "Yes\n" : "No\n"); }
void No() { std::cout << "No\n"; }
void YES(const bool b = true) { std::cout << (b ? "YES\n" : "NO\n"); }
void NO() { std::cout << "NO\n"; }
void err(const bool b = true) {
	if(b) {
		std::cout << "-1\n", exit(0);
	}
}

//debug macro
namespace debugger {
template <class T>
void view(const std::vector<T> &a) {
	std::cerr << "{ ";
	for(const auto &v : a) {
		std::cerr << v << ", ";
	}
	std::cerr << "\b\b }";
}
template <class T>
void view(const std::vector<std::vector<T>> &a) {
	std::cerr << "{\n";
	for(const auto &v : a) {
		std::cerr << "\t";
		view(v);
		std::cerr << "\n";
	}
	std::cerr << "}";
}
template <class T, class U>
void view(const std::vector<std::pair<T, U>> &a) {
	std::cerr << "{\n";
	for(const auto &p : a) std::cerr << "\t(" << p.first << ", " << p.second << ")\n";
	std::cerr << "}";
}
template <class T, class U>
void view(const std::map<T, U> &m) {
	std::cerr << "{\n";
	for(const auto &p : m) std::cerr << "\t[" << p.first << "] : " << p.second << "\n";
	std::cerr << "}";
}
template <class T, class U>
void view(const std::pair<T, U> &p) { std::cerr << "(" << p.first << ", " << p.second << ")"; }
template <class T>
void view(const std::set<T> &s) {
	std::cerr << "{ ";
	for(auto &v : s) {
		view(v);
		std::cerr << ", ";
	}
	std::cerr << "\b\b }";
}

template <class T>
void view(const T &e) { std::cerr << e; }
}  // namespace debugger
#ifdef LOCAL
void debug_out() {}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	debugger::view(H);
	std::cerr << ", ";
	debug_out(T...);
}
#define debug(...)                                                \
	do {                                                          \
		std::cerr << __LINE__ << " [" << #__VA_ARGS__ << "] : ["; \
		debug_out(__VA_ARGS__);                                   \
		std::cerr << "\b\b]\n";                                   \
	} while(false)
#else
#define debug(...) (void(0))
#endif

// vector macro
template <class T>
int lb(const std::vector<T> &a, const T x) { return std::distance((a).begin(), std::lower_bound((a).begin(), (a).end(), (x))); }
template <class T>
int ub(const std::vector<T> &a, const T x) { return std::distance((a).begin(), std::upper_bound((a).begin(), (a).end(), (x))); }
template <class T>
void UNIQUE(std::vector<T> &a) {
	std::sort(a.begin(), a.end());
	a.erase(std::unique(a.begin(), a.end()), a.end());
}
template <class T>
std::vector<T> press(std::vector<T> &a) {
	auto res = a;
	UNIQUE(res);
	for(auto &v : a)
		v = lb(res, v);
	return res;
}
#define SORTname(a, b, c, ...) c
#define SORT(...) SORTname(__VA_ARGS__, SORT1, SORT0, ...)(__VA_ARGS__)
#define SORT0(a) std::sort((a).begin(), (a).end())
#define SORT1(a, c) std::sort((a).begin(), (a).end(), [](const auto x, const auto y) { return x c y; })
template <class T>
void ADD(std::vector<T> &a, const T x = 1) {
	for(auto &v : a) v += x;
}
template <class T>
void SUB(std::vector<T> &a, const T x = 1) {
	for(auto &v : a) v -= x;
}
template <class T>
void MUL(std::vector<T> &a, const T x) {
	for(auto &v : a) v *= x;
}
template <class T>
void DIV(std::vector<T> &a, const T x) {
	for(auto &v : a) v /= x;
}
std::vector<std::pair<char, int>> rle(const string &s) {
	int n = s.size();
	std::vector<std::pair<char, int>> ret;
	for(int l = 0; l < n;) {
		int r = l + 1;
		for(; r < n and s[l] == s[r]; r++) {}
		ret.emplace_back(s[l], r - l);
		l = r;
	}
	return ret;
}
template <class T>
std::vector<std::pair<T, int>> rle(const std::vector<T> &v) {
	int n = v.size();
	std::vector<std::pair<T, int>> ret;
	for(int l = 0; l < n;) {
		int r = l + 1;
		for(; r < n and v[l] == v[r]; r++) {}
		ret.emplace_back(v[l], r - l);
		l = r;
	}
	return ret;
}

// math macro
template <class T, class U>
inline bool chmin(T &a, const U &b) { return a > b ? a = b, true : false; }
template <class T, class U>
inline bool chmax(T &a, const U &b) { return a < b ? a = b, true : false; }
template <class T>
T divup(T x, T y) { return (x + y - 1) / y; }
template <class T>
T POW(T a, long long n) {
	T ret = 1;
	while(n) {
		if(n & 1) ret *= a;
		a *= a;
		n >>= 1;
	}
	return ret;
}
// modpow
long long POW(long long a, long long n, const int mod) {
	long long ret = 1;
	a = (a % mod + mod) % mod;
	while(n) {
		if(n & 1) (ret *= a) %= mod;
		(a *= a) %= mod;
		n >>= 1;
	}
	return ret;
}

// others
struct fast_io {
	fast_io() {
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		cout << fixed << setprecision(15);
	}
} fast_io_;
const int inf = 1e9;
const ll INF = 1e18;
#pragma endregion

void main_();

int main() {
	main_();
	return 0;
}
#line 2 "d.cpp"

void main_() {
	INT(n, m);
	DOUBLE(L);
	V<> P(n), t(n), v(n);
	REP(i, n) { cin >> P[i] >> t[i] >> v[i]; }
	V<double> p(n);
	REP(i, n) { p[i] = (double)P[i] / 100; }
	vector binom(m + 1, 1.0);
	double mul = 1;
	REPS(i, m) {
		mul *= (m + 1 - i);
		mul /= i;
		binom[i] = mul;
	}
	REP(i, n) {
		double res = 0;
		REP(j, m + 1) {
			//iさんが休憩をちょうどj回とって勝つ確率
			double prob = binom[j] * pow(p[i], j) * pow(1 - p[i], m - j);
			REP(k, n) {
				if(k == i) continue;
				double tmp_sum = 0;
				REP(l, m + 1) {
					if(t[k] * l * v[k] * v[i] + L * v[i] <= t[i] * j * v[k] * v[i] + L * v[k]) continue;
					debug(k, l);
					double tmp_prob = binom[l] * pow(p[k], l) * pow(1 - p[k], m - l);
					tmp_sum += tmp_prob;
				}
				prob *= tmp_sum;
			}
			res += prob;
		}
		print(res);
	}
}
accuracy: 1
time_ms: 890
memory_kb: 3984
final_rank: 11

code_snippet: #include <bits/stdc++.h>
using namespace std;

using T = tuple<long long, long long, long long>;

int n, m, l;
vector<vector<long long>> comb;
vector<T> v;

vector<long double> solve();

int main() {
  cin >> n >> m >> l;
  for (int i = 0; i < n; ++i) {
    int x, y, z;
    cin >> x >> y >> z;
    v.emplace_back(x, y, z);
  }
  auto res = solve();
  cout << fixed << setprecision(10);
  for (auto &p : res) cout << p << endl;
  return 0;
}

vector<long double> solve() {
  comb.resize(m + 1);
  comb[0].push_back(1);
  for (int i = 1; i <= m; ++i) {
    comb[i].resize(i + 1);
    for (int j = 0; j < i; ++j)
      comb[i][j] += comb[i - 1][j], comb[i][j + 1] += comb[i - 1][j];
  }
  vector<vector<long double>> prob(n, vector<long double>(m + 1, 0));
  for (int i = 0; i < n; ++i) {
    auto [p, t, s] = v[i];
    for (int j = 0; j <= m; ++j) prob[i][j] = comb[m][j];
    long double now = 1;
    for (int j = 0; j <= m; ++j) {
      prob[i][j] *= now;
      now *= p / 100.0L;
    }
    now = 1;
    for (int j = m; j >= 0; --j) {
      prob[i][j] *= now;
      now *= (100 - p) / 100.0L;
    }
  }
  vector<long double> res(n, 0);
  for (int i = 0; i < n; ++i) {
    auto [pi, ti, si] = v[i];
    for (int itimes = 0; itimes <= m; ++itimes) {
      long double now = prob[i][itimes];
      for (int j = 0; j < n; ++j)
        if (i != j) {
          auto [pj, tj, sj] = v[j];
          long double sum = 0;
          for (int jtimes = 0; jtimes <= m; ++jtimes) {
            long long lef = (itimes * ti - jtimes * tj) * si * sj,
                      righ = l * (si - sj);
            if (lef < righ) sum += prob[j][jtimes];
          }
          now *= sum;
        }
      res[i] += now;
    }
  }
  return res;
}
accuracy: 1
time_ms: 10
memory_kb: 3600
final_rank: 2

code_snippet: #include <bits/stdc++.h>
using namespace std;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
	for(auto &e:u) fill_v<T>(e,v...);
}

template <typename F>
class
#if defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard)
  [[nodiscard]]
#endif  // defined(__has_cpp_attribute) && __has_cpp_attribute(nodiscard)
FixPoint final : private F
{
public:
  template <typename G>
  explicit constexpr FixPoint(G&& g) noexcept
    : F{std::forward<G>(g)}
  {}

  template <typename... Args>
  constexpr decltype(auto)
  operator()(Args&&... args) const
#if !defined(__GNUC__) || defined(__clang__) || __GNUC__ >= 9
  noexcept(noexcept(F::operator()(std::declval<FixPoint>(), std::declval<Args>()...)))
#endif  // !defined(__GNUC__) || defined(__clang__) || __GNUC__ >= 9
  {
    return F::operator()(*this, std::forward<Args>(args)...);
  }
};  // class FixPoint


#if defined(__cpp_deduction_guides)
template <typename F>
FixPoint(F&&)
  -> FixPoint<std::decay_t<F>>;
#endif  // defined(__cpp_deduction_guides)


namespace
{
  template <typename F>
#if !defined(__has_cpp_attribute) || !__has_cpp_attribute(nodiscard)
  #  if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 4)
__attribute__((warn_unused_result))
#  elif defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_Check_return_)
_Check_return_
#  endif  // defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 4)
#endif  // !defined(__has_cpp_attribute) || !__has_cpp_attribute(nodiscard)
  inline constexpr decltype(auto)
  makeFixPoint(F&& f) noexcept
  {
    return FixPoint<std::decay_t<F>>{std::forward<std::decay_t<F>>(f)};
  }
}  // namespace

vector<int64> dijkstra(const vector<vector<int64>>& G, int s) {
  priority_queue<PLL, vector<PLL>, greater<>> pq;
  vector<int64> d(G.size(), INF_LL);
  d[s] = 0;
  pq.emplace(0, s);

  while (pq.size()) {
    int64 v, c;
    tie(c, v) = pq.top(); pq.pop();
    if (d[v] < c) continue;
    for (auto& u : G[v]) {
      if (d[u] > c + 1) {
        d[u] = c + 1;
        pq.emplace(c+1, u);
      }
    }
  }
  return d;
}

double comb(int a, int b) {
  double res = 1;
  REP(i, b) {
    res = res * (a - i) / (b - i);
  }
  return res;
}

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int64 N, M;
  double L;
  cin >> N >> M >> L;
  vector<double> P(N), V(N);
  vector<int64> T(N);

  REP(i, N) {
    cin >> P[i] >> T[i] >> V[i];
    P[i] = P[i] / 100;
  }

  auto prob = make_v<double>(N, M+1);
  auto time = make_v<double>(N, M+1);

  REP(i, N) {
    REP(j, M+1) {
      double prest = 1, pnot = 1;
      REP(k, j) prest *= P[i];
      REP(k, M-j) pnot *= 1-P[i];
      prob[i][j] = comb(M, j) * prest * pnot;
      time[i][j] = L / V[i] + T[i] * j;
//      cout << "(" << prob[i][j] << " " << time[i][j] << ") ";
    }
//    cout << endl;
  }

  REP(i, N) {
    double res = 0;
    REP(j, M+1) {
      double rprob = prob[i][j];
      REP(k, N) {
        if (k == i) continue;
        double sum = 0;
        REP(l, M+1) {
          if (time[k][l] > time[i][j]) {
            sum += prob[k][l];
          }
        }
//        cout << sum << " ";
        rprob *= sum;
      }
//      cout << rprob << endl;
      res += rprob;
    }
    cout << fixed << setprecision(10) << res << endl;
  }
}
accuracy: 1
time_ms: 20
memory_kb: 3632
final_rank: 3

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define each(e, v) for(auto &e: v)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
using ll = long long;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const int MOD = 1000000007;
//const int MOD = 998244353;
const int inf = (1<<30)-1;
const ll INF = (1LL<<60)-1;
template<typename T> bool chmax(T &x, const T &y) {return (x < y)? (x = y, true) : false;};
template<typename T> bool chmin(T &x, const T &y) {return (x > y)? (x = y, true) : false;};

struct io_setup{
    io_setup(){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout << fixed << setprecision(15);
    }
} io_setup;

int main(){
    int N, M, L; cin >> N >> M >> L;

    vector<double> fac(M+1, 0.0);
    rep2(i, 1, M){
        fac[i] = fac[i-1]+log(i);
    }

    vector<vector<double>> q(N, vector<double>(M+1, 0.0));
    vector<int> T(N), V(N);
    rep(i, N){
        int P; cin >> P >> T[i] >> V[i];
        if(P == 0){
            q[i][0] = 1.0;
            continue;
        }
        if(P == 100){
            q[i][M] = 1.0;
            continue; 
        }
        rep(j, M+1){
            double p = P/100.0;
            q[i][j] = fac[M]-fac[j]-fac[M-j]+j*log(p)+(M-j)*log(1.0-p);
            q[i][j] = exp(q[i][j]);
        }
    }

    double EPS = 1e-10;

    rep(i, N){
        if(V[i] == 0) {cout << 0.0 << '\n'; continue;}
        double ans = 0.0;
        rep(j, M+1){
            double tmp = q[i][j], t = double(L)/V[i]+j*T[i];
            rep(k, N){
                if(k == i) continue;
                double s = 0.0;
                rep(l, M+1){
                    if(V[k] == 0) {s += q[k][l]; continue;}
                    if(t+EPS < double(L)/V[k]+l*T[k]) s += q[k][l];
                }
                tmp *= s;
            }
            ans += tmp;
        }

        cout << ans << '\n';
    }
}
accuracy: 1
time_ms: 30
memory_kb: 4008
final_rank: 8