#include <stdio.h>
int main(void) {
int a[9]={0,};
int result[19]={0,};
double per[19]={0,};
double sum_p=0;
int sum=0;
int k=0;
for(a[0]=-1;a[0]<=1;a[0]++){
for(a[1]=-1;a[1]<=1;a[1]++){
for(a[2]=-1;a[2]<=1;a[2]++){
for(a[3]=-1;a[3]<=1;a[3]++){
for(a[4]=-1;a[4]<=1;a[4]++){
for(a[5]=-1;a[5]<=1;a[5]++){
for(a[6]=-1;a[6]<=1;a[6]++){
for(a[7]=-1;a[7]<=1;a[7]++){
for(a[8]=-1;a[8]<=1;a[8]++){
sum=0;
for(k=0;k<9;k++) sum+=a[k];
sum=sum+9;
result[sum]++;
}
}
}
}
}
}
}
}
}
//3^9=19683
for(k=0;k<19;k++){
per[k]=(double)result[k]/(19683);
}
sum_p=0;
for(k=0;k<19;k++){//self=1
if(k-9<-1) sum_p+=per[k];
}
printf("you=1, win=%f\n",1-sum_p
-per
[8]/2); sum_p=0;
for(k=0;k<19;k++){//self=0
if(k-9<0) sum_p+=per[k];
}
printf("you=0, win=%f\n",1-sum_p
-per
[9]/2); sum_p=0;
for(k=0;k<19;k++){//self=-1
if(k-9<1) sum_p+=per[k];
}
printf("you=-1, win=%f\n",1-sum_p
-per
[10]/2);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgbWFpbih2b2lkKSB7CglpbnQgYVs5XT17MCx9OwoJaW50IHJlc3VsdFsxOV09ezAsfTsKCWRvdWJsZSBwZXJbMTldPXswLH07Cglkb3VibGUgc3VtX3A9MDsKCWludCBzdW09MDsKCWludCBrPTA7Cglmb3IoYVswXT0tMTthWzBdPD0xO2FbMF0rKyl7CgkJZm9yKGFbMV09LTE7YVsxXTw9MTthWzFdKyspewoJCQlmb3IoYVsyXT0tMTthWzJdPD0xO2FbMl0rKyl7CgkJCQlmb3IoYVszXT0tMTthWzNdPD0xO2FbM10rKyl7CgkJCQkJZm9yKGFbNF09LTE7YVs0XTw9MTthWzRdKyspewoJCQkJCQlmb3IoYVs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