//#pragma GCC optimize("O3") #include #include using namespace std; using namespace atcoder; #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) #define all(...) std::begin(__VA_ARGS__), std::end(__VA_ARGS__) #define rall(...) std::rbegin(__VA_ARGS__), std::rend(__VA_ARGS__) #define CLR(a, b) memset((a), (b), sizeof(a)) #define DUMP(x) cout << #x << " = " << (x) << endl; #define INF (long long)1001001001001001001 #define inf 1001001000 #define MOD 998244353 #define MOD1 1000000007 #define PI 3.14159265358979 #define epsilon 1e-12 #define fcout cout << fixed << setprecision(12) #define MP make_pair #define PB push_back #define fi first #define se second #define SORT(x) sort(x.begin(),x.end()) #define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end()) using ll = long long; using ld = long double; using vi = vector; using vl = vector; using vs = vector; using vd = vector; using vld = vector; using vb = vector; using vpii = vector>; using vpil = vector>; using vpll = vector>; using vvi = vector>; using vvl = vector>; using vvd = vector>; using vvld = vector>; using vvb = vector>; using vvpii = vector>>; using vvpll = vector>>; using vvvi = vector>>; using vvvl = vector>>; using pii = pair; using pll = pair; using LL = __int128_t; using mint = atcoder::modint998244353; using vmint = vector; using vvmint = vector>; using vvvmint = vector>>; ll gcd(ll x, ll y) {if (x == 0) return y; return gcd(y%x, x);} ll lcm(ll x, ll y) { __int128_t xx,yy; xx=x; yy=y; __int128_t ans=xx * yy / gcd(x, y); ll ans2=ans; return ans2; } template T POW(T x, ll n){T ret=1; while(n>0){ if(n&1) ret=ret*x; x=x*x; n>>=1; } return ret;} template T modpow(T a, ll n, T p) { if(n==0) return (T)1; if (n == 1) return a % p; if (n % 2 == 1) return (a * modpow(a, n - 1, p)) % p; T t = modpow(a, n / 2, p); return (t * t) % p;} template T modinv(T a, T m) { if(m==0)return (T)1; T b = m, u = 1, v = 0; while (b) { T t = a / b; a -= t * b; swap(a, b); u -= t * v; swap(u, v); } u %= m; if (u < 0) u += m; return u;} template T REM(T a, T b){ return (a % b + b) % b;} template T QUO(T a, T b){ return (a - REM(a, b)) / b;} ll rand_int(ll l, ll r) { //[l, r] static mt19937_64 gen; return uniform_int_distribution(l, r)(gen); } /* const int MAXCOMB=510000; ll MODCOMB = 998244353; ll fac[MAXCOMB], finv[MAXCOMB], inv[MAXCOMB]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAXCOMB; i++) { fac[i] = fac[i - 1] * i % MODCOMB; inv[i] = MODCOMB - inv[MODCOMB%i] * (MODCOMB / i) % MODCOMB; finv[i] = finv[i - 1] * inv[i] % MODCOMB; }} ll COM(ll n, ll k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MODCOMB) % MODCOMB;} ll com(ll n,ll m){ if(n FAC(MAXCOMB), FINV(MAXCOMB), INV(MAXCOMB); void COMinit() {FAC[0] = FAC[1] = 1;FINV[0] = FINV[1] = 1;INV[1] = 1;for (int i = 2; i < MAXCOMB; i++) {FAC[i] = FAC[i - 1] * i;INV[i] = mint(0) - INV[mint::mod() % i] * (mint::mod() / i);FINV[i] = FINV[i - 1] * INV[i];}} mint COM(int n, int k) {if (n < k) return 0;if (n < 0 || k < 0) return 0;return FAC[n] * FINV[k] * FINV[n - k];} */ template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false));} template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false));} template T BS(vector &vec, T key) {return lower_bound(vec.begin(), vec.end(), key) - vec.begin();} template pair RangeBS(vector &vec, T lowv, T highv){auto itr_l = lower_bound(vec.begin(), vec.end(), lowv); auto itr_r = upper_bound(vec.begin(), vec.end(), highv); return make_pair(distance(vec.begin(), itr_l), distance(vec.begin(), itr_r)-1);} void fail() { cout << "-1\n"; exit(0); } void no() { cout << "No\n"; exit(0); } void yes() { cout << "Yes\n"; exit(0); } template void er(T a) { cout << a << '\n'; exit(0); } bool range_in(int i, int j, int h, int w){ if(i<0 || j<0 || i>=h || j>=w) return false; return true;} int bitcount(int n){n=(n&0x55555555)+(n>>1&0x55555555); n=(n&0x33333333)+(n>>2&0x33333333); n=(n&0x0f0f0f0f)+(n>>4&0x0f0f0f0f); n=(n&0x00ff00ff)+(n>>8&0x00ff00ff); n=(n&0x0000ffff)+(n>>16&0x0000ffff); return n;} template struct Edge{ int from, to, index; T cost; Edge() : from(-1), to(-1), index(-1), cost(0) {} Edge(int _to) : from(-1), to(_to), index(-1), cost(0) {} Edge(int _to, T _cost) : from(-1), to(_to), index(-1), cost(_cost) {} Edge(int _from, int _to, int _index) : from(_from), to(_to), index(_index), cost(0) {} Edge(int _from, int _to, int _index, T _cost) : from(_from), to(_to), index(_index), cost(_cost) {} bool operator<(const Edge& other) const { return cost < other.cost; } Edge &operator=(const int &x) { to = x; return *this; } operator int() const { return to; } }; using Graph = vector>; template using WGraph = vector>>; ////////////////////////////////////////////////////////////////////////////////////////// ll area(ll ax, ll ay, ll bx, ll by){ return abs(ax*by-ay*bx); } void solve(){ ll d,x,y; cin>>d>>x>>y; if(x>y)swap(x,y); if(x==0){ cout<1){ ll mid=(l+r)/2; ll nx=x+dx*mid; ll ny = y+dy*mid; if(nx<0 || ny<0 || nx>d || ny>d){ r=mid; } else l=mid; } ll nx=x+dx*l; ll ny = y+dy*l; ans=area(x,y,nx,ny); l=0; r=3*d/max(dx,dy); while(r-l>1){ ll mid=(l+r)/2; ll nx=x-dx*mid; ll ny = y-dy*mid; if(nx<0 || ny<0 || nx>d || ny>d){ r=mid; } else l=mid; } nx = x-dx*l; ny = y-dy*l; chmax(ans,area(x,y,nx,ny)); cout<> TT; while(TT--) solve(); }