#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define MOD 1000000007
#define INF 1000000019
#define POT (1<<20)
#define INFL 1000000000000000099LL
ll p1,k1,p2,k2,p3,k3,X,Y,Z,val, mx,my,mz,a,b,c;
bool inv=0;
ll cnt=0;
ll zap(ll x,ll y,ll z){
cnt++;
if(x<1 || y<1 || z<1 || x>X || y>Y || z>Z)return -1;
if(inv)x=a-x+1;
cout<<"? "<<x<<" "<<y<<" "<<z<<endl;
ll ans=10000000-abs(500213-x);
cin>>ans;
return ans;
}
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>a>>b>>c;
X=a;
Y=b;
Z=c;
ll lw=-1,pw=-1;
ll pocz=1;
ll kon=a;
ll cn=692137;
ll p1=zap(cn,1,1),p2=zap(cn-1,1,1);
if(p2<=p1){
pocz=cn;
lw=p1;
}
else{
kon=cn-1;
pw=p2;
}
while(pocz!=kon){
// cout<<pocz<<" "<<kon<<" "<<lw<<" "<<pw<<"\n";
ll mid=(pocz+kon)/2;
ll p2=zap(mid,1,1);
if(p2<lw){
kon=mid-1;
pw=-1;
}
else if(p2<=pw){
pocz=mid+1;
lw=-1;
}
else{
ll p1=zap(mid+1,1,1);
if(p1>p2){
pocz=mid+1;
lw=p1;
}
else{
kon=mid;
pw=p2;
}
}
}
cout<<"! "<<pocz<<" 1 1"<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |