QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#883022#9734. Identify ChordlsxhyydsWA 71ms3712kbC++144.9kb2025-02-05 14:26:472025-02-05 14:26:49

Judging History

This is the latest submission verdict.

  • [2025-02-05 14:26:49]
  • Judged
  • Verdict: WA
  • Time: 71ms
  • Memory: 3712kb
  • [2025-02-05 14:26:47]
  • Submitted

answer

//#ifndef fio
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse3","sse2","sse")
//#pragma GCC target("avx","sse4","sse4.1","sse4.2","ssse3")
//#pragma GCC target("f16c")
//#pragma GCC optimize("inline","fast-math","unroll-loops","no-stack-protector")
//#pragma GCC diagnostic error "-fwhole-program"
//#pragma GCC diagnostic error "-fcse-skip-blocks"
//#pragma GCC diagnostic error "-funsafe-loop-optimizations"
//#pragma GCC diagnostic error "-std=c++20"
//#endif
#include <bits/stdc++.h>
#define N 1000005
#define M 3000005
#define ll long long
#define uint unsigned int
#define ull unsigned long long
#define i128 __int128
#define mk make_pair
#define x first
#define y second
//#define bas 20200721
//#define bas 1000000007
#define ls(x) (x<<1)
#define rs(x) (x<<1|1)
#define VI vector<int>
#define VL vector<ll>
#define lowbit(x) (x&(-x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PIL pair<int,ll>
#define PLI pair<ll,int>
#define PDI pair<double,int>
#define PDD pair<double,double>
#define PVL pair<VI,ll>
#define eps (1e-9)
#define mod 1000000007
//#define double long double
//#define int long long
using namespace std;
//int mod=998244353;
const double Pi=acos(-1);
struct mint {
	int x;
	mint() : x(0) {}
	mint(long long y, bool flag = 0) {
		if (flag) x = (int)(y);
		else x = (int)((y % mod + mod) % mod);
	}
	friend const mint ksm(mint a, long long b);
	const mint inv() {return ksm(*this, mod - 2);}
};
bool operator == (const mint a, const mint b) {return a.x == b.x;}
bool operator != (const mint a, const mint b) {return a.x != b.x;}
bool operator <(const mint a,const mint b){return a.x<b.x;}
bool operator >(const mint a,const mint b){return a.x>b.x;}
int operator ! (const mint a) {return !a.x;}
const mint operator + (const mint a, const mint b) {
	mint res(a.x + b.x, 1);
	if (res.x >= mod) res.x -= mod;
	return res;
}
mint& operator += (mint &a, const mint b) {
	a.x += b.x;
	if (a.x >= mod) a.x -= mod;
	return a;
}
const mint operator - (const mint a, const mint b) {
	mint res(a.x - b.x, 1);
	if (res.x < 0) res.x += mod;
	return res;
}
mint& operator -= (mint &a, const mint b) {
	a.x -= b.x;
	if (a.x < 0) a.x += mod;
	return a;
}
const mint operator * (const mint a, const mint b) {
	return mint((long long)a.x * b.x % mod, 1);
}
mint& operator *= (mint &a, const mint b) {
	a.x = (int)((long long)a.x * b.x % mod);
	return a;
}
const mint ksm(mint a, long long b) {
	mint res(1, 1);
	for (; b; a *= a, b >>= 1)
		if (b & 1) res *= a;
	return res;
}
const mint operator / (const mint a, const mint b) {
	return a * ksm(b, mod - 2);
}
mint& operator /= (mint &a, const mint b) {
	a = a * ksm(b, mod - 2);
	return a;
}
ostream& operator << (ostream &out, const mint a) {
	return out << a.x;
}
istream& operator >> (istream &in, mint &a) {
	long long y;
	in >> y, a = mint(y);
	return in;
}
PLL operator +(PLL a,PLL b){
	return mk(a.x+b.x,a.y+b.y);
}
PLL operator +=(PLL &a,const PLL b){
	a=a+b;
	return a;
}
PLL operator *(PLL a,int b){
	a=mk(a.x*b,a.y*b);
	return a;
}
void chkmx(ll &x,ll y){
	x=max(x,y);
}
void chkmn(ll &x,ll y){
	x=min(x,y);
}

int tt;
int n,m,q,k;
string s;
int a[N];
int qy(int x,int y){
	cout<<"? "<<x<<' '<<y<<'\n';
	cout.flush();
	int p;
	cin>>p;
	return p;
}
int lst(int x,int y){
	--x;
	x-=y;
	x=(x%n+n)%n;
	return x+1;
}
int nxt(int x,int y){
	--x;
	x+=y;
	x%=n;
	return x+1;
}
int dis(int x,int y){
	if(x<=y)return y-x;
	return n-x+y;
}
mt19937 rd(time(0));
void solve(){
	cin>>n;
	int z1=n/2,x,y;
	while(z1==n/2){
		x=rd()%n+1;
		// cout<<x<<' '<<y<<"pp\n";
		y=nxt(x,n/2);

		z1=qy(x,y);
	}
	if(z1==1){
		cout<<"! "<<x<<' '<<y<<'\n';
		cout.flush();
		return ;
	}
	int qi=-1;
	// cerr<<" "<<x<<' '<<y<<"[[\n";
	if(qy(lst(x,1),y)<z1){
		// cerr<<"pp\n";
		int l=1,r=n-n/2,ans=-1;
		// int 
		while(l<=r){
			int mid=(l+r)>>1;
			if(qy(lst(x,mid),y)==z1-mid){
				ans=mid;l=mid+1;
			}
			else
				r=mid-1;
		}
		qi=lst(x,ans);
	}
	else{
		// cerr<<"jj\n";
		int l=0,r=n/2,ans=0;
		while(l<=r){
			int mid=(l+r)>>1;
			if(qy(nxt(x,mid),y)==z1-mid){
				ans=mid;l=mid+1;
			}
			else
				r=mid-1;
		}
		qi=nxt(x,ans);
	}
	if(n%2==0){
		int dd=qy(qi,nxt(qi,n/2));
		int shi=n/2-dd+1;
		// cerr<<qi<<' '<<dd<<' '<<shi<<";;\n";
		if(qy(qi,nxt(qi,shi))==1)cout<<"! "<<qi<<" "<<nxt(qi,shi)<<'\n';
		else cout<<"! "<<qi<<" "<<lst(qi,shi)<<'\n';
		cout.flush();
	}
	else{
		int dd=qy(qi,nxt(qi,n/2));
		int shi=n/2-dd+1;
		if(qy(qi,nxt(qi,shi))==1)cout<<"! "<<qi<<" "<<nxt(qi,shi)<<'\n';
		else{
			cout<<"! "<<qi<<' '<<nxt(nxt(qi,n/2),dd-1)<<'\n';
		}
	}
}
signed main(){
	// freopen("line.in","r",stdin);
	// freopen("line.out","w",stdout);
	// ios::sync_with_stdio(false);
	// cin.tie(0),cout.tie(0);
	cin>>tt;
	while(tt--){
		solve();
		int p;
		cin>>p;
	}	
	return 0;
}
/*

*/

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3712kb

input:

2
6
2
2
2
2
2
2
1
4
2
1
1

output:

? 4 1
? 3 1
? 5 1
? 4 1
? 4 1
? 4 6
! 4 2
? 4 2
? 3 1
! 3 1

result:

ok ok (2 test cases)

Test #2:

score: 0
Accepted
time: 15ms
memory: 3712kb

input:

1000
15
7
6
5
4
4
5
6
2
1
19
8
7
5
6
5
4
2
3
1
17
7
8
4
6
5
4
1
1
1
15
7
6
7
4
5
5
6
1
1
14
5
6
4
4
5
5
1
1
15
2
3
4
3
2
2
3
1
17
1
1
20
6
5
3
4
3
2
6
5
1
13
6
6
4
5
3
3
2
2
1
1
18
3
4
3
2
1
2
3
1
1
13
3
4
3
2
3
3
1
1
14
6
5
3
4
3
2
3
1
17
8
8
7
6
2
2
3
5
4
1
12
5
5
3
4
3
1
1
1
10
3
4
3
3
2
3
1
1
14...

output:

? 7 14
? 10 2
? 9 2
? 6 2
? 8 2
? 7 2
? 8 15
? 8 10
! 8 5
? 16 6
? 15 6
? 11 6
? 14 6
? 13 6
? 12 6
? 12 2
? 12 1
! 12 3
? 17 8
? 16 8
? 4 8
? 1 8
? 2 8
? 3 8
? 3 11
? 3 11
! 3 11
? 10 2
? 15 7
? 14 7
? 3 7
? 1 7
? 2 7
? 1 8
? 1 3
! 1 3
? 1 8
? 14 8
? 4 8
? 2 8
? 3 8
? 2 9
? 2 5
! 2 5
? 9 1
? 8 1
? ...

result:

ok ok (1000 test cases)

Test #3:

score: 0
Accepted
time: 15ms
memory: 3712kb

input:

1000
21
2
1
5
3
1
2
2
3
1
22
10
10
6
8
7
7
4
7
1
20
9
9
4
2
3
3
5
1
1
22
4
5
5
2
3
4
1
1
21
5
6
2
3
2
1
5
1
1
21
8
7
5
5
4
5
8
3
1
24
5
6
6
5
5
4
5
1
1
22
10
10
5
3
4
3
10
1
1
21
8
9
5
6
5
6
2
3
1
23
8
7
6
9
7
8
8
4
1
21
10
4
5
3
2
1
2
4
1
1
24
7
6
6
8
6
7
7
6
1
20
9
9
5
7
7
9
1
1
24
12
11
11
5
3
4
...

output:

? 11 21
? 10 21
? 5 21
? 8 21
? 10 21
? 9 21
? 10 20
? 10 19
! 10 21
? 22 11
? 21 11
? 5 11
? 2 11
? 3 11
? 4 11
? 3 14
? 3 11
! 3 17
? 19 9
? 18 9
? 4 9
? 7 9
? 5 9
? 6 9
? 5 15
? 5 11
! 5 11
? 5 16
? 4 16
? 10 16
? 7 16
? 8 16
? 7 18
? 7 15
! 7 15
? 3 13
? 2 13
? 8 13
? 5 13
? 6 13
? 7 13
? 7 17
?...

result:

ok ok (1000 test cases)

Test #4:

score: 0
Accepted
time: 15ms
memory: 3712kb

input:

1000
25
9
8
6
6
8
7
9
4
1
25
12
12
7
8
6
7
7
6
5
8
1
25
5
6
5
3
3
2
5
1
1
25
5
6
6
5
5
4
5
1
1
26
12
12
6
3
4
3
12
1
1
26
7
6
6
6
6
5
7
7
1
26
11
10
4
3
3
4
11
3
1
27
12
13
6
3
4
4
12
1
1
25
12
9
8
6
6
4
5
9
4
1
27
9
10
3
3
3
2
9
1
1
27
13
13
10
11
7
8
8
7
10
1
1
27
10
9
7
7
5
6
2
3
1
26
7
8
3
5
3
2...

output:

? 9 21
? 8 21
? 2 21
? 6 21
? 4 21
? 5 21
? 6 18
? 6 10
! 6 1
? 18 5
? 4 16
? 8 20
? 7 20
? 14 20
? 10 20
? 8 20
? 9 20
? 9 21
? 9 17
! 9 25
? 20 7
? 19 7
? 1 7
? 22 7
? 24 7
? 23 7
? 23 10
? 23 6
! 23 6
? 2 14
? 1 14
? 8 14
? 4 14
? 2 14
? 3 14
? 3 15
? 3 11
! 3 11
? 9 22
? 8 22
? 15 22
? 19 22
? 1...

result:

ok ok (1000 test cases)

Test #5:

score: 0
Accepted
time: 11ms
memory: 3712kb

input:

1000
29
12
11
4
3
5
5
6
9
1
28
7
6
7
6
6
5
3
1
1
30
1
1
29
5
4
7
3
3
2
5
9
1
28
14
14
6
7
5
3
3
2
6
1
1
29
9
10
7
6
6
5
1
1
1
29
14
8
9
7
7
7
6
8
1
1
28
11
10
4
3
5
5
11
4
1
30
14
14
8
11
9
9
4
7
1
30
15
10
11
3
4
5
4
6
1
1
28
13
13
7
11
12
11
9
6
1
29
14
13
14
6
2
1
2
13
1
1
29
11
12
4
3
2
3
11
1
1...

output:

? 11 25
? 10 25
? 3 25
? 28 25
? 1 25
? 2 25
? 3 17
? 3 12
! 3 22
? 26 12
? 25 12
? 19 12
? 23 12
? 25 12
? 24 12
? 24 10
? 24 8
! 24 8
? 17 2
! 17 2
? 16 1
? 15 1
? 8 1
? 12 1
? 14 1
? 13 1
? 13 27
? 13 23
! 13 2
? 19 5
? 19 5
? 10 24
? 9 24
? 17 24
? 13 24
? 15 24
? 14 24
? 14 28
? 14 23
! 14 23
?...

result:

ok ok (1000 test cases)

Test #6:

score: 0
Accepted
time: 15ms
memory: 3712kb

input:

1000
32
13
14
8
12
12
11
13
1
1
30
14
14
8
11
10
10
14
1
1
32
4
3
8
6
4
3
2
1
1
31
6
7
8
9
7
6
6
10
1
32
11
12
7
8
6
5
6
3
1
1
32
6
7
6
3
3
2
6
1
1
31
9
10
2
4
2
1
9
1
1
31
9
10
4
6
4
3
5
1
1
32
12
11
8
8
8
7
12
5
1
30
14
14
7
3
2
2
14
1
1
31
8
9
8
9
7
8
6
10
1
31
10
9
6
6
4
5
10
6
1
33
9
8
8
11
9
8...

output:

? 3 19
? 2 19
? 11 19
? 6 19
? 4 19
? 5 19
? 5 21
? 5 9
! 5 9
? 22 7
? 21 7
? 29 7
? 25 7
? 27 7
? 26 7
? 26 11
? 26 28
! 26 28
? 27 11
? 26 11
? 19 11
? 23 11
? 25 11
? 26 11
? 26 10
? 26 9
! 26 9
? 15 30
? 14 30
? 22 30
? 18 30
? 16 30
? 15 30
? 15 30
? 15 25
! 15 4
? 15 31
? 14 31
? 23 31
? 18 31...

result:

ok ok (1000 test cases)

Test #7:

score: 0
Accepted
time: 13ms
memory: 3712kb

input:

1000
34
10
9
7
6
4
5
10
8
1
33
13
14
8
12
12
11
9
8
1
33
10
11
8
7
7
6
10
1
1
34
15
14
8
11
11
10
5
1
1
34
15
16
9
12
12
13
9
9
1
35
15
16
9
14
16
15
15
3
1
34
12
13
6
9
7
6
5
4
1
1
34
6
7
9
5
5
4
6
1
1
34
16
16
9
13
12
12
16
1
1
33
9
8
4
5
3
2
3
9
8
1
33
15
16
8
12
11
11
15
1
1
34
16
16
8
3
2
2
16
...

output:

? 11 28
? 10 28
? 2 28
? 7 28
? 5 28
? 4 28
? 5 22
? 5 13
! 5 31
? 13 29
? 12 29
? 21 29
? 16 29
? 14 29
? 15 29
? 15 31
? 15 23
! 15 6
? 20 3
? 19 3
? 28 3
? 23 3
? 25 3
? 24 3
? 24 7
? 24 31
! 24 31
? 3 20
? 2 20
? 28 20
? 33 20
? 31 20
? 32 20
? 32 15
? 32 11
! 32 11
? 33 16
? 32 16
? 7 16
? 2 16...

result:

ok ok (1000 test cases)

Test #8:

score: 0
Accepted
time: 10ms
memory: 3712kb

input:

1000
36
17
17
8
4
6
6
17
1
1
36
13
12
8
9
7
6
7
3
5
1
36
13
14
4
4
2
3
13
1
1
36
5
4
9
5
3
4
5
9
1
36
9
8
9
11
9
8
9
10
1
36
10
11
3
6
4
3
2
8
1
1
35
12
13
9
9
7
8
12
1
1
36
9
8
2
5
3
2
1
9
10
1
36
4
3
9
4
2
3
4
7
1
36
16
15
9
12
10
11
16
3
1
36
3
2
9
5
3
2
1
1
1
36
12
13
9
8
6
7
2
1
1
36
17
16
8
4
...

output:

? 7 25
? 6 25
? 16 25
? 21 25
? 18 25
? 19 25
? 18 36
? 18 20
! 18 20
? 6 24
? 5 24
? 33 24
? 2 24
? 36 24
? 35 24
? 34 24
? 35 17
? 35 15
! 35 19
? 29 11
? 28 11
? 2 11
? 7 11
? 4 11
? 5 11
? 4 22
? 4 10
! 4 10
? 19 1
? 18 1
? 10 1
? 15 1
? 17 1
? 16 1
? 17 35
? 17 31
! 17 3
? 7 25
? 6 25
? 34 25
?...

result:

ok ok (1000 test cases)

Test #9:

score: 0
Accepted
time: 12ms
memory: 3584kb

input:

1000
37
6
7
9
8
5
6
6
1
1
36
17
16
8
3
2
3
17
2
1
38
9
10
10
9
8
7
8
9
1
1
37
12
11
2
4
4
3
12
7
1
37
12
11
2
4
4
3
12
7
1
36
8
7
9
4
6
5
8
11
1
37
7
6
9
10
7
6
5
1
1
37
3
2
9
6
3
2
3
5
1
37
16
17
7
4
5
4
3
16
1
1
37
18
16
17
7
4
7
8
4
1
1
37
10
9
2
5
3
2
1
10
9
1
37
18
18
17
18
8
4
7
7
17
1
1
36
7
...

output:

? 13 31
? 12 31
? 22 31
? 17 31
? 14 31
? 15 31
? 14 32
? 14 27
! 14 27
? 6 24
? 5 24
? 33 24
? 28 24
? 26 24
? 27 24
? 28 10
? 28 30
! 28 26
? 5 24
? 4 24
? 14 24
? 9 24
? 6 24
? 7 24
? 8 24
? 7 26
? 7 18
! 7 18
? 31 12
? 30 12
? 21 12
? 16 12
? 19 12
? 20 12
? 21 2
? 21 28
! 21 13
? 37 18
? 36 18
...

result:

ok ok (1000 test cases)

Test #10:

score: 0
Accepted
time: 13ms
memory: 3712kb

input:

1000
39
9
8
10
8
7
6
7
9
11
1
38
14
15
10
12
13
12
11
8
12
1
38
13
14
4
5
4
3
9
1
1
39
16
15
10
15
14
15
12
1
1
38
15
16
10
15
14
13
14
15
1
1
39
8
9
10
8
7
6
7
4
7
1
39
14
15
5
4
3
2
3
14
1
1
38
18
17
9
13
11
11
18
2
1
39
14
13
4
5
6
5
14
6
1
39
11
12
10
7
7
6
11
1
1
39
4
5
9
4
3
2
3
4
1
1
38
18
18...

output:

? 28 8
? 27 8
? 18 8
? 23 8
? 26 8
? 25 8
? 24 8
? 25 5
? 25 36
! 25 13
? 30 11
? 29 11
? 1 11
? 34 11
? 31 11
? 32 11
? 33 11
? 33 14
? 33 7
! 33 21
? 5 24
? 4 24
? 14 24
? 19 24
? 16 24
? 15 24
? 15 34
? 15 26
! 15 26
? 4 23
? 3 23
? 33 23
? 38 23
? 2 23
? 1 23
? 2 21
? 2 10
! 2 10
? 19 38
? 18 38...

result:

ok ok (1000 test cases)

Test #11:

score: 0
Accepted
time: 15ms
memory: 3712kb

input:

1000
40
20
12
13
10
8
9
7
8
2
3
1
40
14
13
6
9
7
6
5
6
11
1
40
11
10
10
14
11
10
11
10
1
40
8
7
6
3
3
2
8
13
1
40
16
17
6
5
4
3
4
16
1
1
40
3
2
10
6
3
2
3
5
1
41
15
14
10
16
15
14
13
1
1
40
7
6
7
2
4
3
7
13
1
40
18
19
8
5
6
5
4
18
1
1
40
10
9
6
5
3
4
6
11
1
40
6
7
10
8
5
6
4
7
1
41
12
13
10
10
11
10...

output:

? 37 17
? 21 1
? 20 1
? 31 1
? 25 1
? 28 1
? 26 1
? 27 1
? 26 6
? 26 5
! 26 7
? 36 16
? 35 16
? 26 16
? 31 16
? 29 16
? 28 16
? 27 16
? 27 7
? 27 2
! 27 12
? 4 24
? 3 24
? 34 24
? 39 24
? 2 24
? 3 24
? 3 23
? 3 13
! 3 33
? 20 40
? 19 40
? 10 40
? 15 40
? 13 40
? 14 40
? 14 34
? 14 27
! 14 1
? 10 30
...

result:

ok ok (1000 test cases)

Test #12:

score: 0
Accepted
time: 12ms
memory: 3584kb

input:

1000
42
11
10
2
6
3
2
1
11
11
1
41
17
16
6
5
4
5
17
4
1
41
18
17
10
13
12
12
11
4
1
1
41
13
12
10
8
9
7
8
1
1
1
41
20
9
8
10
12
9
8
9
12
1
41
11
12
10
13
10
11
9
12
1
41
14
13
10
15
12
13
14
7
1
41
2
1
10
5
2
1
2
3
1
41
10
9
10
11
8
9
10
11
1
41
16
15
10
16
16
15
14
1
1
41
6
7
10
6
5
4
5
2
3
1
42
20...

output:

? 27 6
? 26 6
? 16 6
? 22 6
? 19 6
? 18 6
? 17 6
? 17 38
? 17 28
! 17 6
? 10 30
? 9 30
? 40 30
? 35 30
? 38 30
? 37 30
? 38 17
? 38 1
! 38 33
? 6 26
? 5 26
? 36 26
? 1 26
? 39 26
? 41 26
? 40 26
? 40 19
? 40 16
! 40 16
? 22 1
? 21 1
? 11 1
? 17 1
? 14 1
? 16 1
? 15 1
? 16 36
? 16 36
! 16 36
? 37 16
...

result:

ok ok (1000 test cases)

Test #13:

score: 0
Accepted
time: 12ms
memory: 3584kb

input:

1000
43
10
11
8
6
5
5
4
4
1
1
42
18
17
7
5
5
6
18
4
1
43
18
17
11
13
14
12
13
6
1
1
43
17
18
11
13
10
9
10
1
1
1
43
20
19
11
17
18
17
18
14
1
1
43
20
19
9
5
8
8
7
8
14
1
43
18
19
11
14
14
15
18
1
1
43
21
21
21
20
21
10
5
7
7
20
1
1
42
19
20
9
5
6
5
4
13
1
1
42
20
19
10
16
18
17
17
20
2
1
42
11
10
10...

output:

? 40 18
? 39 18
? 7 18
? 1 18
? 4 18
? 2 18
? 3 18
? 3 24
? 3 21
! 3 21
? 33 12
? 32 12
? 22 12
? 17 12
? 20 12
? 19 12
? 20 41
? 20 24
! 20 16
? 11 32
? 10 32
? 43 32
? 6 32
? 3 32
? 5 32
? 4 32
? 5 26
? 5 21
! 5 21
? 6 27
? 5 27
? 16 27
? 10 27
? 13 27
? 14 27
? 15 27
? 14 35
? 14 35
! 14 35
? 43 ...

result:

ok ok (1000 test cases)

Test #14:

score: 0
Accepted
time: 10ms
memory: 3712kb

input:

1000
44
18
17
11
17
16
17
14
1
1
44
22
17
18
10
12
9
8
9
3
1
1
43
17
16
6
5
5
5
4
11
11
1
43
19
18
8
5
5
4
5
13
9
1
44
17
16
11
12
9
10
17
6
1
44
16
17
5
5
6
4
5
16
1
1
44
13
12
11
14
11
12
13
10
1
44
22
20
19
11
15
14
14
13
6
1
1
43
17
18
11
13
14
14
9
13
1
43
21
18
19
11
14
11
12
4
7
1
44
13
14
11...

output:

? 43 21
? 42 21
? 32 21
? 38 21
? 41 21
? 40 21
? 41 19
? 41 6
! 41 6
? 39 17
? 20 42
? 19 42
? 31 42
? 25 42
? 28 42
? 29 42
? 30 42
? 29 7
? 29 5
! 29 5
? 6 27
? 5 27
? 38 27
? 32 27
? 35 27
? 37 27
? 36 27
? 36 14
? 36 4
! 36 24
? 43 21
? 42 21
? 32 21
? 26 21
? 29 21
? 28 21
? 27 21
? 28 6
? 28 ...

result:

ok ok (1000 test cases)

Test #15:

score: 0
Accepted
time: 19ms
memory: 3584kb

input:

1000
45
18
19
11
13
12
12
11
18
1
1
45
8
9
11
7
6
5
6
8
1
1
45
11
10
11
9
8
7
8
11
12
1
45
9
8
9
3
6
4
5
9
1
45
12
11
6
6
3
4
12
11
1
45
8
7
11
6
5
4
5
2
3
1
45
19
18
11
17
16
17
19
4
1
45
5
6
11
8
5
5
4
3
5
1
44
19
20
11
17
20
19
20
19
4
1
45
21
22
10
5
7
6
6
11
1
1
44
20
19
9
3
2
2
3
20
3
1
45
22
...

output:

? 38 15
? 37 15
? 4 15
? 43 15
? 1 15
? 44 15
? 45 15
? 45 22
? 45 5
! 45 5
? 39 16
? 38 16
? 5 16
? 44 16
? 41 16
? 42 16
? 43 16
? 42 19
? 42 12
! 42 12
? 22 44
? 21 44
? 10 44
? 16 44
? 19 44
? 18 44
? 17 44
? 18 40
? 18 30
! 18 5
? 12 34
? 11 34
? 45 34
? 6 34
? 3 34
? 5 34
? 6 28
? 6 24
! 6 32
...

result:

ok ok (1000 test cases)

Test #16:

score: 0
Accepted
time: 8ms
memory: 3712kb

input:

1000
46
22
22
12
17
14
13
13
4
7
1
46
9
10
10
4
7
5
3
1
1
46
10
11
11
5
8
6
10
1
1
46
19
18
11
15
16
15
14
19
5
1
46
19
20
8
6
9
9
5
1
1
46
17
18
6
6
9
7
7
1
1
46
6
7
9
3
4
3
2
6
1
1
46
12
11
11
14
11
11
10
8
1
1
46
22
21
10
5
8
9
9
22
2
1
46
21
22
12
16
13
12
13
3
5
1
45
20
19
11
17
20
19
20
18
1
1...

output:

? 22 45
? 21 45
? 33 45
? 27 45
? 30 45
? 31 45
? 32 45
? 31 8
? 31 5
! 31 11
? 24 1
? 23 1
? 35 1
? 29 1
? 32 1
? 30 1
? 29 6
? 29 4
! 29 4
? 34 11
? 33 11
? 45 11
? 39 11
? 42 11
? 40 11
? 39 16
? 39 7
! 39 7
? 16 39
? 15 39
? 4 39
? 10 39
? 13 39
? 12 39
? 11 39
? 11 34
? 11 16
! 11 6
? 36 13
? 3...

result:

ok ok (1000 test cases)

Test #17:

score: 0
Accepted
time: 71ms
memory: 3712kb

input:

1000
1000000000
499999999
499999998
250000000
374999999
312500000
343750000
359374999
351562499
347656250
349609375
350585938
351074219
351318360
351440429
351379395
351409912
351394653
351387024
351383210
351385118
351386071
351385595
351385834
351385953
351386013
351386042
351386028
351386036
3513...

output:

? 20661342 520661342
? 20661341 520661342
? 770661342 520661342
? 895661342 520661342
? 833161342 520661342
? 864411342 520661342
? 880036342 520661342
? 872223842 520661342
? 868317592 520661342
? 870270717 520661342
? 871247280 520661342
? 871735561 520661342
? 871979702 520661342
? 872101772 5206...

result:

ok ok (1000 test cases)

Test #18:

score: 0
Accepted
time: 56ms
memory: 3712kb

input:

1000
1000000000
499999969
499999968
249999969
125000000
187499969
156250000
171875000
179687500
183593719
181640625
182617157
182128876
181884735
181762696
181823731
181854249
181869508
181877106
181873323
181875230
181876184
181876630
181876423
181876511
181876452
181876453
181876453
181876445
1818...

output:

? 721374429 221374429
? 721374428 221374429
? 471374429 221374429
? 346374429 221374429
? 408874429 221374429
? 377624429 221374429
? 393249429 221374429
? 401061929 221374429
? 404968179 221374429
? 403015054 221374429
? 403991617 221374429
? 403503336 221374429
? 403259195 221374429
? 403137125 22...

result:

ok ok (1000 test cases)

Test #19:

score: 0
Accepted
time: 61ms
memory: 3584kb

input:

1000
1000000000
447875503
447875504
250000000
322875504
260375504
229125504
234375000
226562500
225219254
224609375
224242692
224121093
223998552
223999022
223937987
223968035
223952776
223945147
223941332
223939425
223938471
223937994
223937756
223937867
223937807
223937777
223937762
223937755
2239...

output:

? 13136345 513136345
? 13136344 513136345
? 263136345 513136345
? 138136344 513136345
? 200636344 513136345
? 231886344 513136345
? 247511344 513136345
? 239698844 513136345
? 235792594 513136345
? 237745719 513136345
? 236769156 513136345
? 237257437 513136345
? 237013296 513136345
? 237135366 5131...

result:

ok ok (1000 test cases)

Test #20:

score: 0
Accepted
time: 66ms
memory: 3712kb

input:

1000
1000000000
227515888
227515889
250000000
125000071
165015889
133765889
118140889
117187571
114234639
115234446
114257883
113769602
113990499
113868429
113807394
113776876
113761617
113761972
113758157
113759710
113758757
113758280
113758042
113758037
113757983
113758007
113757992
113757984
1137...

output:

? 770999367 270999367
? 770999366 270999367
? 20999367 270999367
? 895999366 270999367
? 833499366 270999367
? 864749366 270999367
? 880374366 270999367
? 888186866 270999367
? 884280616 270999367
? 886233741 270999367
? 885257178 270999367
? 884768897 270999367
? 884524756 270999367
? 884646826 270...

result:

ok ok (1000 test cases)

Test #21:

score: 0
Accepted
time: 64ms
memory: 3712kb

input:

1000
1000000000
288090905
288090906
250000000
215196518
225590906
194340906
199571518
191759018
190434656
189805893
189458094
189317611
189213954
189195540
189152919
189165022
189149763
189145290
189145948
189144041
189144337
189143860
189143802
189143741
189143742
189143712
189143727
189143719
1891...

output:

? 647271662 147271662
? 647271661 147271662
? 897271662 147271662
? 772271661 147271662
? 709771661 147271662
? 741021661 147271662
? 756646661 147271662
? 748834161 147271662
? 744927911 147271662
? 746881036 147271662
? 745904473 147271662
? 746392754 147271662
? 746148613 147271662
? 746270683 14...

result:

ok ok (1000 test cases)

Test #22:

score: -100
Wrong Answer
time: 17ms
memory: 3712kb

input:

1000
999999999
499999999
499999998
499999999
250000000
374999999
312500000
343749999
328125000
335937499
332031249
330078125
331054687
330566407
330810548
330932617
330871583
330902101
330917359
330909731
330913545
330911638
330910684
330910207
330909970
330910089
330910149
330910178
330910163
33091...

output:

? 375917910 875917909
? 49528704 549528703
? 49528703 549528703
? 299528703 549528703
? 174528703 549528703
? 237028703 549528703
? 205778703 549528703
? 221403703 549528703
? 213591203 549528703
? 217497453 549528703
? 219450578 549528703
? 218474015 549528703
? 218962296 549528703
? 218718155 5495...

result:

wrong answer Too many queries: 41 (test case 230)