找规律
#include <iostream>
#include <cstdio>
#include <algorithm>
#define LL long long
using namespace std;
int main(){
LL T, N, M;
scanf("%lld", &T);
while(T--){
LL ans;
scanf("%lld%lld", &N, &M);
if(M > N) swap(N, M);
if(M == 1 || N == 1){
if(N == 1 && M == 1) ans = 1;
else{
ans = 2*(N-1);
}
}
else{
N--, M--;
ans = N*M;
ans <<= 3;
}
printf("%lld\n", ans);
}
return 0;
}