#include using namespace std; #define rep(i,n) for(ll i=0;i=0;i--) #define perl(i,r,l) for(ll i=r-1;i>=l;i--) #define fi first #define se second #define pb push_back #define ins insert #define pqueue(x) priority_queue,greater> #define all(x) (x).begin(),(x).end() #define CST(x) cout<> #define rev(x) reverse(x); using ll=long long; using vl=vector; using vvl=vector>; using pl=pair; using vpl=vector; using vvpl=vector; const ll MOD=1000000007; const ll MOD9=998244353; const int inf=1e9+10; const ll INF=4e18; const ll dy[9]={0,1,-1,0,1,1,-1,-1,0}; const ll dx[9]={1,0,0,-1,1,-1,1,-1,0}; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } double dp[1<<12][13];//前の列のbit、連結してるリーチの個数 double ndp[1<<12][13]; int main(){ rep(k,1<<12)rep(l,13)dp[k][l]=0; dp[0][0]=1; ll h,w;cin >> h >> w; vector> p(h,vector(w+1)); rep(i,h)rep(j,w){ cin >> p[i][j+1]; p[i][j+1]/=100; } vvl s(h,vl(w+1,4)); rep(i,h){ rep(j,w){ cin >> s[i][j+1]; } } w++; double ans=0; ll mask=(1<>(w-1)); if(si>1){ ndp[to][0]+=dp[bit][k]*p[i][j]; } else if(si==1){ ndp[to][k+1]+=dp[bit][k]*p[i][j]; } else{ ans+=dp[bit][k]*p[i][j]*(k+1); to|=(1<