#32834: _ans


yp11151049@yphs.tp.edu.tw (901-26李文睿)


#include<bits/stdc++.h>
using namespace std;
int main(){
    int t,n,m;
    while(cin>>t){
        for(int i=1;i<=t;i++){
            while(cin>>n>>m){
                cout<<(n/3)*(m/3)<<endl;
            }
        }
    }
}