#include using namespace std; using ld=long double; void fix(vector &v){ ld s=0.0; for(auto &nx : v){ s+=nx; } s=sqrt(s); for(auto &nx : v){ nx/=s; } } 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=1.0; ld beta=0.99; 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(m,0.0); for(int i=0;ibs[i]){tg=i;} } bob[tg]+=(1.0-bob[tg])*alpha; for(int i=0;i