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