#include using namespace std; // Short forms #define int long long #define ll long long #define lld long double #define ull unsigned long long #define endl '\n' #define ff first #define ss second #define all(x) x.begin(), x.end() #define sz(x) (int)(x).size() #define pb push_back #define ppb pop_back #define mp make_pair #define ins insert #define fr(i, a, b) for(int i=a; ib; --i) #define nf(i, n) for(int i=n-1; i>=0; --i) // STLs #define PII pair #define VI vector #define VVI vector> #define SI set #define SC set #define MII map #define VLL vector #define VVL vector> #define SL set // Outputs #define yes cout<<"YES"< void _print(pair p); template void _print(vector v);template void _print(set v); template void _print(map v);template void _print(multiset v); template void _print(pair p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";} template void _print(vector v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} template void _print(set v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} template void _print(multiset v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";} template void _print(map v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";} ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void solve() { int a,b,k1,k2,q1,q2; cin>>a>>b>>k1>>k2>>q1>>q2; set > k,q; int x[4]={-1,1,-1,1}, y[4]={-1,-1,1,1}; for(int i=0; i<4; ++i) { k.insert({k1+a*x[i],k2+b*y[i]}); k.insert({k1+b*x[i],k2+a*y[i]}); q.insert({q1+a*x[i],q2+b*y[i]}); q.insert({q1+b*x[i],q2+a*y[i]}); } int ct=0; for(auto it:k) if(q.find(it)!=q.end()) ct++; cout<> TC; while (TC--) solve(); }