#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x>H>>W; FOR(y,H) FOR(x,W) cin>>r, P[y][x] = r/100.0; FOR(y,H) FOR(x,W) cin>>S[y][x]; dp[0][0][0]=1; FOR(y,H) { for(int up=0;up<1<=4) hand |= 1<<(x+1); } } hand >>=1; FOR(x,130) { dp[y+1][hand][x+__builtin_popcount(hand)] += pat*dp[y][up][x]; } } } } double ret=0; FOR(x,130) { FOR(y,1<