text: #include<iostream>
  using namespace std;
  
  int main()
  {
      int num;
      cin>>num;
      while(num--)
      {
          int num1,num2;
          cin>>num1>>num2;
          cout<<(num1/3)*(num2/3)<<endl;
      }
      std::cin.get();
  }
  