Problem:
Probing the Disk
This is an interactive problem.
A thin black disk is laid flat on the square bottom of a white box. The sides of the box bottom are $10^5$ units long.
Somehow, you are not allowed to look into the box, but you want to know how large the disk is and where in the box bottom the disk is laid. You know that the shape of the disk is a true circle with an integer units of radius, not less than 100 units, and its center is integer units distant from the sides of the box bottom. The radius of the disk is, of course, not greater than the distances of the center of the disk from any of the sides of the box bottom.
You can probe the disk by projecting a thin line segment of light to the box bottom. As the reflection coefficients of the disk and the box bottom are quite different, from the overall reflection intensity, you can tell the length of the part of the segment that lit the disk.
Your task is to decide the exact position and size of the disk through repetitive probes.
Interaction
You can repeat probes, each of which is a pair of sending a query and receiving the response to it. You can probe at most 1024 times.
A query should be sent to the standard output in the following format, followed by a newline.
query
$x_1$ $y_1$ $x_2$ $y_2$
Here, $(x_1, y_1)$ and $(x_2, y_2)$ are the positions of the two ends of the line segment of the light. They have to indicate distinct points. The coordinate system is such that one of the corners of the box bottom is the origin $(0, 0)$ and the diagonal corner has the coordinates $(10^5, 10^5)$. All of $x_1$, $y_1$, $x_2$, and $y_2$ should be integers between $0$ and $10^5$, inclusive.
In response to this query, a real number is sent back to the standard input, followed by a newline. The number indicates the length of the part of the segment that lit the disk. It is in decimal notation without exponent part, with 7 digits after the decimal point. The number may contain an absolute error up to $10^{-6}$.
When you become sure about the position and the size of the disk through the probes, you can send your answer. The answer should have the center position and the radius of the disk. It should be sent to the standard output in the following format, followed by a newline.
answer
$x$ $y$ $r$
Here, $(x, y)$ should be the position of the center of the disk, and $r$ the radius of the disk. All of $x$, $y$, and $r$ should be integers.
After sending the answer, your program should terminate without any extra output. Thus, you can send the answer only once.
Notes on interactive judging
When your output violates any of the conditions above (incorrect answer, invalid format, $x_1$, $y_1$, $x_2$, or $y_2$ being out of the range, too many queries, any extra output after sending your answer, and so on), your submission will be judged as a wrong answer. As some environments require
flushing the output buffers, make sure that your outputs are actually sent. Otherwise, your outputs will never reach the judge.
You are prov
...(truncated)

Submitted solutions:

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
map<tuple<int, int, int, int>, double> cache;
double query(int x0, int y0, int x1, int y1) {
  if (cache.find({x0, y0, x1, y1}) != cache.end())
    return cache[{x0, y0, x1, y1}];
  cout << "query" << ' ' << x0 << ' ' << y0 << ' ' << x1 << ' ' << y1 << endl;
  double res;
  cin >> res;
  return cache[{x0, y0, x1, y1}] = res;
}
constexpr int SIZ = 100'000;
constexpr int STEP = 199;
constexpr double eps = 1.0e-5;
double prod(int x, int dim) {
  int x0 = x, y0 = 0, x1 = x, y1 = SIZ;
  if (dim) {
    swap(x0, y0);
    swap(x1, y1);
  }
  return query(x0, y0, x1, y1);
}
signed main() {
  int lx = 0, rx = -1;
  while (prod(lx + STEP, 0) < eps) lx += STEP;
  {
    int lo = lx, hi = SIZ;
    while (lo < hi) {
      int mid = (lo + hi + 1) / 2;
      if (eps <= prod(mid, 0)) {
        lo = mid;
      } else {
        hi = mid - 1;
      }
    }
    rx = lo;
  }
  int l = lx - 1, r = rx + 1;
  while (2 < r - l) {
    int nl = (2 * l + r) / 3, nr = (l + 2 * r) / 3;
    if (prod(nl, 0) <= prod(nr, 0)) {
      l = nl;
    } else {
      r = nr;
    }
  }
  int ans_x = (l + r) / 2, ans_y = -1, ans_r = prod(ans_x, 0) / 2;
  int sy = 0;
  if (query(ans_x, 0, ans_x, SIZ / 2) < eps) sy = SIZ / 2;
  for (int y = sy; y < SIZ; y += STEP) {
    double res = prod(y, 1);
    if (res < eps) continue;
    double D = (double)ans_r * ans_r - res * res / 4.0;

    vector<int> cands = {(int)(y - sqrt(D)), (int)(y + sqrt(D))};
    for (int y_cand : cands) {
      for (int dy = -1; dy <= 1; ++dy) {
        int yy = y_cand + dy;
        if (ans_y == -1 && 0 <= yy && yy <= SIZ &&
            abs(prod(yy, 1) - 2.0 * ans_r) < eps) {
          ans_y = yy;
        }
      }
    }
    break;
  }
  clock_t start = clock();
  while (1) {
    clock_t now = clock();
    double tim = (now - start) / CLOCKS_PER_SEC * 1000.0;
    if (300.0 < tim) break;
  }
  cout << "answer" << ' ' << ans_x << ' ' << ans_y << ' ' << ans_r << endl;
}
accuracy: 1
time_ms: 1000
memory_kb: 3840
final_rank: 4

code_snippet: #include <bits/stdc++.h>
using namespace std;
const int M = 1e5;
const int D = 199;

const int X = M / 2, Y = M / 2, R = 100;

struct vec {
	int x, y;
	vec(int x, int y) : x(x), y(y) {};
	vec() : x(0), y(0) {};
};

double calc(int sx, int sy, int r, int v, int i) {
	if (v == 1) {
		return calc(sy, sx, r, 0, i);
	}
	// x = i*D
	double inr = pow(r, 2) - pow(i - sx, 2);
	if (inr < 0) return 0;
	return 2 * sqrt(inr);
};

double ask(vec p, vec q) {
	cout << "query " << p.x << " " << p.y << " " << q.x << " " << q.y << endl;
	double res;
	if (false) {
		if (p.x == q.x) {
			res = calc(X, Y, R, 0, p.x);
		} else {
			res = calc(X, Y, R, 1, p.y);
		}
	} else {
		cin >> res;
	}
	return res;
}

int main() {
	vector<vector<double>> res(2);
	int qtimes = 0;
	for (int v = 0; v < 2; v++) {
		for (int i = 0; i <= M; i += D) {
			vec p(0, i);
			vec q(M, i);
			if (v == 0) {
				swap(p.x, p.y);
				swap(q.x, q.y);
			}
			res[v].push_back(ask(p, q));
			qtimes++;
		}
	}
	vector<int> centre(2);
	for (int v = 0; v < 2; v++) {
		centre[v] = max_element(res[v].begin(), res[v].end()) - res[v].begin();
	}
	int tl = -1, tr = -1;
	for (int i = 0; i < res[0].size(); i++) {
		if (res[0][i] != 0) {
			tl = i;
			break;
		}
	}
	for (int i = (int)res[0].size() - 1; i >= 0; i--) {
		if (res[0][i] != 0) {
			tr = i;
			break;
		}
	}

	vector<pair<int, int>> non0s;
	for (int v = 0; v < 2; v++) {
		for (int i = 0; i < res[v].size(); i++) {
			if (res[v][i] != 0) non0s.push_back({v, i * D});
		}
	}
	mt19937 mt(time(NULL));
	shuffle(non0s.begin(), non0s.end(), mt);

	map<pair<int, int>, double> extres;
	for (int v = 0; v < 2; v++) {
		for (int tp = centre[v] * D - 5; tp <= centre[v] * D + 5; tp += 5) {
			if (tp == centre[v]) continue;
			vec p(0, tp);
			vec q(M, tp);
			if (v == 0) {
				swap(p.x, p.y);
				swap(q.x, q.y);
			}
			double res = ask(p, q);
			qtimes++;
			if (res != 0) {
				extres[{v, tp}] = res;
				non0s.push_back({v, tp});
			}
		}
	}
	reverse(non0s.begin(), non0s.end());

	// cerr << "querytime " << qtimes << endl;
	// cerr << "centre: " << centre[0] * D << " " << centre[1] * D << endl;
	// cerr << "tl: " << tl * D << endl;

	double beste = 1e100;
	int bx, by, br;
	for (int sx = max(0, (centre[0] - 1) * D); sx <= min(M, (centre[0] + 1) * D); sx++) {
		for (int sy = max(0, (centre[1] - 1) * D); sy <= min(M, (centre[1] + 1) * D); sy++) {
			for (int r = max({0, sx - tl * D, tr * D - sx}); r <= min(sx - (tl - 1) * D, (tr + 1) * D - sx); r++) {
				double tote = 0;
				for (int ti = 0; ti < min((int)non0s.size(), 10); ti++) {
					auto [v, i] = non0s[ti];
					double nowl = calc(sx, sy, r, v, i);
					double reall = extres.count({v, i}) ? extres[{v, i}] : res[v][i / D];
					tote += pow(nowl - reall, 2);
				}
				// if (sx == X && sy == Y && r == R) {
				// 	// cerr << "this error " << tote << endl;
				// }
				if (beste > tote) {
					beste = tote;
					bx = sx;
					by = sy;
					br = r;
				}
			}
		}
	}
	// cerr << "error " << beste << endl;
	cout << "answer " << bx << " " << by << " " << br << endl;
	return 0;
}
accuracy: 1
time_ms: 650
memory_kb: 3640
final_rank: 3

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define double long double
#define int long long
const ll M = 100000;

double getlen(ll r , ll sx , ll x){
	if(r-abs(sx-x) < 0)return 0;
	return 2*sqrt(r*r - (x-sx)*(x-sx));
}

ll Rc, xc, yc;

double query(int x1, int y1, int x2, int y2){
//	if(y1 == 1)return getlen(Rc, xc, x1);
//	return getlen(Rc, yc, y1);

	cout << "query " << x1 << ' ' << y1 << ' ' << x2 << ' ' <<  y2 << endl;
	double tmp; cin >> tmp;
	return tmp;
}

double is_ng(ll r, ll sx, ll x, double d){
	ll tmpx = abs(sx-x);
	return (r*r - tmpx*tmpx)*4 <= d*d;
}

double dist(ll r, ll sx, ll x, double d){
	ll tmpx = abs(sx-x);
	return abs((r*r - tmpx*tmpx)*4 - d*d);
}

tuple<int,int,int> solve(){
	vector<int> x;
	vector<double> lx;
	for(int i = 1; i <= M; i += 199){
		double tmp = query(i,1,i,M);
		if(tmp > 0){
			x.push_back(i);
			lx.push_back(tmp);
		}
	}
	/*
	for(int i = 0; i < x.size(); i++){
		cout << x[i] << ' ' << lx[i] << endl;
	}
	cout << endl;
	*/
	if(x.size() > 1){
		vector<int> nx;
		vector<double> nlx;
		int now = 0;
		while(now+1 < x.size() && lx[now] < lx[now+1])now++;
		nx.push_back(x[now]);
		nlx.push_back(lx[now]);
		now = x.size()-1;
		while(now-1 >= 0 && lx[now-1] > lx[now])now--;
		if(nx[0] != x[now]){
			nx.push_back(x[now]);
			nlx.push_back(lx[now]);
		}
		swap(x, nx);
		swap(lx , nlx);
	}
	/*
	for(int i = 0; i < x.size(); i++){
		cout << x[i] << ' ' << lx[i] << endl;
	}
	cout << endl;
	*/
	vector<int> y;
	vector<double> ly;
	for(int i = 1; i <= M; i += 199){
		double tmp = query(1,i,M,i);
		if(tmp > 0){
			y.push_back(i);
			ly.push_back(tmp);
		}
	}
	if(y.size() > 1){
		vector<int> ny;
		vector<double> nly;
		int now = 0;
		while(now+1 < y.size() && ly[now] < ly[now+1])now++;
		ny.push_back(y[now]);
		nly.push_back(ly[now]);
		now = y.size()-1;
		while(now-1 >= 0 && ly[now-1] > ly[now])now--;
		if(ny[0] != y[now]){
			ny.push_back(y[now]);
			nly.push_back(ly[now]);
		}
		swap(y, ny);
		swap(ly , nly);
	}

	if(x.size() == 1){
		ll tmpx = 0;
		double tmplx = 0;
		if(x[0]-99 >= 1){
			double tmp = query(x[0]-99,1,x[0]-99,M);
			if(tmp > 0){
				tmpx = x[0]-99;
				tmplx = tmp;
			}
		}
		if(x[0]+99 < M){
			double tmp = query(x[0]+99,1,x[0]+99,M);
			if(tmp > tmplx){
				tmpx = x[0]+99;
				tmplx = tmp;
			}
		}
		x.push_back(tmpx);
		lx.push_back(tmplx);
	}
	if(y.size() == 1){
		ll tmpy = 0;
		double tmply = 0;
		if(y[0]-99 >= 1){
			double tmp = query(1,y[0]-99,M,y[0]-99);
			tmpy = y[0]-99;
			tmply = tmp;	
		}
		if(y[0]+99 < M){
			double tmp = query(1,y[0]+99,M,y[0]+99);
			if(tmp > tmply){
				tmpy = y[0]+99;
				tmply = tmp;
			}
		}
		y.push_back(tmpy);
		ly.push_back(tmply);
	}
	if(x[0] > x[1]){
		swap(x[0] , x[1]);
		swap(lx[0] , lx[1]);
	}
	if(y[0] > y[1]){
		swap(y[0] , y[1]);
		swap(ly[0] , ly[1]);
	}
	/*
	for(int i = 0; i < x.size(); i++){
		cout << x[i] << ' ' << lx[i] << endl;
	}
	cout << endl;
	*/
	ll L = 0, R = M;
	while(R - L > 1){
		ll mid = (R + L) / 2;
		int ok = 0;
		for(int sx = x[0]; sx <= x[1]; sx++){
			for(int sy = y[0]; sy <= y[1]; sy++){
				bool tmp = 1;
				//for(int i = 0; i < 2; i++)if(getlen(mid , sx, x[i]) <= lx[i])tmp = 0;
				//for(int i = 0; i < 2; i++)if(getlen(mid , sy, y[i]) <= ly[i])tmp = 0;
				for(int i = 0; i < 2; i++)if(is_ng(mid , sx, x[i], lx[i]))tmp = 0;
				for(int i = 0; i < 2; i++)if(is_ng(mid , sy, y[i], ly[i]))tmp = 0;
				if(tmp){
					ok++;
				}
			}
		}
//		cout << mid << ' ' << ok << endl;
		if(ok)R = mid;
		else L = mid;
	}
//	cout << "LR " << L << ' ' << R << endl;
	double abssum = 1LL<<60;
	int cnt = 0;
	int ansx = 0,ansy = 0, ansr = 0;
	for(ll r = max(100LL,L-10); r <= min(R+10,M/2); r++){
		for(int sx = x[0]; sx <= x[1]; sx++){
			for(int sy = y[0]; sy <= y[1]; sy++){
				double tmp = 0;
				for(int i = 0; i < 2; i++)tmp += dist(r, sx, x[i], lx[i]);
				for(int i = 0; i < 2; i++)tmp += dist(r, sy, y[i], ly[i]);
				//for(int i = 0; i < 2; i++)if(is_ng(R, sx, x[i], lx[i]))tmp = 0;
				//for(int i = 0; i < 2; i++)if(is_ng(R, sy, y[i], ly[i]))tmp = 0;
				if(sx == xc && sy == yc){
					//cout << "! " << tmp << endl;
					//cout << (tmp > 0) << endl;
				}
				if(tmp < abssum){
					ansx = sx;
					ansy = sy;
					ansr = r;
					abssum = tmp;
				}
			}
		}
	}
	cout << "answer " << ansx << ' ' << ansy << ' ' << ansr << endl;
	return make_tuple(ansx, ansy , ansr);
}

signed main(){
	cout << fixed << setprecision(20);
	srand( (unsigned)time( NULL ) );
	int T = 1;
//	cin >> T;
	while(T--){
		while(1){
			xc = (rand() % M) + 1;
			yc = (rand() % M) + 1;
			Rc = (rand() % M) + 1;
			if(Rc < 100)continue;
			if(xc-Rc < 0 || xc+Rc >= M)continue;
			if(yc-Rc < 0 || yc+Rc >= M)continue;
			break;
		}
//		cout << xc << ' ' << yc << ' ' << Rc << endl;
		auto res = solve();
		if(make_tuple(xc,yc,Rc) != res){
			cout << "correst " << xc << ' ' << yc << ' ' << Rc << endl;
			cout << "answer " << get<0>(res) << ' ' << get<1>(res) << ' ' << get<2>(res) << endl;
			return 0;
		}
	}
	return 0;

}
accuracy: 0.5632183908045977
time_ms: 10
memory_kb: 3616
final_rank: 5

code_snippet: #include <bits/stdc++.h>
using namespace std;
#define rep2(i, m, n) for (auto i = (m); i < (n); i++)
#define rep(i, n) rep2(i, 0, n)
#define repr2(i, m, n) for (auto i = (m); i-- > (n);)
#define repr(i, n) repr2(i, 0, n)
#define all(x) begin(x), end(x)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vc = vector<char>;
using pii = pair<int, int>;

const double EPS = 2e-6;
const int DIM = 100000;

double ask(int x1, int y1, int x2, int y2) {
  printf("query %d %d %d %d\n", x1, y1, x2, y2);
  fflush(stdout);
  double x; scanf("%lf", &x);
  return x;
}

void solve() {
  pair maxi(-1.0, -1);
  for (int x = 0; x <= DIM; x += 100)
    maxi = max(maxi, pair(ask(x, 0, x, DIM), x));
  int x = maxi.second;
  int lo = 0, hi = DIM;
  while (hi - lo > 1) {
    int m = (lo + hi) / 2;
    (ask(x, 0, x, m) < EPS ? lo : hi) = m;
  }
  int y = hi + 1;
  double l = x - ask(0, y, x, y);
  double r = x + ask(x, y, DIM, y);
  double u = y - ask(x, 0, x, y);
  double d = y + ask(x, y, x, DIM);
  int cx = round((l+r) / 2);
  int cy = round((u+d) / 2);
  int rad = round(sqrt(pow(abs(cx - x), 2) + pow(abs(cy - u), 2)));
  printf("answer %d %d %d\n", cx, cy, rad);
}

int main() {
  int n = 1;
  // scanf("%d", &n);
  while (n--) solve();
}
accuracy: 1
time_ms: 10
memory_kb: 3640
final_rank: 2

code_snippet: #include <bits/stdc++.h>
using namespace std;
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
template<int mod>istream &operator>>(istream &is,static_modint<mod> &a){long long b;is>>b;a=b;return is;}
istream &operator>>(istream &is,modint &a){long long b;cin>>b;a=b;return is;}
#endif
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) static_cast<void>(0)
#define debugg(...) static_cast<void>(0)
#define esper(...) static_cast<void>(0)
template<typename T1,typename T2>ostream &operator<<(ostream &os,const pair<T1,T2>&p){os<<p.first<<' '<<p.second;return os;}
#endif
using ll=long long;
using ull=unsigned long long;
using P=pair<ll,ll>;
template<typename T>using minque=priority_queue<T,vector<T>,greater<T>>;
template<typename T>bool chmax(T &a,const T &b){return (a<b?(a=b,true):false);}
template<typename T>bool chmin(T &a,const T &b){return (a>b?(a=b,true):false);}
template<typename T1,typename T2>istream &operator>>(istream &is,pair<T1,T2>&p){is>>p.first>>p.second;return is;}
template<typename T>istream &operator>>(istream &is,vector<T> &a){for(auto &i:a)is>>i;return is;}
template<typename T1,typename T2>void operator++(pair<T1,T2>&a,int n){a.first++,a.second++;}
template<typename T1,typename T2>void operator--(pair<T1,T2>&a,int n){a.first--,a.second--;}
template<typename T>void operator++(vector<T>&a,int n){for(auto &i:a)i++;}
template<typename T>void operator--(vector<T>&a,int n){for(auto &i:a)i--;}
#define reps(i,a,n) for(int i=(a);i<int(n);i++)
#define rep(i,n) reps(i,0,n)
#define all(x) x.begin(),x.end()
#define pcnt(x) __builtin_popcountll(x)
#define fin(x) return cout<<x<<'\n',static_cast<void>(0)
ll myceil(ll a,ll b){return (a+b-1)/b;}
template<typename T,size_t n,size_t id=0>
auto vec(const int (&d)[n],const T &init=T()){
  if constexpr (id<n)return vector(d[id],vec<T,n,id+1>(d,init));
  else return init;
}
void SOLVE();
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout<<fixed<<setprecision(16);
  #ifdef LOCAL
  clock_t start=clock();
  #endif
  int testcase=1;
  //cin>>testcase;
  for(int i=0;i<testcase;i++){
    SOLVE();
  }
  #ifdef LOCAL
  cerr<<"time:";
  cerr<<(clock()-start)/1000;
  cerr<<"ms\n";
  #endif
}
using R=long double;
void SOLVE(){
  #ifdef LOCAL
  int ansx,ansy,ansr;
  cin>>ansx>>ansy>>ansr;
  int qcnt=0;
  #endif
  auto query=[&](int lx,int ly,int rx,int ry)->R {
    #ifdef LOCAL
    assert(qcnt++<1024);
    if(lx==rx&&ly==0&&ry==100000){
      if(abs(ansx-lx)>ansr)return 0;
      return 2*sqrtl(ansr*ansr-pow(ansx-lx,2));
    }
    else if(ly==ry&&lx==0&&rx==100000){
      if(abs(ansy-ly)>ansr)return 0;
      return 2*sqrtl(ansr*ansr-pow(ansy-ly,2));
    }
    else{
      assert(ly==ry);
      bool f=pow(ansx-lx,2)+pow(ansy-ly,2)<=ansr*ansr+1e-12;
      bool g=pow(ansx-rx,2)+pow(ansy-ry,2)<=ansr*ansr+1e-12;
      if(f!=g)return 0;
      return rx-lx;
    }
    #else
    cout<<"query "<<lx<<' '<<ly<<' '<<rx<<' '<<ry<<endl;
    R x;
    cin>>x;
    return x;
    #endif
  };
  auto top2=[&](vector<R>q)->vector<pair<int,int>> {
    int x=(max_element(all(q))-q.begin())*199;
    int r=max(100,int(floor(q[x/199]))/2);
    debug(x,r);
    vector<pair<R,pair<int,int>>>ret;
    reps(i,max(0,x-200),min(100001,x+200)){
      reps(j,r,min(500000,r+200)){
        R diff=0;
        rep(k,503){
          R ex=0;
          if(abs(i-199*k)<j){
            ex=2*sqrtl(pow(j,2)-pow(199*k-i,2));
          }
          if(q[k]==0&&ex!=0)diff+=1e18;
          diff+=abs(ex-q[k]);
        }
        ret.push_back({diff,{i,j}});
      }
    }
    sort(all(ret));
    vector<pair<int,int>>ret2;
    rep(i,5)ret2.push_back(ret[i].second);
    return ret2;
  };
  vector<R>xq(503),yq(503);
  rep(i,503)xq[i]=query(199*i,0,199*i,100000);
  rep(i,503)yq[i]=query(0,199*i,100000,199*i);
  auto xk=top2(xq),yk=top2(yq);
  debug(xk,yk);
  for(auto [x,r1]:xk)for(auto [y,r2]:yk)if(r1==r2){
    if(query(x,y,x+r1,y)==r1){
      cout<<"answer "<<x<<' '<<y<<' '<<r1<<endl;
      return;
    }
  }
  assert(false);
}
accuracy: 0.12643678160919541
time_ms: 350
memory_kb: 11376
final_rank: 6

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
const int MAX = 100000;

int main(){
    auto query = [&](ll x1, ll y1, ll x2, ll y2) -> ld {
        cout << "query " << x1 << " " << y1 << " " << x2 << " " << y2 << endl;
        ld ret; cin >> ret;
        return ret;
    };
    // determine gx
    ll gx;
    {
        ld max_len = -1.;
        for(int i = 0; i < 1000; i++){
            ll x = i * 100;
            ld len = query(x, 0, x, MAX);
            if(len > max_len){
                max_len = len;
                gx = x;
            }
        }
    }

    // determine gy
    ll gy;
    {
        ll ok = MAX, ng = 0;
        for(int q = 0; q < 15; q++){
            ll mid = (ok + ng) / 2;
            if(mid == MAX || mid == 0) break;
            ld len = query(gx, 0, gx, mid);
            if(len > 1e-3){
                ok = mid;
            }
            else{
                ng = mid;
            }
        }
        gy = ok;
    }


    // cerr << "gx = " << gx << endl;
    // cerr << "gy = " << gy << endl;
    ll ansx, ansy;
    {
        ld x1 = query(gx, gy, 0, gy);
        ld x2 = query(gx, gy, MAX, gy);
        ansx = gx + round((x2 - x1) / 2);

        ld y1 = query(gx, gy, gx, 0);
        ld y2 = query(gx, gy, gx, MAX);
        ansy = gy + round((y2 - y1) / 2);
    }

    ll r = round(query(ansx, ansy, ansx, MAX));
    cout << "answer " << ansx << " " << ansy << " " << r << endl;
}
accuracy: 1
time_ms: 10
memory_kb: 3612
final_rank: 1