#include using namespace std; #define REP(i,a,b) for(i=a;imx)assert(0&&"failed at read_int(): the value is too large");return r;} template void read_int_array(int N, T res[], ll mn, ll mx){int i; rep(i,N)res[i]=read_int(mn,mx,i==N-1?'\n':' ');} void end_input(void){int k;mygc(k);if(k!=EOF)assert(0&&"failed at end_input(): there may be some unnecessary characters");} void writer(int x, char c){int s=0,m=0;char f[10];if(x<0)m=1,x=-x;while(x)f[s++]=x%10,x/=10;if(!s)f[s++]=0;if(m)mypc('-');while(s--)mypc(f[s]+'0');mypc(c);} void writer(ll x, char c){int s=0,m=0;char f[20];if(x<0)m=1,x=-x;while(x)f[s++]=x%10,x/=10;if(!s)f[s++]=0;if(m)mypc('-');while(s--)mypc(f[s]+'0');mypc(c);} void writer(double x, char c){printf("%.15f",x);mypc(c);} void writer(const char c[]){int i;for(i=0;c[i]!='\0';i++)mypc(c[i]);} void writer(const char x[], char c){int i;for(i=0;x[i]!='\0';i++)mypc(x[i]);mypc(c);} template void writerLn(T x){writer(x,'\n');} template void writerLn(T x, S y){writer(x,' ');writer(y,'\n');} template void writerLn(T x, S y, U z){writer(x,' ');writer(y,' ');writer(z,'\n');} template void writerArr(T x[], int n){int i;if(!n){mypc('\n');return;}rep(i,n-1)writer(x[i],' ');writer(x[n-1],'\n');} char memarr[17000000]; void *mem = memarr; #define MD 1000000007 int X, Y; int P[11][11], S[11][11]; int bc[2111]; int memo[4211111], red[2111], cnv[2111]; double solve(void){ int i, j, k, a, mask, t; int st[11], st_size, rest[11]; double *prob, *nx, *pp, res = 0; prob = (double*)mem; nx = prob + (1< 0 && --rest[i-1]==0) st[st_size++] = i-1; } memo[mask] = k; } rep(i,1<