#include using namespace std; int T,N,M; main() { cin>>T; for(;T--;) { cin>>N>>M; if(N%2!=0||M%2!=0) { if(N==1&&M==1) { cout<<0<0;i-=2) { cout<