#include <cmath>
#include <cstdio>
#ifdef ONLINE_JUDGE
    #define out(x)
#else
    #define out(x) cerr<<#x"="<<(x)<<endl
#endif
using namespace std;
#define REP(i,n) for(int i=0; i<int(n); ++i)
#define RER(i,l,r) for(int i=(l); i<=int(r); ++i)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
double p[16];
double Pow[16][16];
int h[16][16];
double E[1<<16];
int main(){
    for(int m, n; scanf("%d%d",&m,&n)==2;){
        //m: visitors, n: cities
        REP(i,m){
            scanf("%lf",p+i);
            Pow[i][0]=1;
            RER(j,1,n-1)Pow[i][j]=Pow[i][j-1]*p[i];
        }
        double ans=0;
        REP(i,m)REP(j,n){
            scanf("%d",h[i]+j);
            ans+=h[i][j]*Pow[i][j];
        }
        REP(st,1<<m){
            E[st]=0;
            REP(i,m)if((st>>i)&1)
                E[st]+=p[i];
        }
        REP(st,1<<m){
            int c_lst=__builtin_popcount(st);
            REP(j,n-1){
                double p_now=1, tot=0;
                REP(i,m)if((st>>i)&1){
                    p_now*=Pow[i][j];
                    tot+=p[i]*(E[st^(1<<i)]+1)/c_lst*h[i][j+1];
                } else p_now*=1-Pow[i][j];
                ans+=p_now*tot;
            }
        }
        printf("%.10lf\n", ans);
    }
}
