#include using namespace std; using ld=long double; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int t; cin >> t; while(t--){ int n,m; cin >> n >> m; vector> a(n,vector(m,0)); for(auto &nx : a){ for(auto &ny : nx){cin >> ny;} } ld alpha=0.1; ld beta=0.995; vector alice(n,((ld)1.0)/((ld)n)); vector bob(m,((ld)1.0)/((ld)m)); for(int tr=0;tr<2000;tr++){ { // alice vector as(n,0.0); for(int i=0;i bs(n,0.0); for(int i=0;ibs[i]){tg=i;} } bob[tg]+=(1.0-bob[tg])*alpha; for(int i=0;i