#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>N>>M; FOR(i,M) cin>>x>>y>>r, rr[x][y]=r; double ret=0; for(int mask=0;mask<1<>x)&1; if(yes[0]==0 || yes[N-1]==0) continue; double pat=1; for(x=1;x