#include #include #include #include #include #include using namespace std; using ll=long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int ttt; cin>>ttt; while(ttt--){ ll h,w,a,b,x,y; cin>>h>>w>>a>>b>>x>>y; a--;b--;x--;y--; ll ans=h*w*2-4; auto f=[](ll w,ll x,ll y,ll z)->ll{ //cout<