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