stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<cstdio>

#include<string>

#include<iostream>

#include<algorithm>

using namespace std;

struct node

{

    string a;

    int b;

    int y;

} m[10005];

int main()

{

    int n;

    cin>>n;

    for(int i=0; i<n; i++)

    {

        cin>>m[i].a>>m[i].b;

        m[i].y=i;

    }

    for(int i=0; i<n; i++)

    {

        for(int j=i+1; j<n; j++)

        {

            if(m[j].a<m[i].a)

            {

                node h;

                h=m[j];

                m[j]=m[i];

                m[i]=h;

            }

            if(m[j].a==m[i].a)

            {

                if(m[j].b>m[i].b)

                {

                    node h;

                    h=m[j];

                    m[j]=m[i];

                    m[i]=h;

                }

            }

        }

    }

    for(int i=0;i<n;i++)

    {

        cout<<m[i].y+1<<endl;

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.3938696754435353x):
#include<cstdio>

#include<cstring>

#include<string>

#include<iostream>

#include<algorithm>

#include<queue>

#include<math.h>

#include<vector>

#include<map>

using namespace std;

#define ll long long

struct node

{

    string str;

    int x;

    int k;

};

int cmp(node a,node b)

{

    if(a.str==b.str)

        return a.x>b.x;

    return a.str<b.str;

}

int main()

{

    int n;

    while(~scanf("%d",&n))

    {

        node a[101];

        for(int i=1; i<=n; i++)

        {

            cin>>a[i].str>>a[i].x;

            a[i].k=i;

        }

        sort(a+1,a+n+1,cmp);

        for(int i=1; i<=n; i++)

        {

            cout<<a[i].k<<endl;

        }

    }

    return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<string>

#include<iostream>

#include<algorithm>

using namespace std;

struct node

{

    string a;

    int b;

    int y;

} m[10005];

int main()

{

    int n;

    cin>>n;

    for(int i=0; i<n; i++)

    {

        cin>>m[i].a>>m[i].b;

        m[i].y=i;

    }

    for(int i=0; i<n; i++)

    {

        for(int j=i+1; j<n; j++)

        {

            if(m[j].a<m[i].a)

            {

                node h;

                h=m[j];

                m[j]=m[i];

                m[i]=h;

            }

            if(m[j].a==m[i].a)

            {

                if(m[j].b>m[i].b)

                {

                    node h;

                    h=m[j];

                    m[j]=m[i];

                    m[i]=h;

                }

            }

        }

    }

    for(int i=0;i<n;i++)

    {

        cout<<m[i].y+1<<endl;

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.4280705598526473x):
#include <iostream>

#include<cstdio>

#include<algorithm> 

#include<cstring>

using namespace std;



//#pragma warning(disable:4996)



struct res

{

	char ch[21];

	int s = -1;

	int i = -1;

};



res r[101];



bool comp(res& r1, res& r2)

{

	int c = strcmp(r1.ch, r2.ch);

	if (c < 0)return true;

	if (c > 0)return false;

	return r1.s > r2.s;

}



int n;

int main()

{

	//cin >> n;

	scanf("%d", &n);

	for (int i = 1; i <= n; ++i)

	{

		scanf("%s", r[i].ch);

		scanf("%d", &r[i].s);

		r[i].i = i;

	}

	sort(&r[1], &r[n]+1, comp);



	for (int i = 1; i <=n; ++i)

		printf("%d\n", r[i].i);



	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<string>

#include<iostream>

#include<algorithm>

using namespace std;

struct node

{

    string a;

    int b;

    int y;

} m[10005];

int main()

{

    int n;

    cin>>n;

    for(int i=0; i<n; i++)

    {

        cin>>m[i].a>>m[i].b;

        m[i].y=i;

    }

    for(int i=0; i<n; i++)

    {

        for(int j=i+1; j<n; j++)

        {

            if(m[j].a<m[i].a)

            {

                node h;

                h=m[j];

                m[j]=m[i];

                m[i]=h;

            }

            if(m[j].a==m[i].a)

            {

                if(m[j].b>m[i].b)

                {

                    node h;

                    h=m[j];

                    m[j]=m[i];

                    m[i]=h;

                }

            }

        }

    }

    for(int i=0;i<n;i++)

    {

        cout<<m[i].y+1<<endl;

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.396729458204295x):
#include<bits/stdc++.h>

#include<iostream>

using namespace std; 

int main(){

int n;

cin>>n;

vector<tuple<string, int ,int > >res;

string s;

int p;

for(int i=0;i<n;i++){

cin>>s>>p;

res.push_back(make_tuple(s,p,i+1));

}

sort(res.begin(),res.end());

for(int i=0;i<n-1;i++){

    for(int j=i+1;j<n;j++){

    if((get<0>(res[i]).compare(get<0>(res[j])))==0){

        if(get<1>(res[i])<get<1>(res[j])){

            swap(res[i],res[j]);

        }}

    }

}

for(int i=0;i<n;i++){

cout<<get<2>(res[i])<<endl;

}return 0;	

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

struct r{

	string na;

	int s,a;

};

r x[10000];

bool cmp(r x,r y){

	string a=x.na,b=y.na;

	if(b.size()>a.size())a=b;

	for(int i=0;i<a.size();i++){

		if(x.na[i]!=y.na[i])return x.na<y.na;

	}

	return x.s>y.s;

}

int main(){

	int n;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>x[i].na>>x[i].s;

		x[i].a=i+1;

	}

	sort(x,x+n,cmp);

	for(int i=0;i<n;i++)cout<<x[i].a<<endl;

} 

// Faster C++ solution for the same problem (measured speedup: 1.4036718788652072x):
#include<bits/stdc++.h>

using namespace std;

int n;

struct Rest

{

    int i,p;

    string s;

};

Rest rest[100+10];

bool comp(Rest a,Rest b)

{

    if(a.i!=b.i)

    {

        if(a.s!=b.s) return a.s<b.s;

        else

        {

            if(a.i!=b.i)

            {

                return a.p>b.p;

            }

        }

    }

    return a.p>b.p;

}

int main()

{

    cin>>n;

    for(int i=1;i<=n;i++)

    {

        rest[i].i=i;

        cin>>rest[i].s>>rest[i].p;

    }

    sort(rest+1,rest+n+1,comp);

    for(int i=1;i<=n;i++)

    {

        cout<<rest[i].i<<endl;

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

struct r{

	string na;

	int s,a;

};

r x[10000];

bool cmp(r x,r y){

	string a=x.na,b=y.na;

	if(b.size()>a.size())a=b;

	for(int i=0;i<a.size();i++){

		if(x.na[i]!=y.na[i])return x.na<y.na;

	}

	return x.s>y.s;

}

int main(){

	int n;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>x[i].na>>x[i].s;

		x[i].a=i+1;

	}

	sort(x,x+n,cmp);

	for(int i=0;i<n;i++)cout<<x[i].a<<endl;

} 

// Faster C++ solution for the same problem (measured speedup: 1.437767210836145x):
#include<bits/stdc++.h>

using namespace std;

const int N = 1e5+100;

int n,m;

struct node{

	char s[230];

	int sc, id;

	bool operator < (node &A ) const{

		if (strcmp(s, A.s) != 0) return strcmp(s, A.s) < 0;

		return sc > A.sc;

	}

}f[N];



int main(){

	scanf("%d",&n);

	for (int i = 0; i < n; ++i)

		scanf("%s%d",f[i].s,&f[i].sc), f[i].id = i+1;

	sort(f,f+n);

	for (int i = 0; i < n; ++i)

		printf("%d\n",f[i].id);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <algorithm>

#include <string>

using namespace std;

struct r{

	string na;

	int s,a;

};

r x[10000];

bool cmp(r x,r y){

	string a=x.na,b=y.na;

	if(b.size()>a.size())a=b;

	for(int i=0;i<a.size();i++){

		if(x.na[i]!=y.na[i])return x.na<y.na;

	}

	return x.s>y.s;

}

int main(){

	int n;

	cin>>n;

	for(int i=0;i<n;i++){

		cin>>x[i].na>>x[i].s;

		x[i].a=i+1;

	}

	sort(x,x+n,cmp);

	for(int i=0;i<n;i++)cout<<x[i].a<<endl;

} 

// Faster C++ solution for the same problem (measured speedup: 7.196115548811632x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

struct re

{

	int id;

	char name[105];

	int sc;

}a[105];

bool cmp(const re&a,const re&b)

{

	return(strcmp(a.name, b.name) < 0 || (strcmp(a.name, b.name) == 0 && a.sc > b.sc));

}

int main()

{

	int n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)

	{

	

		scanf("%s",&a[i].name);

		scanf("%d", &a[i].sc);

		a[i].id = i + 1;

	}

	sort(a, a + n, cmp);

	for (int i = 0; i < n; i++)

		printf("%d\n", a[i].id);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int n;

struct Rest

{

    int i,p;

    string s;

};

Rest rest[100+10];

bool comp(Rest a,Rest b)

{

    if(a.i!=b.i)

    {

        if(a.s!=b.s) return a.s<b.s;

        else

        {

            if(a.i!=b.i)

            {

                return a.p>b.p;

            }

        }

    }

    return a.p>b.p;

}

int main()

{

    cin>>n;

    for(int i=1;i<=n;i++)

    {

        rest[i].i=i;

        cin>>rest[i].s>>rest[i].p;

    }

    sort(rest+1,rest+n+1,comp);

    for(int i=1;i<=n;i++)

    {

        cout<<rest[i].i<<endl;

    }

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.126636543170832x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

struct re

{

	int id;

	char name[105];

	int sc;

}a[105];

bool cmp(const re&a,const re&b)

{

	return(strcmp(a.name, b.name) < 0 || (strcmp(a.name, b.name) == 0 && a.sc > b.sc));

}

int main()

{

	int n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)

	{

	

		scanf("%s",&a[i].name);

		scanf("%d", &a[i].sc);

		a[i].id = i + 1;

	}

	sort(a, a + n, cmp);

	for (int i = 0; i < n; i++)

		printf("%d\n", a[i].id);

	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

const int N = 1e5+100;

int n,m;

struct node{

	char s[230];

	int sc, id;

	bool operator < (node &A ) const{

		if (strcmp(s, A.s) != 0) return strcmp(s, A.s) < 0;

		return sc > A.sc;

	}

}f[N];



int main(){

	scanf("%d",&n);

	for (int i = 0; i < n; ++i)

		scanf("%s%d",f[i].s,&f[i].sc), f[i].id = i+1;

	sort(f,f+n);

	for (int i = 0; i < n; ++i)

		printf("%d\n",f[i].id);

	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 5.005063055114933x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

struct re

{

	int id;

	char name[105];

	int sc;

}a[105];

bool cmp(const re&a,const re&b)

{

	return(strcmp(a.name, b.name) < 0 || (strcmp(a.name, b.name) == 0 && a.sc > b.sc));

}

int main()

{

	int n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)

	{

	

		scanf("%s",&a[i].name);

		scanf("%d", &a[i].sc);

		a[i].id = i + 1;

	}

	sort(a, a + n, cmp);

	for (int i = 0; i < n; i++)

		printf("%d\n", a[i].id);

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <cstdio>

#include <cstring>

#include <vector>

#include <string>

#include <algorithm>

using namespace std;



struct Rest {

	int score;

	string name;

	int id;

} rest[10000];



int n;



bool cmp(const Rest& a, const Rest& b) {

	if(a.name == b.name) return a.score > b.score;

	return a.name < b.name;

}



void in() {

	cin >> n;

	for(int i = 0;i < n;i ++) {

		cin >> rest[i].name >> rest[i].score;

		rest[i].id = i+1;

	}

}



void solve() {

	sort(rest, rest+n, cmp);

	for(int i = 0;i < n;i ++) {

		cout << rest[i].id << endl;

	}

}



int main() {

	in();

	solve();

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 7.570578042360136x):
#include<stdio.h>

#include<string.h>

#include<algorithm>

using namespace std;

struct re

{

	int id;

	char name[105];

	int sc;

}a[105];

bool cmp(const re&a,const re&b)

{

	return(strcmp(a.name, b.name) < 0 || (strcmp(a.name, b.name) == 0 && a.sc > b.sc));

}

int main()

{

	int n;

	scanf("%d", &n);

	for (int i = 0; i < n; i++)

	{

	

		scanf("%s",&a[i].name);

		scanf("%d", &a[i].sc);

		a[i].id = i + 1;

	}

	sort(a, a + n, cmp);

	for (int i = 0; i < n; i++)

		printf("%d\n", a[i].id);

	return 0;

}
// Slower C++ solution:
#include <stdio.h>

#include <algorithm>

#include <math.h>

using namespace std;

const double eps=1e-7;

const int maxn=110;

const int maxm=110;

double lin[maxm][maxm],tmp[maxm][maxm],c[maxm][maxm],ans[maxm],p[maxm],v[maxm],t[maxm];

int main()

{

	for(int i=0;i<maxm;i++)

	{

		c[i][0]=c[i][i]=1;

		for(int j=1;j<i;j++) c[i][j]=c[i-1][j]+c[i-1][j-1];

	}

	int n,m;

	double l;

	while(scanf("%d%d%lf",&n,&m,&l)!=EOF)

	{

		for(int i=0;i<n;i++) scanf("%lf%lf%lf",&p[i],&t[i],&v[i]);

		for(int i=0;i<n;i++) p[i]/=100;

		for(int i=0;i<n;i++)

		{

			for(int j=0;j<=m;j++)

			{

				tmp[i][j]=l/v[i]+j*t[i];

				lin[i][j]=pow(p[i],j)*pow((1-p[i]),m-j)*c[m][j];

			}

			for(int j=m-1;j>=0;j--) lin[i][j]+=lin[i][j+1];

			//for(int j=0;j<=m;j++) printf("%f ",lin[i][j]);

			//printf("\n");

			lin[i][m+1]=0;	

		}

		for(int i=0;i<n;i++)

		{

			for(int k=0;k<=m;k++) ans[k]=pow(p[i],k)*pow((1-p[i]),m-k)*c[m][k];

			for(int j=0;j<n;j++) 

				if(j!=i)

				{

					int q=m;

					for(int p=m;p>=0;p--)

					{

						while(q>=0 && tmp[i][q]>=tmp[j][p]-eps) 

						{

							ans[q]*=lin[j][p+1];

							q--;

						}

						if(q==-1) break;

					}

				}

			double sum=0;

			for(int k=0;k<=m;k++) sum+=ans[k];

			printf("%.9f\n",sum);

		}

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.024772873773531x):
#include <cstdio>

#include <algorithm>

using namespace std;



const double EPS = 1e-8;

const int N = 105;

const int M = 55;



int n, m, l, t[N], v[N];

double dp[N][M];

double sum[N][M];



void gao(double p, double dp[], double sum[]) {

	double q = 1-p, f[2][M] = {};

	f[0][0] = 1;

	for (int i = 1, x = 1; i <= m; ++i, x^=1) {

		f[x][0] = f[!x][0] * q;

		for (int j = 1; j <= i; ++j) {

			f[x][j] = f[!x][j-1] * p + f[!x][j] * q;

		}

	}

	dp[m+1] = sum[m+1] = 0;

	for (int i = m, x = m & 1; i >= 0; --i) {

		sum[i] = sum[i+1] + (dp[i] = f[x][i]);

	}

}



// return true if (i,j) < (x,y)

bool faster(int i, int j, int x, int y) {

	return l*v[x] + t[i]*j*v[i]*v[x] < l*v[i] + t[x]*y*v[i]*v[x];

}



int binsearch(int i, int j, int k) {

	int l = -1, r = m+1, mid;

	while (l + 1 < r) {

		mid = (l+r)>>1;

		faster(i,j,k,mid) ? r=mid : l=mid;

	}

	return r;

}



void debug(double a[], int s, int t) {

	for(int i=s;i<t;++i)printf("%f ", a[i]);puts("");

}



int main() {

	while (3==scanf("%d%d%d", &n, &m, &l)) {

		for (int p,i = 0; i < n; ++i) {

			scanf("%d%d%d", &p, &t[i], &v[i]);

			gao(p/100., dp[i], sum[i]);

//			debug(dp[i], 0, m+2);

//			debug(sum[i], 0, m+2); 

		}

		for (int i = 0; i < n; ++i) {

			double ans = 0;

			for (int j = 0; j <= m; ++j) {

				double p = dp[i][j];

				for (int r,k = 0; k < n; ++k) {

					if (i == k) continue;

					r = binsearch(i, j, k);

					p *= sum[k][r];

				}

				ans += p;

			}

			printf("%.10f\n", ans);

		}

	}

}
// Slower C++ solution:
#include<cmath>

#include<cstdio>

#include<string>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

int N,M,L;

struct node

{   double t,p;

}per[101][51];

long long c[51][51]={0};

void prepare()

{   c[0][0]=1;c[1][0]=1;

    for(int i=1;i<51;i++)

    for(int j=0;j<51;j++)

    {   if(j==0) c[i][j]=1;

        else c[i][j]=c[i-1][j]+c[i-1][j-1];

    }

}

int main()

{   int T;

    prepare();

    cin>>N>>M>>L;

    for(int i=0;i<N;i++)

    {   double p,t,v;

        cin>>p>>t>>v;p*=0.01;

        per[i][0].t=L/v;

        per[i][0].p=pow(1-p,M);

        for(int j=1;j<=M;j++)

        {   per[i][j].p=c[M][j]*pow(1-p,M-j)*pow(p,j);

            per[i][j].t=per[i][j-1].t+t;

        }

    }

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

//    for(int j=0;j<=M;j++)

//    {   cout<<per[i][j].t<<'('<<per[i][j].p<<')'<<' ';

//

//    }puts("");}

    for(int i=0;i<N;i++)

    {   double s=0;

        for(int j=0;j<=M;j++)

        {   double tt=per[i][j].p;

            for(int k=0;k<N;k++)

            if(k!=i)

            {   double ts=0;

                for(int t=M;t>=0 && per[k][t].t>per[i][j].t;t--)

                {   ts+=per[k][t].p;

                }

                tt*=ts;

               // cout<<ts<<endl;

            }

            s+=tt;

        }

        printf("%.8lf\n",s);

    }

}

// Faster C++ solution for the same problem (measured speedup: 3.7610412331774032x):
#include <cstdio>

#include <algorithm>

using namespace std;



const double EPS = 1e-8;

const int N = 105;

const int M = 55;



int n, m, l, t[N], v[N];

double dp[N][M];

double sum[N][M];



void gao(double p, double dp[], double sum[]) {

	double q = 1-p, f[2][M] = {};

	f[0][0] = 1;

	for (int i = 1, x = 1; i <= m; ++i, x^=1) {

		f[x][0] = f[!x][0] * q;

		for (int j = 1; j <= i; ++j) {

			f[x][j] = f[!x][j-1] * p + f[!x][j] * q;

		}

	}

	dp[m+1] = sum[m+1] = 0;

	for (int i = m, x = m & 1; i >= 0; --i) {

		sum[i] = sum[i+1] + (dp[i] = f[x][i]);

	}

}



// return true if (i,j) < (x,y)

bool faster(int i, int j, int x, int y) {

	return l*v[x] + t[i]*j*v[i]*v[x] < l*v[i] + t[x]*y*v[i]*v[x];

}



int binsearch(int i, int j, int k) {

	int l = -1, r = m+1, mid;

	while (l + 1 < r) {

		mid = (l+r)>>1;

		faster(i,j,k,mid) ? r=mid : l=mid;

	}

	return r;

}



void debug(double a[], int s, int t) {

	for(int i=s;i<t;++i)printf("%f ", a[i]);puts("");

}



int main() {

	while (3==scanf("%d%d%d", &n, &m, &l)) {

		for (int p,i = 0; i < n; ++i) {

			scanf("%d%d%d", &p, &t[i], &v[i]);

			gao(p/100., dp[i], sum[i]);

//			debug(dp[i], 0, m+2);

//			debug(sum[i], 0, m+2); 

		}

		for (int i = 0; i < n; ++i) {

			double ans = 0;

			for (int j = 0; j <= m; ++j) {

				double p = dp[i][j];

				for (int r,k = 0; k < n; ++k) {

					if (i == k) continue;

					r = binsearch(i, j, k);

					p *= sum[k][r];

				}

				ans += p;

			}

			printf("%.10f\n", ans);

		}

	}

}
// Slower C++ solution:
#include <stdio.h>

#include <algorithm>

#include <math.h>

using namespace std;

const double eps=1e-7;

const int maxn=110;

const int maxm=110;

double lin[maxm][maxm],tmp[maxm][maxm],c[maxm][maxm],ans[maxm],p[maxm],v[maxm],t[maxm];

int main()

{

	for(int i=0;i<maxm;i++)

	{

		c[i][0]=c[i][i]=1;

		for(int j=1;j<i;j++) c[i][j]=c[i-1][j]+c[i-1][j-1];

	}

	int n,m;

	double l;

	while(scanf("%d%d%lf",&n,&m,&l)!=EOF)

	{

		for(int i=0;i<n;i++) scanf("%lf%lf%lf",&p[i],&t[i],&v[i]);

		for(int i=0;i<n;i++) p[i]/=100;

		for(int i=0;i<n;i++)

		{

			for(int j=0;j<=m;j++)

			{

				tmp[i][j]=l/v[i]+j*t[i];

				lin[i][j]=pow(p[i],j)*pow((1-p[i]),m-j)*c[m][j];

			}

			for(int j=m-1;j>=0;j--) lin[i][j]+=lin[i][j+1];

			//for(int j=0;j<=m;j++) printf("%f ",lin[i][j]);

			//printf("\n");

			lin[i][m+1]=0;	

		}

		for(int i=0;i<n;i++)

		{

			for(int k=0;k<=m;k++) ans[k]=pow(p[i],k)*pow((1-p[i]),m-k)*c[m][k];

			for(int j=0;j<n;j++) 

				if(j!=i)

				{

					int q=m;

					for(int p=m;p>=0;p--)

					{

						while(q>=0 && tmp[i][q]>=tmp[j][p]-eps) 

						{

							ans[q]*=lin[j][p+1];

							q--;

						}

						if(q==-1) break;

					}

				}

			double sum=0;

			for(int k=0;k<=m;k++) sum+=ans[k];

			printf("%.9f\n",sum);

		}

	}

}

// Faster C++ solution for the same problem (measured speedup: 1.3101134388085356x):
#include <cstdio>

#include <cstring>

#include <cmath>

#include <algorithm>

#include <vector>



using namespace std;



#define MAXN 110

#define INF 0x3f3f3f3f

#define PI acos(-1.0)

#define MAX(a,b) (a>b?a:b)

#define MIN(a,b) (a<b?a:b)

#define ABS(m) (m<0?-m:m)

typedef long long LL;



int n,m,l;

LL c[MAXN][MAXN];

int p[MAXN],t[MAXN],v[MAXN];



void Init()

{

    int i,j;

    scanf("%d%d%d",&n,&m,&l);

    for(i=1;i<=n;++i)

        scanf("%d%d%d",p+i,t+i,v+i);

    c[0][0]=1;

    for(i=1;i<=50;++i)

        for(j=1,c[i][0]=1;j<=i;++j)

            c[i][j]=c[i-1][j]+c[i-1][j-1];

}



long double C(long double P,int N,int M)

{

    int i; long double ans=c[N][M];

    for(i=1;i<=M;++i) ans*=P;

    for(;i<=N;++i) ans*=(1-P);

    return ans;

}



void Work()

{

    int i,j,k,x;

    long double ans,r1,r2;

    long double P[MAXN][2];

    LL t1,t2;

    for(i=1;i<=n;++i){

        for(ans=0,j=0;j<=m;++j){

            t1=l+1LL*j*t[i]*v[i];

            r1=C(p[i]/100.0,m,j);

            for(k=1;k<=n;++k){

                if(k==i) continue;

                for(x=1,P[0][0]=P[0][1]=1;x<=m;++x)

                    P[x][0]=P[x-1][0]*p[k]/100.0,P[x][1]=P[x-1][1]*(1-p[k]/100.0);

                for(x=r2=0,t2=l;x<=m&&t2*v[i]<=t1*v[k];t2+=1LL*t[k]*v[k],++x);

                for(r2=0;x<=m;++x) r2+=((long double)c[m][x])*P[x][0]*P[m-x][1];

                r1*=r2;

            }

            ans+=r1;

        }

        printf("%.12f\n",(double)ans);

    }

}



int main()

{

    Init();

    Work();

    return 0;

}
// Slower C++ solution:
#include<cmath>

#include<cstdio>

#include<string>

#include<cstring>

#include<cstdlib>

#include<iostream>

#include<algorithm>

using namespace std;

int N,M,L;

struct node

{   double t,p;

}per[101][51];

long long c[51][51]={0};

void prepare()

{   c[0][0]=1;c[1][0]=1;

    for(int i=1;i<51;i++)

    for(int j=0;j<51;j++)

    {   if(j==0) c[i][j]=1;

        else c[i][j]=c[i-1][j]+c[i-1][j-1];

    }

}

int main()

{   int T;

    prepare();

    cin>>N>>M>>L;

    for(int i=0;i<N;i++)

    {   double p,t,v;

        cin>>p>>t>>v;p*=0.01;

        per[i][0].t=L/v;

        per[i][0].p=pow(1-p,M);

        for(int j=1;j<=M;j++)

        {   per[i][j].p=c[M][j]*pow(1-p,M-j)*pow(p,j);

            per[i][j].t=per[i][j-1].t+t;

        }

    }

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

//    for(int j=0;j<=M;j++)

//    {   cout<<per[i][j].t<<'('<<per[i][j].p<<')'<<' ';

//

//    }puts("");}

    for(int i=0;i<N;i++)

    {   double s=0;

        for(int j=0;j<=M;j++)

        {   double tt=per[i][j].p;

            for(int k=0;k<N;k++)

            if(k!=i)

            {   double ts=0;

                for(int t=M;t>=0 && per[k][t].t>per[i][j].t;t--)

                {   ts+=per[k][t].p;

                }

                tt*=ts;

               // cout<<ts<<endl;

            }

            s+=tt;

        }

        printf("%.8lf\n",s);

    }

}

// Faster C++ solution for the same problem (measured speedup: 4.808275852730727x):
#include <cstdio>

#include <cstring>

#include <cmath>

#include <algorithm>

#include <vector>



using namespace std;



#define MAXN 110

#define INF 0x3f3f3f3f

#define PI acos(-1.0)

#define MAX(a,b) (a>b?a:b)

#define MIN(a,b) (a<b?a:b)

#define ABS(m) (m<0?-m:m)

typedef long long LL;



int n,m,l;

LL c[MAXN][MAXN];

int p[MAXN],t[MAXN],v[MAXN];



void Init()

{

    int i,j;

    scanf("%d%d%d",&n,&m,&l);

    for(i=1;i<=n;++i)

        scanf("%d%d%d",p+i,t+i,v+i);

    c[0][0]=1;

    for(i=1;i<=50;++i)

        for(j=1,c[i][0]=1;j<=i;++j)

            c[i][j]=c[i-1][j]+c[i-1][j-1];

}



long double C(long double P,int N,int M)

{

    int i; long double ans=c[N][M];

    for(i=1;i<=M;++i) ans*=P;

    for(;i<=N;++i) ans*=(1-P);

    return ans;

}



void Work()

{

    int i,j,k,x;

    long double ans,r1,r2;

    long double P[MAXN][2];

    LL t1,t2;

    for(i=1;i<=n;++i){

        for(ans=0,j=0;j<=m;++j){

            t1=l+1LL*j*t[i]*v[i];

            r1=C(p[i]/100.0,m,j);

            for(k=1;k<=n;++k){

                if(k==i) continue;

                for(x=1,P[0][0]=P[0][1]=1;x<=m;++x)

                    P[x][0]=P[x-1][0]*p[k]/100.0,P[x][1]=P[x-1][1]*(1-p[k]/100.0);

                for(x=r2=0,t2=l;x<=m&&t2*v[i]<=t1*v[k];t2+=1LL*t[k]*v[k],++x);

                for(r2=0;x<=m;++x) r2+=((long double)c[m][x])*P[x][0]*P[m-x][1];

                r1*=r2;

            }

            ans+=r1;

        }

        printf("%.12f\n",(double)ans);

    }

}



int main()

{

    Init();

    Work();

    return 0;

}